A proposition is a sentence to which one and only one of the terms \(\texttt{True}\) or \(\texttt{False}\) can be applied.
Which of the following are propositions?
A proposition is a sentence to which one and only one of the terms \(\texttt{True}\) or \(\texttt{False}\) can be applied.
Which of the following are propositions?
A Truth Table for negation would look like the following:
\(\begin{array}{|c|c|} \hline p & \neg p \\ \hline T & F \\ F & T \\ \hline \end{array}\)
What this is saying is:
“When \(p\) is \(\texttt{True}\), \(\neg p\) is \(\texttt{False}\),
and when \(p\) is \(\texttt{False}\), \(\neg p\) is \(\texttt{True}\).’’
Here is an example of a negated proposition:
A Truth Table for conjunction would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \land q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \\ \hline \end{array}\)
Here is an example of conjunction:
A Truth Table for conjunction would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \land q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \\ \hline \end{array}\)
Here is an example of conjunction:
The conjunction (\(p \land q\)) is \(\texttt{True}\) on sunny Mondays, but it is \(\texttt{False}\) on any non-sunny day (\(p\) is \(\texttt{False}\)), and it is \(\texttt{False}\) on any day that is not Monday (\(q\) is \(\texttt{False}\)).
A Truth Table for disjunction would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \lor q \\ \hline T & T & T \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline \end{array}\)
Here is an example of disjunction.
A Truth Table for disjunction would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \lor q \\ \hline T & T & T \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline \end{array}\)
Here is an example of disjunction.
The disjunction (\(p \lor q\)) is \(\texttt{True}\) on sunny Mondays, on any sunny day (\(p\) is \(\texttt{True}\)), and on any Monday (\(q\) is \(\texttt{True}\)). It is \(\texttt{False}\) on any day where it is both not sunny and not Monday.
A Truth Table for exclusive or would look like the following: \(\begin{array}{|c|c|c|} \hline p & q& p \oplus q \\ \hline T & T & F \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline \end{array}\)
Here is an example of exclusive or.
A Truth Table for exclusive or would look like the following: \(\begin{array}{|c|c|c|} \hline p & q& p \oplus q \\ \hline T & T & F \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline \end{array}\)
Here is an example of exclusive or.
The exclusive or (\(p \oplus q\)) is \(\texttt{True}\) on any sunny day (\(p\) is \(\texttt{True}\)) and on any Monday (\(q\) is \(\texttt{True}\)), EXCEPT for on sunny Mondays (both \(p\) and \(q\) are \(\texttt{True}\)). Additionally, it is \(\texttt{False}\) on any day where it is both not sunny and not Monday.
The conditional statement \(p \rightarrow q\) is False when \(p\) is \(\texttt{True}\) and \(q\) is \(\texttt{False}\), and True otherwise. \(p\) is called the hypothesis and \(q\) the conclusion. This can also be called implication.
Some English phrases for this would be:
A Truth Table for implication would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline \end{array}\)
\(\begin{array}{|c|c|c|} \hline p & q & p \rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline \end{array}\)
Here is an example of implication.
\(\begin{array}{|c|c|c|} \hline p & q & p \rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline \end{array}\)
Here is an example of implication.
The implication (\(p \rightarrow q\)) is \(\texttt{False}\) if it is sunny and I do NOT walk to campus. Otherwise, it is \(\texttt{True}\).
If it is not sunny (\(p\) is \(\texttt{False}\)) and I still walk to campus (\(q\) is \(\texttt{True}\)), this implication is still \(\texttt{True}\).
The biconditional statement (“if and only if” or “iff”) \(p \leftrightarrow q\) is \(\texttt{True}\) when \(p\) and \(q\) have the same truth value, and \(\texttt{False}\) otherwise.
A Truth Table for implication would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \leftrightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & T \\ \hline \end{array}\)
Here is an example of a biconditional.
The biconditional statement (“if and only if” or “iff”) \(p \leftrightarrow q\) is \(\texttt{True}\) when \(p\) and \(q\) have the same truth value, and \(\texttt{False}\) otherwise.
A Truth Table for implication would look like the following: \(\begin{array}{|c|c|c|} \hline p & q & p \leftrightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & T \\ \hline \end{array}\)
Here is an example of a biconditional.
The biconditional (\(p \leftrightarrow q\)) is \(\texttt{True}\) if it is sunny and I walk to campus or if it is not sunny and I don’t walk to campus. Otherwise, it is \(\texttt{False}\).
Unlike the previous example, if it is not sunny (\(p\) is \(\texttt{False}\)) and I still walk to campus (\(q\) is \(\texttt{True}\)), this biconditional is \(\texttt{False}\).
Everything else can be written as a combination of the above three, but in general, it’s best to always clarify order of operations using parentheses!
Logical expressions that result in the same truth values are considered logical equivalences.
Logical Equivalences can be proven two different ways:
We can prove the first part of DeMorgan’s Law
(\(\neg (p \land q) \equiv \neg p \lor \neg
q\)) using a truth table.
\(\begin{array}{|c|c|c|c|c|c|c|} \hline p & q & \neg p & \neg q & p \land q & \neg(p \land q) & \neg p \lor \neg q \\ \hline T & T \\ T & F \\ F & T \\ F & F \\ \hline \end{array}\)
We can prove the first part of DeMorgan’s Law
(\(\neg (p \land q) \equiv \neg p \lor \neg
q\)) using a truth table.
\(\begin{array}{|c|c|c|c|c|c|c|} \hline p & q & \neg p & \neg q & p \land q & \neg(p \land q) & \neg p \lor \neg q \\ \hline T & T & F & F & T & F & F\\ T & F & F & T & F & T & T\\ F & T & T & F & F & T & T\\ F & F & T & T & F & T & T \\ \hline \end{array}\)
The columns for \(\neg(p \land q)\) and \(\neg p \lor \neg q\) are equal, so this means \(\neg(p \land q)\) and \(\neg p \lor \neg q\) are logically equivalent!
propositions = \(\{p\}\)
truth values = \(\{\texttt{True}, \texttt{False}\}\)
Truth table:
\(\begin{array}{|c|} \hline p \\ \hline T \\ F \\ \hline \end{array}\)
2 rows…
propositions = \(\{p, q\}\)
truth values = \(\{\texttt{True}, \texttt{False}\}\)
Truth table:
\(\begin{array}{|c|c|} \hline p & q \\ \hline T & T \\ T & F \\ F & T \\ F & F \\ \hline \end{array}\)
4 rows…
propositions = \(\{p,q,...\}\) \(\leftarrow\) \(n\) propositions
truth values = \(\{\texttt{True}, \texttt{False}\}\)
?
propositions = \(\{p,q,...\}\) \(\leftarrow\) \(n\) propositions
truth values = \(\{\texttt{True}, \texttt{False}\}\)
\(2^n\) rows!
\(\begin{array}{|c|c|c|} \hline p & \neg p & p \lor \neg p \\ \hline T & F & T \\ F & T & T \\ \hline \end{array}\)
For all values, \(p \lor \neg p\) evaluates to \(\texttt{True}\)!
To translate logic to and from English sentences, it is important to know the common phrases for the operators.
Here’s an example of breaking up an English language sentence.
The rest of these slides are optional, but they demonstrate how logic can be used for problem solving!
On an island, every inhabitant is a knight who always tells the truth, or a knave who always lies. You meet three inhabitants, Alice, Bob, and Chris.
Can you determine uniquely what each of Alice, Bob, and Chris are?
\(2.\) Transform what they say into statements that always should evaluate to \(\texttt{True}\). These are the rules of our world.
\(2.\) Transform what they say into statements that always should evaluate to \(\texttt{True}\). These are the rules of our world.
(Propositions:
\(\{A =\) “Alice is a knight”, \(B =\) “Bob is a knight”,\(C=\) “Chris is a knight”, \(\neg A =\) “Alice is a knave”, \(\neg B =\) “Bob is a knave”,\(\neg C=\) “Chris is a knave”})
\(2.\) Transform what they say into statements that always should evaluate to \(\texttt{True}\). These are the rules of our world.
(Propositions:
\(\{A =\) “Alice is a knight”, \(B =\) “Bob is a knight”,\(C=\) “Chris is a knight”, \(\neg A =\) “Alice is a knave”, \(\neg B =\) “Bob is a knave”,\(\neg C=\) “Chris is a knave”})
\(3.\) Make a truth table
Rules of the World: \(A \rightarrow (\neg B \lor C)\) and \(B \rightarrow (A \leftrightarrow \neg C)\)
\(\begin{array}{|c|c|c|c|c|} \hline A & B & C & A \rightarrow (\neg B \lor C) & B \rightarrow (A \leftrightarrow \neg C) \\ \hline T & T & T & T & F\\ T & T & F & F & T\\ \color{yellow}T & \color{yellow}F & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ \color{yellow}T & \color{yellow}F & \color{yellow}F &\color{yellow} T &\color{yellow}T\\ \color{yellow}F & \color{yellow}T & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ F & T & F & T &F\\ \color{yellow}F & \color{yellow}F & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ \color{yellow}F & \color{yellow}F & \color{yellow}F & \color{yellow}T &\color{yellow}T\\ \hline \end{array}\)
\(4.\) Check if a unique row makes both statements true.
\(\begin{array}{|c|c|c|c|c|} \hline A & B & C & A \rightarrow (\neg B \lor C) & B \rightarrow (A \leftrightarrow \neg C) \\ \hline T & T & T & T & F\\ T & T & F & F & T\\ \color{yellow}T & \color{yellow}F & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ \color{yellow}T & \color{yellow}F & \color{yellow}F &\color{yellow} T &\color{yellow}T\\ \color{yellow}F & \color{yellow}T & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ F & T & F & T &F\\ \color{yellow}F & \color{yellow}F & \color{yellow}T & \color{yellow}T &\color{yellow}T\\ \color{yellow}F & \color{yellow}F & \color{yellow}F & \color{yellow}T &\color{yellow}T\\ \hline \end{array}\)
All of the values in yellow are assignments that could work! Let’s test one of these!
\(A = T, B = F, C = T\)
So, Alice is a knight, Bob is a knave, and Chris is a knight.
Both of our rules hold in this world with these assignments, so we know that this solution works!
This problem isn’t explicit enough, so we found ourselves making an assumption.
When we solved it, we assumed that if someone is lying, they don’t actually know whether or not what they are saying is the truth, so their claim could either be true or false. This is why we were able to use implication.
However, what if we assumed that if someone is lying, they know their claim is false?
If we assume that if someone is lying, they know their claim is false, then we would have to explain our rules using a biconditional.
Therefore, our answer is correct for what we assume the rules of the world are, but that might not match the author of the puzzle’s original intention. This shows the benefit of logic! We can use it to address these ambiguities!