\documentclass[noanswers,addpoints,10pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[most]{tcolorbox}
\usepackage{datetime}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage{xltxtra}
\usepackage{listings}

\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{multicol}
\usepackage{multirow}

\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathmorphing,backgrounds,positioning,fit}
\usepackage{pgf-umlcd}

% compact itemized and then enumerated
\setlist{leftmargin=*,
  noitemsep,
  topsep=5pt,
  parsep=0pt,
  partopsep=0pt,
}

\setlist[enumerate]{leftmargin=*,
  itemsep=2pt,
  topsep=0pt,
  parsep=0pt,
  partopsep=0pt,
}


\usepackage{fontspec}
\setmainfont{Gentium Basic}
\setmonofont{Comic Code}[
Scale          = 0.80,
UprightFont    = *-Regular,
ItalicFont     = *-Italic,
BoldFont       = *-Bold,
BoldItalicFont = *-Bold Italic
]

\lstset{
  basicstyle=\ttfamily,
}

\DeclareMathOperator{\limplies}{\Rightarrow}
\DeclareMathOperator{\lbiconditional}{\Leftrightarrow}
\DeclareMathOperator{\liff}{\iff}
\DeclareMathOperator{\lxor}{\oplus}
\DeclareMathOperator{\qeq}{\overset{?}{=}}
\DeclareMathOperator{\modulus}{\mathbf{mod}}
\DeclareMathOperator{\even}{even}
\DeclareMathOperator{\odd}{odd}
\DeclareMathOperator{\ddiv}{|}
\DeclareMathOperator{\ndiv}{\not|}
\DeclareMathOperator{\contra}{\Rightarrow\mskip-\thinmuskip\Leftarrow}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\renewcommand{\P}[1]{\mathbb{P}(#1)}
\newcommand{\mathcheckmark}{\text{ \ding{51}}}

\DeclareMathOperator{\vowel}{vowel}
\DeclareMathOperator{\consonant}{consonant}
\DeclareMathOperator{\isprime}{prime}
\DeclareMathOperator{\equals}{equals}
\DeclareMathOperator{\divides}{divides}

\newcommand\examNumber{gProofs}
\newcommand\semester{Spring 2024}
\newcommand\className{Foundations of Computing}
\newcommand\classNumber{CIS~300}
\newcommand\classFullName{\classNumber~\className}
\renewcommand{\dateseparator}{-}
\yyyymmdddate

% /classname
\pagestyle{headandfoot}
\firstpageheader{~\\\classFullName}{\examNumber\\~}{~\\\semester}

\newenvironment{showExample}[1]{
  \begingroup
  \renewcommand{\solutiontitle}{\noindent\textbf{Example:}\enspace}
  \printanswers
  \begin{solution}[#1]
  }{
  \end{solution}
  \endgroup
}

\begin{document}

\section*{Introduction}
Students will work in groups using propositional logic, truth tables,
and logic operations.

\section*{Assignment Goals}
\begin{itemize}
\item Prerequisite Knowledge
  \begin{itemize}
  \item Know what a \emph{proposition} and a \emph{predicate} are.
  \item Knowledge of \emph{truth tables}
  \end{itemize}
\item Learning Outcomes
  \begin{itemize}
  \item Show logical equivalence by showing two columns of a truth table
    are the same.
  \item Prove deMorgan's Law and distributive rule for logic operations.
  \end{itemize}
\end{itemize}

\section*{Procedure}

\textbf{Get out paper.} The group will turn in \emph{one}
document. Place all the names of group members attending atop the
page.

\noindent
\textbf{Copy each question before the answer.} This makes the answer
sheet a worthwhile study guide w/o the worksheet. The answers written
down should be \emph{discussed} by the group and represent the
\emph{consensus} of the group. Sometimes a \emph{picture}, a
\emph{graph}, or something similar is the most appropriate way to
answer a question.

\noindent
\textbf{Assign Roles.} Students should take roles they
have not held recently (or, perhaps, ever):

\begin{description}
\item[Manager] Move discussion forward.
\item[Reflector] Monitor that everyone gets heard and is caught
  up. (This is a \textbf{group} obligation, really.)
\item[Recorder] Writes the report.
\end{description}

\noindent
\textbf{Answer these questions.}

\emph{A proof of a proposition is a convincing argument that the
  proposition is true.}

\begin{questions}
\question{} \textbf{Translate} the following into English:
  $\forall n \in \mathbb{Z}^+\;\forall k \in \{\omega : \omega \ddiv n\}\;
  k \ndiv n + 1$

\question{} For the numbers $h \in \mathbb{Z} _{13}$, calculate $h^2
  \modulus 4$. What pattern do you see in the results?

  Possibly useful notation: $\equiv_n$ means that the expressions on
  either side are ``equivalent modulo $n$'' $69 \equiv_4 13$ because
  $69 \modulus 4 = 1$ and $13 \modulus 4 = 1$. Note that $a \ddiv b$ is
  the same as $b \equiv_a 0$.

\question{} \textbf{How} would you prove that 7 is prime? Define the
  predicate $prime$ and describe your approach in English. \emph{Then}
  prove that 7 is prime.
  \begin{solution}[0.0in]
    $prime(k)$ ::= $\forall i \in {2,\ldots,k-1}, i \ndiv k$. No
    number between two and one less than $k$ divides $k$ if it is
    prime. Or: The only positive integers that divide $k$ are $1$ and
    $k$.

    \textbf{TBP} $prime(7)$

    Prove that $\forall i \in {2,\ldots,6}$ $7 \modulus i \ne 0$.

    \begin{tabular}{ll}
      \textbf{$i$}&\textbf{$7 \modulus i$}\\
      $2$&$1$\\
      $3$&$1$\\
      $4$&$3$\\
      $5$&$2$\\
      $6$&$1$\\
    \end{tabular}

    $\forall i \in {2,\ldots,6}, i \ndiv 7$\\
    $\therefore$ $prime(7)$

  \end{solution}

\question{} \textbf{Prove} that the sum of two \emph{rational} numbers
  is, itself, rational. Begin by rewritting the theorem in
  mathematical logic terms and use the definition of $\mathbb{Q}$.

\question{} \textbf{Prove} that $\forall b \in \mathbb{Z} \; odd(b)
  \Leftrightarrow odd(b^2)$. Note: How many proofs does this entail?


\question{} One of the following statements is true, the other
  false. Decide which is which and prove the true one and disprove the
  false one:
  \begin{parts}
  \part{} If $rational(x - y)$ and $rational(x)$ then $rational(y)$.
  \part{} If $rational(xy)$ and $rational(x)$ then $rational(y)$.
  \end{parts}
\end{questions}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
