<h1>Introduction</h1>
<p>Studying logic and discrete mathematics prepares students for a powerful realization in their life:</p>
<blockquote>
<p>Computer programmers use English words <em><strong>very differently</strong></em> than people outside of the profession of computer programming do.</p>
</blockquote>
<p>The English word <code>mist</code> is used to describe times when you can see, smell, or taste that there are thousands of tiny droplets of water in the air.</p>
<p>The word <code>mist</code> is also a word in German, not just English. However, <code>mist</code> has a very different meaning in German than in English. I will let you look-up what it means. As a hint, the answer is <em>not</em> <code>nebel</code> and the answer is not fog or aerosolized water spray.</p>
<hr />
<h1>Logical Disjunction</h1>
<p>Studying logic and discrete mathematics prepares students for the fact that computer programmers use the word <code>or</code> differently than people outside of the profession do.</p>
<p>In computer programming the word <code>or</code> is used the same way as the word <code>or</code> is used by mathematicians.</p>
<p>However, Americans use the word <code>or</code> differently in mathematics and computer programming than they do in every-day life.</p>
<p>Suppose that <code>King Soopers</code> might be the name posted on a sign hung above one building where food is sold.</p>
<p>Also, <code>Mi Pueblo Market</code> might be the name posted above a different building where food is sold, a building at least 100 meters away from <code>King Soopers</code>.</p>
<p>Someone might say:</p>
<blockquote>
<p>We need spinach, eggs, cheese, and flour. Should we go to <code>King Soopers</code> <strong>OR</strong> <code>Mi Pueblo Market</code>?</p>
</blockquote>
<p>In somthing related to common English parlance, we have:</p>
<pre><code># THIS USAGE IS *MORE* CONSISTENT WITH THE ENGLISH LANGUAGE, THAN CONSISTENT WITH MATH, RELATIVLY SPEAKING
 
or(a, b)          = exactly one of {a, b} is true
or(a, b, c)       = exactly one of {a, b, c} is true
or(a, b, c, d)    = exactly one of {a, b, c, d} is true
or(a, b, c, d, e) = exactly one of {a, b, c, d, e} is true
</code></pre>
<p>In logic, mathematics, and computer science,</p>
<blockquote>
<p>The statement <code>x1 or x2 or... xn</code><br />
... means the same thing as...<br />
the statement <code>one or more of the statements x1 though xn is true</code></p>
</blockquote>
<p>Studying logic and discrete mathematics prepares students for the fact that computer programmers use English words differently than normal people do.</p>
<p>The following argument is valid in English, but is invalid in mathematical logic:</p>
<blockquote>
<p>Axiom 1. (We went to King Soopers for the groceries) <strong>or</strong> (we went to Mi Pueblo Market for the groceries).</p>
<p>Axiom 2. It is not the case that (we went to King Soopers for the groceries).</p>
<p>Conclusion. We must have gone to to Mi Pueblo Market for the groceries.</p>
</blockquote>
<p>The standards for the English language define the word <strong>OR</strong> differently for English than for <strong>OR</strong> in logic.</p>
<p>The German word <code>mist</code> has the same meaning as the English word <code>manure</code>.</p>
<p>A string of text, such as <code>mist</code> or the word <code>or</code> can have different meanings in different languages.</p>
<p>Mathematics is a different language than English. The word <code>or</code> has a meaning in computer programming which seems alien to many people who know English, but who do not know very much mathematics or much about computer programming either.</p>
<p>In a programming language named <a href="https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference">MathJax</a> some people write <code>lor</code> for <code>logical-or</code> instead of writing <code>or</code>.</p>
<p>Writing <code>lor</code> in computer programmes and writing <code>or</code> in English makes it very clear that the two words are different, but most computer programmers just write <code>or</code>.</p>
<hr />
<hr />
<h1>The Universal Quantifier ∀</h1>
<p>Studying logic and discrete mathematics prepares students for the fact that computer programmers use the following words and phrases differently than people outside of the profession of computer programming do.</p>
<blockquote>
<ul>
<li><code>all</code></li>
<li><code>every</code></li>
<li><code>for any</code></li>
<li><code>for each</code></li>
</ul>
</blockquote>
<p>Suppose that someone does <strong>not</strong> own a coin-operated laundromat.</p>
<p>The following statement is <strong>FALSE</strong> in English:</p>
<blockquote>
<p>three of the washing machines inside of my coin-operated laundromat are broken.</p>
</blockquote>
<p>The statement about three washing machines is <strong>TRUE</strong> in mathematical logic.</p>
<p>In mathematical logic, statements about non-existent things are always true.</p>
<p>In the English language, if something does not exist, then all statements about that thing are false.</p>
<p>For example, the statement <code>Joe's step-father's brother's pet monkey likes to play the drums</code> is false in English when:</p>
<blockquote>
<ul>
<li><p>Joe does not exist.</p>
</li>
<li><p>Joe exists, but Joe has no step-father</p>
</li>
<li><p>Joe exists, and Joe has a step-father, but Joe's step-father has no brother.</p>
</li>
<li><p>Joe exists, and Joe has a step-father, and the step-father has a brother, but the brother does not have a pet monkey.</p>
</li>
<li><p>Joe exists, and Joe has a step-father, and the step-father has a brother, and the brother has a pet monkey, but it is not true that the monkey likes to play the drums.</p>
</li>
</ul>
</blockquote>
<p>In mathematical logic, if the category of things satisfying some property ends up being an empty category, then everything about that category is true.</p>
<p>Suppose that there was an elementary school in the year 2020 in some city.</p>
<p>Also, suppose that every child in that school had a cubby where a <em><strong>cubby</strong></em> is a plastic or wood bin which people put things in.</p>
<p>Suppose that Jill ate her snack, it is the end of the day, and she only has 20 minutes left before she goes home.</p>
<p>Consider the following statement:</p>
<blockquote>
<p>For any snack, x, in Jill's Cubby, snack x is a Twinkie.</p>
</blockquote>
<p>That statement is false in English, because there do not exist any snacks inside of Jill's cubby.</p>
<p>However, that statement is true in mathematical logic, discrete mathematics, and computer programming, because there do not exist any snacks inside of Jill's cubby.</p>
<hr />
<h1>Final Remarks</h1>
<p>I am too tired to explain everything now, but suffice it to say that the key words and phrases to learn about are show below:</p>
<h1>Predicates of One Input</h1>
<blockquote>
<ul>
<li><p><em><strong>Logical  Identity</strong></em> ... <code>I(x)</code> is true no matter what <code>x</code> is.</p>
</li>
<li><p><em><strong>Logical Contradiction</strong></em> ... <code>NO(x)</code> is false no matter what <code>x</code> is.</p>
</li>
<li><p><em><strong>Logical Negation</strong></em> ... <code>NO(x)</code> is false if <code>x</code> is true and <code>NO(x)</code> is true if <code>x</code> is false.</p>
</li>
</ul>
</blockquote>
<hr />
<h1>Predicates of Two Inputs</h1>
<p>There are 16 predicates such that each predicate has two inputs, but only four of them are shown below:</p>
<blockquote>
<p><em><strong>Binary Logical Identity</strong></em> ... <code>I(x, y)</code> is always true. It does not matter if <code>x</code> is true or false, <code>I(x, y)</code> is still true. It does not matter if <code>y</code> is true or false either. We could write <code>∀ x, y ∈ {0, 1}, I(x, y) = 1</code> or <code>for any x element of the category 0 or 1 and for any y element of the category 0 or 1, the identity of x and y is 1</code>.</p>
<p><em><strong>Binary Logical Contradiction</strong></em> ... <code>I(x, y)</code> is always false. It does not matter if <code>x</code> is true or false, <code>I(x, y)</code> is still true. It does not matter if <code>y</code> is true or false either.</p>
<ul>
<li><p><em><strong>Logical Conjunction</strong></em> ... <code>LAND(x, y)</code> is true if and only if <code>x</code> and <code>y</code> are both true.  Did you brush your teeth <em><strong>AND</strong></em> put your sort your clean laundry so that the clean socks are not mixed with shirts and shirt are not mixed together with pants?</p>
</li>
<li><p><em><strong>Logical Disjunction</strong></em> ... <code>LOR(x1, x2, x3, ....)</code>. For example, You may take an apple <em><strong>and/or</strong></em> a piece of candy from Sam's house on Halloweens. Logical disjunction is the same as the English phrase <code>and/or</code>.</p>
</li>
<li><p><em><strong>Logical Implication</strong></em> ... <code>NO(x)</code> is false if <code>x</code> is true and <code>NO(x)</code> is true if <code>x</code> is false.</p>
</li>
</ul>
</blockquote>
<h1>Predicates of Three or More Inputs</h1>
<blockquote>
<ul>
<li><p>We can have logical conjunction <code>LAND(x1, x2, x3, ... xn)</code> with three or more inputs. The output is true if and only if all of the inputs are true. If one or more inputs are false, the whole thing is false.</p>
</li>
<li><p>We can have logical disjunction <code>LOR(x1, x2, x3, ... xn)</code> with three or more inputs. The output is true if and only if at least one of the inputs is true. If false of the inputs are false, then the output of <code>LOR</code> is false.</p>
</li>
</ul>
</blockquote>
<hr />
<h1>Set Theory</h1>
<p>Sets are categories of things.</p>
<p>berries are an example of a subset of the set all edible fruits and vegetables.</p>
<p>The number <code>1</code> is an element of <code>{1, 2, 3}</code></p>
<p>The number <code>5</code> is *<strong>not</strong> an element of <code>{1, 2, 3}</code></p>
<p>Suppose that:</p>
<blockquote>
<ul>
<li><p>a peanut is inside of a can of other peanuts.</p>
</li>
<li><p>the can is inside of Joe's car</p>
</li>
</ul>
<blockquote>
<p>...then...</p>
</blockquote>
<ul>
<li>the peanut is <strong>not</strong> inside of Joe's car</li>
</ul>
</blockquote>
<p>Why? Because if the can of peanuts is a <em><strong>set</strong></em> and Joe's car is a <em><strong>set</strong></em>, then we have the element-of operator <code>∈</code> is not transitive.</p>
<p>The <em><strong>Transitive Property</strong></em> of English words like <code>in</code>, was fun for certain strange mathematically inclined people, like myself, to learn about, and might be fun for you too.</p>
<hr />
<h1>The Universal Quantifier</h1>
<p>Learn how to compute whether a statement is true or false when the statement contains a word or phrase such as <code>any</code> or <code>all</code>.</p>
<hr />
<h1>The Existential Quantifier</h1>
<p>Learn how to compute whether a statement is true or false when the statement contains a word or phrase such as <code>at least one</code>.</p>

CC BY-SA 4.0
2023-11-04T13:52:52.913Z
You went pretty far afield on this journey. I would mention that English *or* is ambiguous, and is understood as either inclusive or exclusive based on context. A teacher instructing children: "you will get a prize if you turned in the homework yesterday or if you finished the project this afternoon" is standard inclusive or. You will certainly get the prize if you have done both. By contrast, your supermarket example is exclusive or. In formal logic, we have separated out the two meanings into different symbols for disambiguation purposes.
Ben I.
CC BY-SA 4.0
2023-11-07T18:05:28.070Z
@BenI. You wrote, "you went pretty far afield on this ***journey***". I am guessing that you are using the word ***journey*** to refer to my written response to the question asked by Mohan Radhakrishnan. Do you mean that my answer was too long> I wrote 8,109 characters or 1,489 words. It is possible to stray even farther afield. Everything I wrote is one the same topics as the book titled  'A Logical Approach to Discrete Math'. I discussed logic and I discussed a little bit of discrete math. I apologize for going too far afield.
Samuel Muldoon
CC BY-SA 4.0
2023-11-08T02:02:02.043Z
Ah, I didn't realize that those were the book topics. I retract that comment! (Though, in all honestly, it wasn't meant as a stinging criticism - it was more a note about the effort you underwent to cover quite a lot of breadth!)
Ben I.
CC BY-SA 4.0
2023-11-04T03:52:21.360Z
2023-11-04T03:52:21.360Z
Samuel Muldoon
<p>I'd rephrase the question as <em>Should I apply 'A Logical Approach to Discrete Math' to programming, and if so, how?</em></p>
<p>My answer to the rephrased question is <em>No</em>. Logic is a must but that approach doesn't work well.</p>
<p>Back in the 90ies we tested the book by using it to teach undergrads. The outcome was discouraging. Most students got lost in the myriad of rewrite rules and failed to see the forest for the trees. While doing so, they missed out on heaps of other relevant material typically taught under the discrete maths umbrella.</p>
<p>Nowadays, I'd argue that students are better served with a course along the lines of <a href="https://courses.csail.mit.edu/6.042/spring18/mcs.pdf" rel="nofollow noreferrer">Lehman, Leighton, and Meyer's course at MIT</a>, which is much stronger on intuitions and content. Combine that with <a href="https://www.cs.ox.ac.uk/publications/books/PfS/" rel="nofollow noreferrer">Morgan's 'Programming from Specifications</a> for learning how to use logical reasoning to derive beautiful imperative code.</p>
<p>For rigorous functional programming, equational reasoning comes in handy, yet I'd warn against pursuing that the Schneider &amp; Gries way. There is no need to turn students into symbol-pushing rewrite systems. Computers are much better at that.</p>
<p>Once the value of logic (so far, propositional and predicate logic) is established, other logics can be introduced, for instance, temporal logic in the context of a course on concurrency.</p>

CC BY-SA 4.0
2023-11-07T13:55:28.200Z
I agree. I've had a course with David, actually, and his precision in things is legendary. A better sources for _programming_ at this level of precision is his _The Science of Programming_, though it is a strictly procedural approach. It is sort of the "applied" version of the book in the title here.
Buffy
CC BY-SA 4.0
2024-02-25T11:28:10.427Z
I use TLAPlus. So I believe I understand the applications  of temporal logic specifications to some extent.
Mohan Radhakrishnan
CC BY-SA 4.0
2023-11-07T10:18:30.987Z
2023-11-07T10:18:30.987Z
Kai
<p>I am a professional programmer and when I came across David Gries' book(rather expensive) and his <a href="https://www.cs.cornell.edu/gries/Logic/intro.html" rel="nofollow noreferrer">website</a> I was fascinated. This wasn't how I learnt to code(mainly Java but also basic Haskell and Ocaml ). But I couldn't understand how this mode of logic or math can be applied to application code.
So I seek some guidance from those who really code like this. Can one read this rigorous book and learn to code ( mainly functional programming languages ) ? Is this logic and math directly applicable to code ?</p>

CC BY-SA 4.0
2022-08-01T09:32:01.370Z
I am not entirely certain, but the question looks like it might be a better fit for [Computer Science Stack Exchange](https://cs.stackexchange.com/help/on-topic).
TuringTux
CC BY-SA 4.0
2022-08-01T12:26:27.737Z
I looked at that forum. Seems like If I have specific logic questions I can ask there.
Mohan Radhakrishnan
CC BY-SA 4.0
2022-08-01T16:02:30.203Z
Haskell road to logic https://books.google.co.in/books/about/The_Haskell_Road_to_Logic_Maths_and_Prog.html?id=YCC6lwEACAAJ&source=kp_book_description&redir_esc=y may be more close to what you seek than Gries /Schneider. I could say more if it's needed... Meanwhile see my https://cseducators.stackexchange.com/search?q=user:8837+[functional-programming]
Rushi
CC BY-SA 4.0
2022-08-02T04:00:34.817Z
Just to retract slightly : Haskell road to logic is not a great book but is in the direction you're seeking. Gries is a superb book but not (very) useful for your direction
Rushi
CC BY-SA 4.0
2022-08-02T05:41:22.853Z
One more point : since you're into python + machine learning I'd recommend APL.  It's a functional language as old as lisp but much neglected. If you grok numpy and you study APL you'll see the original of which numpy is a poor imitation. For non FP-ers APL can be frightening. Coming from an FP perspective you should find it accessible and enjoyable. And Dyalog is nowadays freely downloadable
Rushi
<boolean-algebra><discrete-math>
How do I apply 'A Logical Approach to Discrete Math' to programming?
# How do I apply 'A Logical Approach to Discrete Math' to programming?

(Asked by: username_0 on 2022-08-01)

I am a professional programmer and when I came across David Gries' book(rather expensive) and his [website](https://www.cs.cornell.edu/gries/Logic/intro.html) I was fascinated. This wasn't how I learnt to code(mainly Java but also basic Haskell and Ocaml ). But I couldn't understand how this mode of logic or math can be applied to application code.
So I seek some guidance from those who really code like this. Can one read this rigorous book and learn to code ( mainly functional programming languages ) ? Is this logic and math directly applicable to code ?

**Tags:** boolean-algebra, discrete-math

> **Comments:**
> **username_1**: I am not entirely certain, but the question looks like it might be a better fit for [Computer Science Stack Exchange](https://cs.stackexchange.com/help/on-topic).  
> **username_0**: I looked at that forum. Seems like If I have specific logic questions I can ask there.  
> **username_2**: Haskell road to logic https://books.google.co.in/books/about/The_Haskell_Road_to_Logic_Maths_and_Prog.html?id=YCC6lwEACAAJ&source=kp_book_description&redir_esc=y may be more close to what you seek than Gries /Schneider. I could say more if it's needed... Meanwhile see my https://cseducators.stackexchange.com/search?q=user:8837+[functional-programming]  
> **username_2**: Just to retract slightly : Haskell road to logic is not a great book but is in the direction you're seeking. Gries is a superb book but not (very) useful for your direction  
> **username_2**: One more point : since you're into python + machine learning I'd recommend APL.  It's a functional language as old as lisp but much neglected. If you grok numpy and you study APL you'll see the original of which numpy is a poor imitation. For non FP-ers APL can be frightening. Coming from an FP perspective you should find it accessible and enjoyable. And Dyalog is nowadays freely downloadable  

---

## 2 answers

### Answer by username_5 on 2023-11-07. Score: 3

I'd rephrase the question as *Should I apply 'A Logical Approach to Discrete Math' to programming, and if so, how?*

My answer to the rephrased question is *No*. Logic is a must but that approach doesn't work well.

Back in the 90ies we tested the book by using it to teach undergrads. The outcome was discouraging. Most students got lost in the myriad of rewrite rules and failed to see the forest for the trees. While doing so, they missed out on heaps of other relevant material typically taught under the discrete maths umbrella.

Nowadays, I'd argue that students are better served with a course along the lines of [Lehman, Leighton, and Meyer's course at MIT](https://courses.csail.mit.edu/6.042/spring18/mcs.pdf), which is much stronger on intuitions and content. Combine that with [Morgan's 'Programming from Specifications](https://www.cs.ox.ac.uk/publications/books/PfS/) for learning how to use logical reasoning to derive beautiful imperative code.

For rigorous functional programming, equational reasoning comes in handy, yet I'd warn against pursuing that the Schneider & Gries way. There is no need to turn students into symbol-pushing rewrite systems. Computers are much better at that.

Once the value of logic (so far, propositional and predicate logic) is established, other logics can be introduced, for instance, temporal logic in the context of a course on concurrency.

> **Comments:**
> **username_6**: I agree. I've had a course with David, actually, and his precision in things is legendary. A better sources for _programming_ at this level of precision is his _The Science of Programming_, though it is a strictly procedural approach. It is sort of the "applied" version of the book in the title here.  
> **username_0**: I use TLAPlus. So I believe I understand the applications  of temporal logic specifications to some extent.  

---

### Answer by username_3 on 2023-11-04. Score: 0

Introduction
Studying logic and discrete mathematics prepares students for a powerful realization in their life:

Computer programmers use English words very differently than people outside of the profession of computer programming do.

The English word mist is used to describe times when you can see, smell, or taste that there are thousands of tiny droplets of water in the air.
The word mist is also a word in German, not just English. However, mist has a very different meaning in German than in English. I will let you look-up what it means. As a hint, the answer is not nebel and the answer is not fog or aerosolized water spray.

Logical Disjunction
Studying logic and discrete mathematics prepares students for the fact that computer programmers use the word or differently than people outside of the profession do.
In computer programming the word or is used the same way as the word or is used by mathematicians.
However, Americans use the word or differently in mathematics and computer programming than they do in every-day life.
Suppose that King Soopers might be the name posted on a sign hung above one building where food is sold.
Also, Mi Pueblo Market might be the name posted above a different building where food is sold, a building at least 100 meters away from King Soopers.
Someone might say:

We need spinach, eggs, cheese, and flour. Should we go to King Soopers OR Mi Pueblo Market?

In somthing related to common English parlance, we have:
# THIS USAGE IS *MORE* CONSISTENT WITH THE ENGLISH LANGUAGE, THAN CONSISTENT WITH MATH, RELATIVLY SPEAKING
 
or(a, b)          = exactly one of {a, b} is true
or(a, b, c)       = exactly one of {a, b, c} is true
or(a, b, c, d)    = exactly one of {a, b, c, d} is true
or(a, b, c, d, e) = exactly one of {a, b, c, d, e} is true

In logic, mathematics, and computer science,

The statement x1 or x2 or... xn
... means the same thing as...
the statement one or more of the statements x1 though xn is true

Studying logic and discrete mathematics prepares students for the fact that computer programmers use English words differently than normal people do.
The following argument is valid in English, but is invalid in mathematical logic:

Axiom 1. (We went to King Soopers for the groceries) or (we went to Mi Pueblo Market for the groceries).
Axiom 2. It is not the case that (we went to King Soopers for the groceries).
Conclusion. We must have gone to to Mi Pueblo Market for the groceries.

The standards for the English language define the word OR differently for English than for OR in logic.
The German word mist has the same meaning as the English word manure.
A string of text, such as mist or the word or can have different meanings in different languages.
Mathematics is a different language than English. The word or has a meaning in computer programming which seems alien to many people who know English, but who do not know very much mathematics or much about computer programming either.
In a programming language named MathJax some people write lor for logical-or instead of writing or.
Writing lor in computer programmes and writing or in English makes it very clear that the two words are different, but most computer programmers just write or.


The Universal Quantifier ∀
Studying logic and discrete mathematics prepares students for the fact that computer programmers use the following words and phrases differently than people outside of the profession of computer programming do.


all
every
for any
for each


Suppose that someone does not own a coin-operated laundromat.
The following statement is FALSE in English:

three of the washing machines inside of my coin-operated laundromat are broken.

The statement about three washing machines is TRUE in mathematical logic.
In mathematical logic, statements about non-existent things are always true.
In the English language, if something does not exist, then all statements about that thing are false.
For example, the statement Joe's step-father's brother's pet monkey likes to play the drums is false in English when:


Joe does not exist.

Joe exists, but Joe has no step-father

Joe exists, and Joe has a step-father, but Joe's step-father has no brother.

Joe exists, and Joe has a step-father, and the step-father has a brother, but the brother does not have a pet monkey.

Joe exists, and Joe has a step-father, and the step-father has a brother, and the brother has a pet monkey, but it is not true that the monkey likes to play the drums.



In mathematical logic, if the category of things satisfying some property ends up being an empty category, then everything about that category is true.
Suppose that there was an elementary school in the year 2020 in some city.
Also, suppose that every child in that school had a cubby where a cubby is a plastic or wood bin which people put things in.
Suppose that Jill ate her snack, it is the end of the day, and she only has 20 minutes left before she goes home.
Consider the following statement:

For any snack, x, in Jill's Cubby, snack x is a Twinkie.

That statement is false in English, because there do not exist any snacks inside of Jill's cubby.
However, that statement is true in mathematical logic, discrete mathematics, and computer programming, because there do not exist any snacks inside of Jill's cubby.

Final Remarks
I am too tired to explain everything now, but suffice it to say that the key words and phrases to learn about are show below:
Predicates of One Input


Logical  Identity ... I(x) is true no matter what x is.

Logical Contradiction ... NO(x) is false no matter what x is.

Logical Negation ... NO(x) is false if x is true and NO(x) is true if x is false.




Predicates of Two Inputs
There are 16 predicates such that each predicate has two inputs, but only four of them are shown below:

Binary Logical Identity ... I(x, y) is always true. It does not matter if x is true or false, I(x, y) is still true. It does not matter if y is true or false either. We could write ∀ x, y ∈ {0, 1}, I(x, y) = 1 or for any x element of the category 0 or 1 and for any y element of the category 0 or 1, the identity of x and y is 1.
Binary Logical Contradiction ... I(x, y) is always false. It does not matter if x is true or false, I(x, y) is still true. It does not matter if y is true or false either.

Logical Conjunction ... LAND(x, y) is true if and only if x and y are both true.  Did you brush your teeth AND put your sort your clean laundry so that the clean socks are not mixed with shirts and shirt are not mixed together with pants?

Logical Disjunction ... LOR(x1, x2, x3, ....). For example, You may take an apple and/or a piece of candy from Sam's house on Halloweens. Logical disjunction is the same as the English phrase and/or.

Logical Implication ... NO(x) is false if x is true and NO(x) is true if x is false.



Predicates of Three or More Inputs


We can have logical conjunction LAND(x1, x2, x3, ... xn) with three or more inputs. The output is true if and only if all of the inputs are true. If one or more inputs are false, the whole thing is false.

We can have logical disjunction LOR(x1, x2, x3, ... xn) with three or more inputs. The output is true if and only if at least one of the inputs is true. If false of the inputs are false, then the output of LOR is false.




Set Theory
Sets are categories of things.
berries are an example of a subset of the set all edible fruits and vegetables.
The number 1 is an element of {1, 2, 3}
The number 5 is *not an element of {1, 2, 3}
Suppose that:


a peanut is inside of a can of other peanuts.

the can is inside of Joe's car



...then...


the peanut is not inside of Joe's car


Why? Because if the can of peanuts is a set and Joe's car is a set, then we have the element-of operator ∈ is not transitive.
The Transitive Property of English words like in, was fun for certain strange mathematically inclined people, like myself, to learn about, and might be fun for you too.

The Universal Quantifier
Learn how to compute whether a statement is true or false when the statement contains a word or phrase such as any or all.

The Existential Quantifier
Learn how to compute whether a statement is true or false when the statement contains a word or phrase such as at least one.

> **Comments:**
> **username_4**: You went pretty far afield on this journey. I would mention that English *or* is ambiguous, and is understood as either inclusive or exclusive based on context. A teacher instructing children: "you will get a prize if you turned in the homework yesterday or if you finished the project this afternoon" is standard inclusive or. You will certainly get the prize if you have done both. By contrast, your supermarket example is exclusive or. In formal logic, we have separated out the two meanings into different symbols for disambiguation purposes.  
> **username_3**: @BenI. You wrote, "you went pretty far afield on this ***journey***". I am guessing that you are using the word ***journey*** to refer to my written response to the question asked by username_0. Do you mean that my answer was too long> I wrote 8,109 characters or 1,489 words. It is possible to stray even farther afield. Everything I wrote is one the same topics as the book titled  'A Logical Approach to Discrete Math'. I discussed logic and I discussed a little bit of discrete math. I apologize for going too far afield.  
> **username_4**: Ah, I didn't realize that those were the book topics. I retract that comment! (Though, in all honestly, it wasn't meant as a stinging criticism - it was more a note about the effort you underwent to cover quite a lot of breadth!)  

---

