\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{1, Fri}            % !! 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*}
\land & \eqdef & \text{AND},\\
\lor & \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, demonstrate a possible scenario 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 \land 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 \lor F, \quad C \lor P, \quad \neg (F \land C)}{\neg (B \land 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 \land \neg F \land C \land
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 \lor F) \land \neg (B \land 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 \lor B, \quad \neg S \lor \neg B}{J \lor \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 \land H) \lor (E \land \neg H)}{\neg (S \land 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 \land E \land H$ is consistent
with the antecedent but not with the conclusion.}

\iffalse

\problempart If the tax rate and unemployment both go up then there will be
a recession.  If the GNP goes up there will not be a recession.  GNP
and taxes are both going up.  Therefore, there will not be a
recession.

\solution{
The deduction is:
\begin{center}
\begin{tabular}{c}
        $T \land U \implies R$ \\
        $G \implies \neg R$ \\
        $G \land T$ \\ \hline
        $\neg R$
\end{tabular}
\quad where 
\begin{tabular}{l}
        $T \eqdef\mbox{``The tax rate goes up.''}$ \\
        $U \eqdef\mbox{``Unemployment goes up.''}$ \\
        $G \eqdef\mbox{``GNP goes up.''}$ \\
        $R \eqdef\mbox{``There will be a recession.''}$
\end{tabular}
\end{center}
This deduction is valid. 
(The first antecedent is superfluous.)
}
\fi

\end{problemparts}

\end{problem}


\begin{problem}\label{sys}  Are the following
specifications\footnote{Rosen, Exercise 1.1.36} 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.

   \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 The specification is consistent if there is an assignment of truth
values to the variables that makes every expression true.  \emph{Use a
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
sixteeen 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}


\begin{problem}   %source: spring00 ps1

\textbf{[Optional]} Suppose $x$ is a real number.  Prove \textbf{by cases}
that there is a real $y$ such that $\dfrac{y+1}{y-2}=x$ if and only if $x
\ne 1$.

\solution{

We consider the cases $x \neq 1$ and $x = 1$ separately. 
\begin{description}

\item[Case 1 ($x \neq 1$): ]
We need to prove that there exists $y \in \reals$ such that
$\dfrac{y+1}{y-2}=x$.  In particular, consider $y = \dfrac{2x+1}{x-1}$ (derived
by algebraic manipulation), which is a well-defined real number because $x \neq
1$.  Then:  
\begin{eqnarray*}
\frac{y+1}{y-2}  & = & \frac{((2x+1)/(x-1))+1}{((2x+1)/(x-1))-2} \\
        & = & \frac{\dfrac{2x+1 + (x-1)}{x-1}}{\dfrac{2x+1-2(x-1)}{x-1}}\\
        & = & \frac{\dfrac{3x}{x-1}}{\dfrac{2x+1-2x+2}{x-1}}\\
        & = & \frac{3x}{3}\\
        & = & x.
\end{eqnarray*}

Therefore, (by the inference rule called \emph{existential
generalization}) $\exists y \in \reals$ such that $\dfrac{y+1}{y-2} = x.$

\item[Case 2 ($x = 1$): ]
We need to prove that no $y \in \reals$ exists such that $\dfrac{y+1}{y-2}=x$. 
Suppose, for contradiction, that such a $y$ did exist.  Then:
\begin{align*}
\frac{y+1}{y-2} = x 
        &\equivalent \;\; \frac{y+1}{y-2} = 1 
                & \text{(because $x = 1$)} \\
        &\:\implies \;\; y+1 = y-2 
                & \text{(multiply both sides by $y-2$)} \\
        &\equivalent \;\; 1 = -2 
                & \text{(subtract $y$ from both sides)},
\end{align*}
a contradiction.  Therefore our supposition is wrong, 
and there is no $y$ such that $\dfrac{y+1}{y-2}=x$. 

\end{description}
}
\end{problem}



\end{document}
