Minor edits
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
\section{Logical Algebra}
|
||||
|
||||
\definition{}
|
||||
\textit{Logical operators} operate on the values $\{\text{True}, \text{False}\}$, \par
|
||||
\textit{Logical operators} operate on the values $\{\texttt{true}, \texttt{false}\}$, \par
|
||||
just like algebraic operators operate on numbers. \par
|
||||
In this handout, we'll use the following operators:
|
||||
\begin{itemize}
|
||||
@ -9,7 +9,7 @@ In this handout, we'll use the following operators:
|
||||
\item $\land$: and
|
||||
\item $\lor$: or
|
||||
\item $\rightarrow$: implies
|
||||
\item $()$, parenthesis.
|
||||
\item $()$: parenthesis.
|
||||
\end{itemize}
|
||||
|
||||
The function of these is defined by \textit{truth tables}:
|
||||
@ -19,10 +19,10 @@ The function of these is defined by \textit{truth tables}:
|
||||
\hline
|
||||
$A$ & $B$ & $A \land B$ \\
|
||||
\hline
|
||||
F & F & F \\
|
||||
F & T & F \\
|
||||
T & F & F \\
|
||||
T & T & T
|
||||
\texttt{F} & \texttt{F} & \texttt{F} \\
|
||||
\texttt{F} & \texttt{T} & \texttt{F} \\
|
||||
\texttt{T} & \texttt{F} & \texttt{F} \\
|
||||
\texttt{T}& \texttt{T} & \texttt{T}
|
||||
\end{tabular}
|
||||
\hfill
|
||||
\begin{tabular}{ c | c | c }
|
||||
@ -30,10 +30,10 @@ The function of these is defined by \textit{truth tables}:
|
||||
\hline
|
||||
$A$ & $B$ & $A \lor B$ \\
|
||||
\hline
|
||||
F & F & F \\
|
||||
F & T & T \\
|
||||
T & F & T \\
|
||||
T & T & T
|
||||
\texttt{F} & \texttt{F} & \texttt{F} \\
|
||||
\texttt{F} & \texttt{T} & \texttt{T} \\
|
||||
\texttt{T} & \texttt{F} & \texttt{T} \\
|
||||
\texttt{T} & \texttt{T} & \texttt{T}
|
||||
\end{tabular}
|
||||
\hfill
|
||||
\begin{tabular}{ c | c | c }
|
||||
@ -41,10 +41,10 @@ The function of these is defined by \textit{truth tables}:
|
||||
\hline
|
||||
$A$ & $B$ & $A \rightarrow B$ \\
|
||||
\hline
|
||||
F & F & T \\
|
||||
F & T & T \\
|
||||
T & F & F \\
|
||||
T & T & T
|
||||
\texttt{F} & \texttt{F} & \texttt{T} \\
|
||||
\texttt{F} & \texttt{T} & \texttt{T} \\
|
||||
\texttt{T} & \texttt{F} & \texttt{F} \\
|
||||
\texttt{T} & \texttt{T} & \texttt{T}
|
||||
\end{tabular}
|
||||
\hfill
|
||||
\begin{tabular}{ c | c }
|
||||
@ -52,8 +52,8 @@ The function of these is defined by \textit{truth tables}:
|
||||
\hline
|
||||
$A$ & $\lnot A$ \\
|
||||
\hline
|
||||
T & F \\
|
||||
F & T \\
|
||||
\texttt{T} & \texttt{F} \\
|
||||
\texttt{F} & \texttt{T} \\
|
||||
~ & ~ \\
|
||||
~ & ~ \\
|
||||
\end{tabular}
|
||||
@ -61,30 +61,40 @@ The function of these is defined by \textit{truth tables}:
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
$A \land B$ is only true if both $A$ and $B$ are true. $A \lor B$ is true when $A$ or $B$ (or both) are true. \par
|
||||
$A \land B$ is \texttt{true} only if both $A$ and $B$ are \texttt{true}. $A \lor B$ is \texttt{true} if $A$ or $B$ (or both) are \texttt{true}. \par
|
||||
$\lnot A$ is the opposite of $A$, which is why it looks like a \say{negative} sign. \par
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
$A \rightarrow B$ is a bit harder to understand. Read aloud, this is \say{$A$ implies $B$.} \par
|
||||
The only time $\rightarrow$ is false is when $T \rightarrow F$. This may seem counterintuitive, but it will make more sense as we progress through this handout.
|
||||
The only time $\rightarrow$ produces \texttt{false} is when $\texttt{true} \rightarrow \texttt{false}$.
|
||||
This fact may seem counterintuitive, but will make more sense as we progress through this handout. \par
|
||||
\hint{
|
||||
Think about it---if event $\alpha$ implies $\beta$, it is impossible for $\alpha$ to occur without $\beta$. \par
|
||||
This is the only impossibility. All other variants are valid.
|
||||
}
|
||||
|
||||
\problem{}
|
||||
Evaluate the following.
|
||||
\begin{itemize}
|
||||
\item $\lnot T$
|
||||
\item $F \lor T$
|
||||
\item $T \land T$
|
||||
\item $(T \land F) \lor T$
|
||||
\item $(T \land F) \lor T$
|
||||
\item $(\lnot (F \lor \lnot T) ) \rightarrow T$
|
||||
\item $(F \rightarrow T) \rightarrow (\lnot F \lor \lnot T)$
|
||||
\item $\lnot \texttt{T}$
|
||||
\item $\texttt{F} \lor \texttt{T}$
|
||||
\item $\texttt{T} \land \texttt{T}$
|
||||
\item $(\texttt{T} \land \texttt{F}) \lor \texttt{T}$
|
||||
\item $(\texttt{T} \land \texttt{F}) \lor \texttt{T}$
|
||||
\item $(\lnot (\texttt{F} \lor \lnot \texttt{T}) ) \rightarrow \texttt{T}$
|
||||
\item $(\texttt{F} \rightarrow \texttt{T}) \rightarrow (\lnot \texttt{F} \lor \lnot \texttt{T})$
|
||||
\end{itemize}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
\begin{instructornote}
|
||||
After the class has done a few definable set problems, you can try to provide some intuition for $\rightarrow$ with the following example.
|
||||
We can also think of $[x \geq 0] \rightarrow b$ as follows:
|
||||
if $x$ isn't the kind of object we care about, we evaluate true and
|
||||
check the next one. If $x$ \textit{is} the kind of object we care about
|
||||
and $b$ is false, we have a counterexample to $[x \geq 0] \rightarrow b$,
|
||||
and thus $\texttt{T} \rightarrow \texttt{F}$ must be false.
|
||||
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
@ -96,17 +106,13 @@ Evaluate the following.
|
||||
|
||||
If $(\text{F} \rightarrow *)$ returned false, statements like the above would be hard to write. \par
|
||||
If $x$ is negative, $\varphi$ doesn't care whether or not it has a root. In this case, $\text{F} \rightarrow *$ must be true to avoid making whole $\forall$ false.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
You can think of $[x \geq 0] \rightarrow b$ as a \say{sanity check} in a program: if $x$ isn't the kind of object we care about, return true and check the next one. If $x$ \textit{is} the kind of object we care about and $b$ is false, we have a counterexample to $[x \geq 0] \rightarrow b$, and thus $T \rightarrow F$ must be false.
|
||||
\end{instructornote}
|
||||
|
||||
|
||||
\problem{}
|
||||
Evaluate the following.
|
||||
\begin{itemize}
|
||||
\item $A \rightarrow T$ for any $A$
|
||||
\item $A \rightarrow \texttt{T}$ for any $A$
|
||||
\item $(\lnot (A \rightarrow B)) \rightarrow A$ for any $A, B$
|
||||
\item $(A \rightarrow B) \rightarrow (\lnot B \rightarrow \lnot A)$ for any $A, B$
|
||||
\end{itemize}
|
||||
@ -115,13 +121,14 @@ Evaluate the following.
|
||||
|
||||
\problem{}
|
||||
Show that $\lnot (A \rightarrow \lnot B)$ is equivalent to $A \land B$. \par
|
||||
That is, show that these give the same result for the same $A$ and $B$. \par
|
||||
That is, show that these expressions always evaluate to the same value given
|
||||
the same $A$ and $B$. \par
|
||||
\hint{Use a truth table}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Can you express $A \lor B$ using only $\lnot$, $\rightarrow$, and $()$?
|
||||
Write an expression equivalent to $A \lor B$ using only $\lnot$, $\rightarrow$, and $()$?
|
||||
|
||||
\begin{solution}
|
||||
$((\lnot A) \rightarrow B)$
|
||||
@ -131,6 +138,6 @@ Can you express $A \lor B$ using only $\lnot$, $\rightarrow$, and $()$?
|
||||
|
||||
Note that both $\land$ and $\lor$ can be defined using the other logical symbols. \par
|
||||
The only logical symbols we \textit{need} are $\lnot$, $\rightarrow$, and $()$. \par
|
||||
We include $\land$ and $\lor$ to simplify our logical expressions.
|
||||
We include $\land$ and $\lor$ to simplify our expressions.
|
||||
|
||||
\pagebreak
|
Reference in New Issue
Block a user