% If you are working from this template to just write up your own
% solutions, I'm trying to keep it simple for you and there are only a
% few places you need to edit. On line 43 there's a place where the
% phrase "YOUR NAME HERE" appears; change it to your actual
% name. Several places below there are places where the phrase "YOUR
% ANSWER HERE" appears, and directly below (or replacing) those lines
% are good places to put your answers.
%
% One important thing you need to do, however (due to the complicated
% way I use a single form to produce both the question sheets and
% solution writeups) is to make sure that you keep the word 'solution'
% in your filename, or else your answers won't be printed at all.
\documentclass[12pt]{article}
 
\usepackage[margin=0.7in,dvips]{geometry}
\usepackage{fancyhdr,lastpage}
\usepackage{amsmath,amsfonts}
\usepackage{tikz}
\usepackage{substr}

\IfSubStringInString{\detokenize{solution}}{\jobname}{%
  % Solutions
  \newcommand\qfill{}
  \newcommand\qpage{}
  \newcommand\qonly[1]{}
  \newcommand\answer[1]{#1}
  \newcommand\question[1]{{\em #1}}
  \newcommand\rubric[1]{}
}
{%
  % Question sheets
  \newcommand\qfill{\vfill}
  \newcommand\qpage{\newpage}
  \newcommand\qonly[1]{#1}
  \newcommand\answer[1]{}
  \newcommand\question[1]{#1}
  \newcommand\rubric[1]{}
}

\pagestyle{fancy}
\lhead{MATH 311-01}
\chead{Problem Set \#2\answer{ solutions}}
\rhead{\answer{YOUR NAME HERE}}
\lfoot{}
\cfoot{Page \thepage\ of \pageref{LastPage}}
\rfoot{{\bf due January 26, 2017}}

% The command below redefines \neg (the logical negation character)
% to be a big tilde, in line with the usage in the book. Comment it
% out if you prefer the more traditional negation symbol.
\renewcommand*{\neg}{\mathord{\sim}}

\begin{document}
\begin{enumerate}
\item \question{Produce truth tables for each of the following statements; if the truth table describes a tautology or contradiction, say so.}
  \begin{enumerate}
  \item \question{$(P\vee Q)\rightarrow\neg Q$.}

    \answer{
      % Add as many "c"s separated by "|"s as there should be columns
      % in the table; as it stands now, this is a table with two
      % columns, then a double line, then 3 more columns.
      \begin{tabular}{|c|c||c|c|c|}\hline
        % The first row will be the header; there are some sample
        % entries here to get you started, but they probably aren't
        % "right" for this question.
        $P$&$Q$&$P\vee Q$&$\neg P$&$Q\rightarrow P$\\\hline\hline
        % Henceforth, the rows are the truth values in the table. Two
        % rows with bogus data ad one blank row appear below; you can
        % copy and paste the blank row, if you like, to get more.
        T&T&T&F&T\\\hline
        F&F&F&T&T\\\hline
        &&&&\\\hline
        
      \end{tabular}
    }

  \item \question{$[(P\rightarrow Q)\wedge (Q\rightarrow R)]\rightarrow (P\rightarrow R)$.}

    \answer{
      % Add as many "c"s separated by "|"s as there should be columns
      % in the table; as it stands now, this is a table with two
      % columns, then a double line, then 3 more columns.
      \begin{tabular}{|c|c||c|c|c|}\hline
        % The first row will be the header; there are some sample
        % entries here to get you started, but they probably aren't
        % "right" for this question.
        $P$&$Q$&$P\vee Q$&$\neg P$&$Q\rightarrow P$\\\hline\hline
        % Henceforth, the rows are the truth values in the table. Two
        % rows with bogus data ad one blank row appear below; you can
        % copy and paste the blank row, if you like, to get more.
        T&T&T&F&T\\\hline
        F&F&F&T&T\\\hline
        &&&&\\\hline
        
      \end{tabular}
    }
  \end{enumerate}

\item \question{Demonstrate, using a truth table or any other
    technique, that the statements $(P\vee Q)\wedge R$ and $(P\wedge
    R)\vee (Q\wedge R)$ are logically equivalent.}

\item \question{The following four propositions are taken from a work
    of Lewis Carroll's. Translate each into a symbolic quantified
    statement (i.e. a statement using either the universal
    quantifier $\forall$ or the existential quantifier $\exists$) using the
    following names for sets and open statements:
    \begin{itemize}
    \item $U$: the set of all books
    \item $B(x)$: the statement ``book $x$ is bound.''
    \item $R(x)$: the statement ``book $x$ is recommended for reading.''
    \item $H(x)$: the statement ``book $x$ is healthy in tone.''
    \item $W(x)$: the statement ``book $x$ is well-written.''
    \end{itemize}}

    \begin{enumerate}
    \item The only books that I do not recommend for
      reading are unhealthy in tone.

      \answer{
        %YOUR ANSWER HERE
      }

    \item The bound books are all well-written.

      \answer{
        %YOUR ANSWER HERE
      }

    \item All the romances are healthy in tone.

      \answer{
        %YOUR ANSWER HERE
      }

    \item I do not recommend you to read any of the unbound books. 

      \answer{
        %YOUR ANSWER HERE
      }
    \end{enumerate}

  \item \question{Based on the quantified statements in the previous
      question, what conclusions could you reach if you knew that the
      book ``The Old Man's Comforts'' is healthy in tone?}

\end{enumerate}

\end{document}
