% This is a TeX file
% It is essentially a programming language for mathematics documents
% You can ignore this first portion of the file, as it is essentially a bunch of "include" statements.
\documentclass[10pt]{article}

\usepackage{pictex, latexsym, graphicx,amsmath,amssymb,amsbsy,amsfonts,amsthm,verbatim}
\usepackage{graphics}
\usepackage{fullpage}
\usepackage{fancyhdr}

\usepackage{algorithm,algorithmic}
\usepackage{multirow}

\setlength{\voffset}{-0.25in}
\setlength{\headsep}{0.25in}
\setlength{\parskip}{1em}
\setlength{\parindent}{0em}

% The following denotes a counter for the problems.
\newcounter{problem}
\newcommand{\problem}{\textbf{\refstepcounter{problem}Problem \theproblem.} }

% These are macro shortcuts! Helpful!
\def\vu{\mathbf{u}}
\def\vx{\mathbf{x}}
\def\vb{\mathbf{b}}
\def\vv{\mathbf{v}}
\def\vw{\mathbf{w}}

\renewcommand{\implies}{\rightarrow}
\renewcommand{\lor}{\vee}
\renewcommand{\land}{\wedge}
\newcommand{\xor}{\oplus}
\renewcommand{\iff}{\leftrightarrow}
\newcommand{\TRUE}{\mathbf{T}}
\newcommand{\FALSE}{\mathbf{F}}
\newcommand{\universe}{\mathcal{U}}

\begin{document}
\pagestyle{fancyplain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NOW you can start typing your text that will appear in the PDF!!!

% Note that anything after a '%' is a comment!

% Anything immediately after a '\' is a command. 
% Some denote formatting, some are for special characters.
% The '$' symbol starts and ends "math mode". Use this only for mathematical statements
% In math mode, any sequence of letters is meant to be a list of variables, so use "\sin x" for the sine of x, which will look much different from "sin x"
\chead{COM S 330 --- Homework 02 --- INSERT NAME HERE}

\textit{Type your answers to the following questions and submit a PDF file to Blackboard. 
One page per problem.}


\problem [5pts] Construct a truth table for the compound proposition $(p \iff q) \xor (\lnot p \iff \lnot r)$.



% Be sure to use this \clearpage to make sure your problems are on separate pages!
%\clearpage
\problem [5pts] Construct a truth table for the compound propositions $((p\implies (q\implies r))\implies s)$.

% Be sure to use this \clearpage to make sure your problems are on separate pages!
%\clearpage
\problem [10pts] On the island of Flopi, there are three types of people: Knights, Knaves, and Floppers. All inhabitants know which type the others are, but they are otherwise indistinguishable. Knights always tell the truth. Knaves always lie. Floppers always choose to lie or tell the truth by doing the opposite of the previous speaker (i.e. if someone just spoke a lie, the flopper will tell the truth; if someone just spoke a truth, the flopper will lie). While on your vacation, you come across three inhabitants, $A$, $B$, and $C$. They say the following, in order:
\begin{quote}
$A$ says, ``We are all knights.''\\
$B$ says, ``$C$ is a knight.''\\
$C$ says, ``$A$ is a knave.''\\
$A$ says, ``$C$ lied.''
\end{quote}
Determine all possibilities of $A$, $B$, and $C$ being Knights, Knaves, or Floppers (not all need to be distinct).

% Be sure to use this \clearpage to make sure your problems are on separate pages!
%\clearpage
\problem [5pts] Show that $[p \land (p\implies q)]\implies q$ is a tautology using truth tables.

% Be sure to use this \clearpage to make sure your problems are on separate pages!
%\clearpage
\problem [10pts] Prove\footnote{``Prove'' means do not use truth tables!} that $(p \implies q) \lor (p \implies r)$ and $p \implies (q\lor r)$ are logically equivalent (without using this equivalence from the tables).

% Be sure to use this \clearpage to make sure your problems are on separate pages!
%\clearpage
\problem [5pts] Find an assignment of the variables $p, q, r$ such that the proposition
\[ (p \lor \lnot q) \land (p \lor q) \land (q \lor r) \land (q \lor \lnot r) \land (r \lor \lnot p)\land (r \lor p) \] 
is satisfied. For a bonus 5 points, prove that this assignment is \emph{unique}. (Hint: Prove an equivalence between this proposition and the proposition $(p \iff X) \land (q \iff Y)\land (r\iff Z)$ where $(X,Y,Z)$ is your assignment.)
\end{document} 