The difference between AND and OR

We use the word and and or many times in every day language. Consider the following statements.

I will cook lunch and I will clean the room.

I will cook lunch or I will clean the room.

In the first statement, the speaker implies that he will do both things. He will cook lunch and clean the room. Of course, it doesn’t matter if he will do these things separately or which will he do first. The word and in this statement means that he will do both chores.

In the second sentence, the speaker implies that he is choosing between cooking lunch and cleaning the room. Although he may do the other thing later, but at that particular moment, the word or in this statement means that he is trying to choose to do one of the two chores.

The phrases above can be represented by p and q as follows.

p: I will cook lunch.

q: I will clean the room.

Using p and q, the first sentence can be represented by p and q, and the second sentence can be represented by p or q.

The sentence p and q is true when and only when both p and q are true. The sentence p or q is true in all cases except when both p and q are false.

The truth table of and and or is shown below. As we can see, p and q is only true if both of them are true, otherwise false.

The most familiar use of and and or in mathematics is probably inequality. In one variable inequality, when we say $x \leq 4$, we mean that $x < 4$ or $x = 4$. Suppose we let

p: x = 4

q: x < 4.

If $x = 1$, then it makes p FALSE and q TRUE. Still, this makes the statement $x \leq 4$ TRUE as shown in the second row of the or truth table.

Another example is the statement  $1 < x < 9$. This statement can be stated as $x > 1$ and $x < 9$. Again, if we let

p: x > 1

q: x < 9,

then, $x = -1$ makes the p FALSE and q TRUE. This makes the whole statement false as shown in the third row of the and truth table.  On the other hand, $x = 8$ makes both p and q TRUE (Can you see why?) and therefore, makes the statement true.

There are are two types of or statements. When a restaurant gives a free juice or shake, we usually assume that we can choose only one and will have to pay for the other one if we want both. This is called exclusive or. However, when we are asked if we want to have cream or sugar in our coffee, then we can ask one or for both. This is called inclusive or. So, inclusive or means p or q or both and exclusive or means p or q but not both. In math, we usually use inclusive or.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 10, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://mathandmultimedia.com/2015/04/08/difference-between-and-and-or/", "fetch_time": 1521676991000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2018-13/segments/1521257647707.33/warc/CC-MAIN-20180321234947-20180322014947-00129.warc.gz", "warc_record_offset": 199911610, "warc_record_length": 15492, "token_count": 630, "char_count": 2481, "score": 4.84375, "int_score": 5, "crawl": "CC-MAIN-2018-13", "snapshot_type": "longest", "language": "en", "language_score": 0.9434361457824707, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00051-of-00064.parquet"}