\documentclass{article}
\usepackage{fullpage,parskip}
\usepackage{amsmath,amssymb}
\usepackage{xcolor}
\newcommand{\XXX}{{\color{red} \textsf{\textbf{XXX}}}}
\begin{document}
% To run this file, you'll need to have LaTeX installed. All of the
% lab computers have it. You can download a complete LaTeX
% distribution from
% https://www.tug.org/texlive/acquire-netinstall.html.
% Once you have LaTeX, you can either build your PDF on the
% command-line by running 'pdflatex hwXX.tex' to generate hwXX.pdf, or
% you can use an editor like LyX, TeXShop, or ShareLaTeX which
% automates the building of your PDF.
% Please print out your solution double-sided (a/k/a duplex) and bring
% it to class on the Wednesday it's due.
\noindent
% fill in the XXXs below
{\Large CS055 HW01 \qquad Name: \XXX \qquad CAS ID: \XXX} \\[.5em]
% I encourage you to collaborate, but please list any other students
% you talked to about the homework. If you worked alone, please just
% remove the XXXs.
Collaborators: \XXX
% Okay! Solve the problems below. please don't delete the problem
% statement or the ``enumerate'' bracketing which provides the
% numbering.
\begin{enumerate}
\item Which CS courses have you taken?
\textbf{Answer:} \XXX
\item Which math courses have you taken? If you have taken no math
classes at Pomona, what's the most advanced math course you've
completed?
\textbf{Answer:} \XXX
\item Which of the following is a proposition? If it's a proposition,
give the truth value if you can; if you can't, explain why you
believe it's a proposition. You may use the Internet to help answer
these questions.
\begin{enumerate}
\item The Claremont Colleges are in Los Angeles County.
\textbf{Answer:} Yes, it is a proposition; it is true.
\item $2 + 2 = 5$.
\textbf{Answer:} \XXX
\item For all natural numbers $a$ and $b$, we have $a + b = b + a$.
\textbf{Answer:} \XXX
\item There are 3,724 shipwrecks in the Mediterranean.
\textbf{Answer:} \XXX
\item Not every computer program terminates.
\textbf{Answer:} \XXX
\item The multiple star Alnitak is part of Orion's belt.
\textbf{Answer:} \XXX
\item Professor Greenberg is an alien from the multiple star Alnitak.
\textbf{Answer:} \XXX
\item Finance capitalism and liberal democracy are incompatible.
\textbf{Answer:} \XXX
\item Fill in the blank below.
\textbf{Answer:} \XXX
\item This statement is false.
\textbf{Answer:} \XXX
\end{enumerate}
\item Let $p$ be the proposition ``you play the game'' and $w$ be the
proposition ``you win the game''. Write a proposition $q_1$ corresponding
to the English adage, ``You can't win if you don't play the game.'' Use negation.
% LATEX CHEAT SHEET:
%
% put math between dollar signs
%
% true === \top
% false === \bot
% p and q === p \wedge q
% p or q === p \vee q
% p implies q === p \rightarrow q
% not p === \neg p
\textbf{Answer:} $q_1 = \XXX$
Write an equivalent proposition $q_2$ that doesn't use negation.
\textbf{Answer:} $q_2 = \XXX$
Fill in the truth table to prove the equivalence.
% fill in the columns under q_1 and q_2
% you may need to add columns to the table to account for
% subformulae of your formulae q_1 and q_2. add an extra c| to the
% end of the array specification for each column you add.
\[ \begin{array}{|c|c|c|c|}
\hline
p & w & q_1 & q_2 \\ \hline
\top & \top & \XXX & \XXX \\ \hline
\top & \bot & \XXX & \XXX \\ \hline
\bot & \top & \XXX & \XXX \\ \hline
\bot & \bot & \XXX & \XXX \\ \hline
\end{array} \]
\item Prove that $p \vee (p \wedge q)$ is equivalent to $p$.
\textbf{Proof:} \XXX
Prove that $p \wedge (p \vee q)$ is equivalent to $p$.
\textbf{Proof:} \XXX
\item The digital logic NAND operation (\underline{n}egated
\underline{and}) is functionally complete, i.e., all boolean
formulae can be expressed using only NAND. We can prove that NAND is
functionally complete by showing how it can \textit{encode} another
set of functionally complete operators: in this case, negation
($\neg$), conjunction ($\wedge$), and disjunction ($\vee$).
In math, NAND is typically written with the Sheffer stroke, $p \mid
q$. We have $p \mid q$ when one or both of $p$ and $q$ are false; $p
\mid q$ is false when both $p$ and $q$ are true.
\begin{enumerate}
\item Write the truth table for $p \mid q$.
\[ \begin{array}{|c|c|c|c|}
\hline
p & q & p \mid q \\ \hline
\XXX & \XXX & \XXX \\ \hline % HINT: you may need to add more lines!
\end{array} \]
\item Find a formula $r$ using only $a$, $\mid$, $\top$, and $\bot$ that
is equivalent to $\neg a$. Prove your formula is equivalent.
\textbf{Answer:} $r = \XXX$.
\textbf{Proof:} \XXX
\item Find a formula $s$ using only $a$, $b$, $\mid$, $\top$, and $\bot$ that
is equivalent to $a \wedge b$. Prove your formula is equivalent.
\textbf{Answer:} $s = \XXX$.
\textbf{Proof:} \XXX
\item Find a formula $t$ using only $a$, $b$, $\mid$, $\top$, and $\bot$ that
is equivalent to $a \vee b$. Prove your formula is equivalent.
\textbf{Answer:} $t = \XXX$.
\textbf{Proof:} \XXX
\end{enumerate}
\end{enumerate}
\end{document}