A brief review of Lecture 01.
$p$ | $\neg p$ |
---|---|
$\mathsf{T}$ | |
$\mathsf{F}$ |
$p$ | $q$ | $p \wedge q$ |
---|---|---|
$\mathsf{F}$ | ||
$\mathsf{F}$ | ||
$\mathsf{F}$ | ||
$\mathsf{T}$ |
$p$ | $q$ | $p \vee q$ |
---|---|---|
$\mathsf{F}$ | ||
$\mathsf{T}$ | ||
$\mathsf{T}$ | ||
$\mathsf{T}$ |
$p$ | $q$ | $p \oplus q$ |
---|---|---|
$\mathsf{F}$ | ||
$\mathsf{T}$ | ||
$\mathsf{T}$ | ||
$\mathsf{F}$ |
$p$ | $q$ | $p \rightarrow q$ |
---|---|---|
$\mathsf{T}$ | ||
$\mathsf{T}$ | ||
$\mathsf{F}$ | ||
$\mathsf{T}$ |
$p$ | $q$ | $p \leftrightarrow q$ |
---|---|---|
$\mathsf{T}$ | ||
$\mathsf{F}$ | ||
$\mathsf{F}$ | ||
$\mathsf{T}$ |
$p$ | $q$ | $p \rightarrow q$ |
---|---|---|
$\mathsf{T}$ | ||
$\mathsf{T}$ | ||
$\mathsf{F}$ | ||
$\mathsf{T}$ |
In an implication $p \rightarrow q$:
Garfield has black stripes if he is an orange cat and likes lasagna, and he is an orange cat or does not like lasagna.
$\downarrow$ Step 1: abstract
($p$ if ($q$ and $r$)) and ($q$ or (not $r$))
$\downarrow$ Step 2: replace English connectives with logical connectives
(($q$ $\wedge$ $r$) $\rightarrow$ $p$) $\wedge$ ($q$ $\vee$ ($\neg$ $r$))
$p$ | $q$ | $r$ | $\neg r$ | $(q \vee (\neg r))$ | $(q \wedge r)$ | $((q \wedge r) \rightarrow p)$ | $((q \wedge r) \rightarrow p) \wedge (q \vee (\neg r))$ |
---|---|---|---|---|---|---|---|
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | |||
$\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | |||
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | |||
$\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{F}$ | |||
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | |||
$\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | |||
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | |||
$\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ |
Garfield has black stripes if he is an orange cat and likes lasagna, and he is an orange cat or does not like lasagna.
Converse, contrapositive, and inverse of implication.
Tautology, contradiction, contingency.
How do these relate to each other?
$p$ | $q$ | $p \rightarrow q$ | $q \rightarrow p$ | $\neg p$ | $\neg q$ | $\neg q \rightarrow \neg p$ | $\neg p \rightarrow \neg q$ |
---|---|---|---|---|---|---|---|
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | ||
$\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | ||
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ |
An implication and its contrapositive have the same truth value!
A compound proposition is a
Equivalence, laws of logic, and properties of logical connectives.
$A$ and $B$ are logically equivalent, written as $A \equiv B$, if they have the same truth values in all possible cases.
$A \equiv B$ is an assertion that $A$ and $B$ have the same truth tables.
$A \leftrightarrow B$ is a proposition that may be true or false depending on the truth values of the variables that occur in $A$ and $B$.
$A \equiv B$ and $(A \leftrightarrow B) \equiv \mathsf{T}$ have the same meaning.
$A$ and $B$ are equivalent when $A \leftrightarrow B$ is a tautology.
How do we check that an equivalence $A \equiv B$ holds?
Use truth tables to check that $A \leftrightarrow B$ is a tautology:
$p$ | $q$ | $\neg p$ | $\neg q$ | $\neg p \vee \neg q$ | $p \wedge q$ | $\neg (p \wedge q)$ | $\neg(p \wedge q) \leftrightarrow (\neg p \vee \neg q$) |
---|---|---|---|---|---|---|---|
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ |
Fun fact: you can also use a theorem prover to check that $\neg (A \leftrightarrow B)$ is a contradiction!
$p$ | $q$ | $p \rightarrow q$ | $\neg p$ | $\neg p \vee q$ | $(p \rightarrow q) \leftrightarrow (\neg p \vee q)$ |
---|---|---|---|---|---|
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | $\mathsf{T}$ | ||
$\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{F}$ | $\mathsf{T}$ | ||
$\mathsf{T}$ | $\mathsf{F}$ | $\mathsf{T}$ | $\mathsf{T}$ |
We will always give you this list!
Gates, combinational circuits, and circuit equivalence.
Digital circuits implement propositional logic:
Digital gates are functions that
AND connective
$p$ | $q$ | $p \wedge q$ |
---|---|---|
$\mathsf{F}$ | ||
$\mathsf{F}$ | ||
$\mathsf{F}$ | ||
$\mathsf{T}$ |
AND gate
$p$ | $q$ | |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
“Block looks like the D of an AND.”
OR connective
$p$ | $q$ | $p \vee q$ |
---|---|---|
$\mathsf{F}$ | ||
$\mathsf{T}$ | ||
$\mathsf{T}$ | ||
$\mathsf{T}$ |
OR gate
$p$ | $q$ | |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
“Arrowhead block looks like $\vee$.”
NOT connective
$p$ | $\neg p$ |
---|---|
$\mathsf{T}$ | |
$\mathsf{F}$ |
NOT gate
$p$ | |
---|---|
0 | 1 |
1 | 0 |
Also called an inverter.
You may write gates using blobs instead of shapes.
Values get sent along wires connecting gates.
$\neg p \wedge (\neg q \wedge (r \vee s))$
Wires can send one value to multiple gates.
$(p \wedge \neg q) \vee (\neg q \wedge r)$