\documentclass[11pt,twoside]{article}    
\usepackage{latex-macros/course}% !! use the macros 

%\backwardscompatibility        % !! use for backwards compatibility
%\showsolutions                 % !! use to force solutions & skip query
%\hidesolutions                 % !! use to force no solutions & skip query
%\renewcommand{\coursecopyrightnames}{Prof.~Albert~R.~Meyer}

\begin{document} 
\inclassproblems{1F}                    % !! start the paper

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{problem}  %source: spring00 ps1

Translate the parts of the following deductive arguments into
propositional logic notation using logical operators:
\begin{eqnarray*}
\conj & \eqdef & \text{AND},\\
\disj & \eqdef & \text{OR},\\
\neg & \eqdef & \text{NOT},\\
\implies & \eqdef & \text{IMPLIES},\\
\bicond & \eqdef & \text{IFF (if and only if)}
\end{eqnarray*}
This may require that you ``pin down'' a statement that could be
interpreted in more than one way.

Identify the antecedents and conclusions of the arguments, and determine
which are sound deductions and which are not.  If the deduction is
unsound, describe a possible situation in which all the antecedents hold
but the conclusion does not.

\textbf{Note:} There are several inequivalent, reasonable ways to
interpret several of these statements.

\begin{problemparts}

\iffalse
\problempart Jane and Pete won't both win the math prize.  Pete will win
either the math prize or the chemistry prize.  Jane will win the math
prize.  Thus, Pete will win the chemistry prize.

\solution{
The deduction is:
\Rule{\neg (J \conj M),\quad M \smor C, \quad J}{C}
where 
\begin{eqnarray*}
J & \eqdef & \mbox{``Jane will win the math prize.''} \\
M & \eqdef & \mbox{``Pete will win the math prize.''} \\
C & \eqdef & \mbox{``Pete will win the chemistry prize.''}
\end{eqnarray*}
This deduction is valid.  
}
\fi

\problempart The main course will be beef or fish.  The vegetable will be
peas or corn.  We will not have both fish as a main course and corn as
a vegetable.  Therefore, we will not have both beef as a main course
and peas as a vegetable.

\solution{
The deduction is:
\Rule{B \disj F, \quad C \disj P, \quad \neg (F \conj C)}{\neg (B \conj P)}
where 
\begin{eqnarray*}
        B  & \eqdef & \mbox{``The main course will be beef.''} \\
        F  & \eqdef & \mbox{``The main course will be fish.''} \\
        C  & \eqdef & \mbox{``The vegetable will be corn.''} \\
        P  & \eqdef & \mbox{``The vegetable will be peas.''} 
\end{eqnarray*}
This deduction is invalid.  For example, $B \conj \neg F \conj C \conj
P$ is consistent with the antecedents but not with the conclusion.  Note
that as formalized, there need not be only one main course and only
one vegetable; it is possible, for example, for the vegetable to be
both corn and peas, as in the scenario given.

If we wished to exclude the possibility of multiple courses we could have
used \emph{exclusive-or}, \cf Rosen, p.5, instead of inclusive-or.  So our
antecedent about the main course would then read $B \oplus F$ or,
equivalently, $(B \disj F) \conj \neg (B \conj F)$.  The antecedent about
the vegetable could be changed similarly.  The deduction is still invalid
with this formalization.}

\problempart Either John or Bill is telling the truth.  Either Sam or Bill
is lying.  Thus, either John is telling the truth or Sam is lying.

\solution{
We interpret ``John is lying,'' to be the negation of ``John is
telling the truth.''  Similarly for the corresponding propositions
involving Bill and Sam.  The deduction is:
\Rule{J \disj B, \quad \neg S \disj \neg B}{J \disj \neg S}
where
\begin{eqnarray*}
        J & \eqdef & \mbox{``John is telling the truth.''} \\
        B & \eqdef & \mbox{``Bill is telling the truth.''} \\
        S & \eqdef & \mbox{``Sam is telling the truth.''}
\end{eqnarray*}
This deduction is valid.  It is an example of a common ``cancellation'' or
\emph{cut} rule that lets us get rid of the proposition $B$ in the
conclusion.}

\problempart Either sales will go up and the boss will be happy, or expenses
will go up and the boss won't be happy.  Therefore, sales and expenses
will not both go up.

\solution{
The deduction is:
\Rule{(S \conj H) \disj (E \conj \neg H)}{\neg (S \conj E)}
where 
\begin{eqnarray*}
        S & \eqdef& \mbox{``Sales will go up.''} \\
        H & \eqdef& \mbox{``The boss will be happy.''} \\
        E & \eqdef& \mbox{``Expenses will go up.''} 
\end{eqnarray*}
This deduction is invalid.  For example, $S \conj E \conj H$ is consistent
with the antecedent but not with the conclusion.}

\end{problemparts}

\end{problem}

\instatements{\newpage}
\begin{problem}\label{sys}  A set of propositions is \emph{consistent} if
there is a possible situation in which they are all true.  This problem
examines whether the following specifications\footnote{Rosen, Exercise
1.1.36} are consistent.

\begin{enumerate}

\item If the file system is not locked, then

   \begin{enumerate}

   \item new messages will be queued.

   \item new messages will be sent to the messages buffer.

   \item the system is functioning normally, and conversely, if the system
         is functioning normally, then the file system is not locked.

   \end{enumerate}



\item  If new messages are not queued, then they will be sent to
the messages buffer.

\item  New messages will not be sent to the message buffer.

\end{enumerate}

\bparts

\ppart Begin by translating the parts of the specification into
propositional formulas using four propositional variables:
\begin{eqnarray*}
L   & \eqdef &   \text{file system locked}, \\
Q   & \eqdef &   \text{new messages are queued}, \\
B   & \eqdef &   \text{new messages are sent to the message buffer}, \\
N   & \eqdef &   \text{system functioning normally}.
\end{eqnarray*}

\solution{
The translations of the specifications are:
\begin{align}
\neg L  \implies & Q & \tag{Spec.\ 1.(a)}\\
\neg L  \implies & B & \tag{Spec.\ 1.(b)}\\
\neg L  \bicond  & N & \tag{Spec.\ 1.(c)}\\
\neg Q  \implies & B & \tag{Spec.\ 2.}\\
\neg B           &   & \tag{Spec.\ 3.}
\end{align}}

\ppart To be precise, the specification is consistent if there is a single
choice of truth values for the variables $L,Q,B,N$, so that every one the
propositional formulas from the previous part are true.  Explain how to
use a \emph{truth table} to determine whether the specification is
consistent.

\solution{ We can construct a truth table with sixteen lines---one for
each way of assigning truth values to the four variables $L$, $N$, $Q$,
and $B$.  For each line, we could record the truth values of these five
statements above.

If all five statements are true for some assignment of truth values to the
variables, then the system is consistent.  If for every one of the
sixteen possible truth assignments, at least one of the five statements
is false, then the system is inconsistent.  Carrying out the calculation
shows that there is a unique assignment of True/False values to $L$, $N$,
$Q$, and $B$ (see below) that satisfies all the specifications.}

\ppart Use \emph{simple reasoning by cases} to find a truth assignment
that confirms that this system specification is consistent.  Explain why
there is only one such assignment.

\solution{
We can avoid the full truthtable calculation if we reason by
cases.

\textbf{Case 1} ($B$ is True):  Then the last formula, (Spec.\ 3.), is false,
and the whole specification is false.

\textbf{Case 2} ($B$ is False): Now (Spec.\ 2.) and (Spec.\ 1.(b)) can be
true only if $Q$ and $L$ are true.  Since $L$ is true, (Spec.\ 1.(c)) can
be true only if $N$ is false.  Thus, we have deduced that in order to be
consistent, we must have
\begin{eqnarray*}
L       & = &   \text{True} \\
N       & = &   \text{False} \\
Q       & = &   \text{True} \\
B       & = &   \text{False}.
\end{eqnarray*}

From the way this assignment was constructed, we know it ensures that
formulas from (Spec.\ 1.(b)) on are true.  So all that remains is to check
formula (Spec.\ 1.(a)), and indeed it is also true under this assignment.

So the system is consistent, and this is the only assignment that will
satisfy it.}

\eparts
\end{problem}


\iffalse

\begin{problem}
In some computer architectures, the basic computer operation is ``NAND'',
denoted~$\nand$, where $A \nand B$ means $\neg (A \conj B)$.  Show that
all the basic boolean operations can be defined solely in terms of the
NAND operation (and parentheses), \eg $\neg A$ can be defined as $A \nand
A$.

\begin{problemparts}

\problempart $A \disj B$
\solution{
       $(A \nand A) \nand (B \nand B)$
}

\problempart $A \conj B$
\solution{
  $(A \nand B) \nand (A \nand B)$ 
}

\problempart $A \implies B$
\solution{
  $A \nand (B \nand B)$
}
\end{problemparts}

\end{problem}
\fi

\instatements{\newpage}
\begin{problem} (Carried over from Wednesday)
Albert \& Eric announce that they plan a surprise 6.042 quiz next week.
Their students wonder if the quiz could be next Friday.  The students
realize that it obviously cannot, because if it hadn't been given before
Friday, everyone would know that there was only Friday left on which to
give it, so it wouldn't be a surprise any more.

So the students ask whether Albert \& Eric could give the surprise quiz
Thursday?  They observe that if the quiz wasn't given \emph{before}
Thursday, it would have to be given \emph{on} the Thursday, since they
already know it can't be given on Friday.  But having figured that out, it
wouldn't be a surprise if the quiz was on Thursday either.  Similarly, the
students reason that the quiz can't be on Wednesday, Tuesday, or Monday.
Namely, it's impossible for Albert \& Eric to give a surprise quiz next
week.  All the students now relax having concluded that Albert \& Eric
must have been bluffing.

And since no one expects the quiz, that's why, when Albert \& Eric give
it on Tuesday next week, it really is a surprise!

What do you think is wrong with the students' reasoning?

\solution{The basic problem is that ``surprise'' is not a mathematical
concept, nor is there any generally accepted way to give it a mathematical
definition.  The ``proof'' above assumes some plausible axioms about
surprise, without defining it.  The paradox is that these axioms are
inconsistent.  But that's no surprise \texttt{:-)}, since---mathematically
speaking---we don't know what we're talking about.

Mathematicians and philosophers have had a lot more to say about what
might be wrong with the students' reasoning, (see Chow, Timothy Y.
\href{http://theory.lcs.mit.edu/classes/6.042/spring02/handouts/surprise-paradox.pdf} 
{\emph{The surprise examination or unexpected hanging paradox}}, American
Math. Monthly (January 1998), pp.41--51.)}

\end{problem}

\end{document}
