\documentclass[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}

\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{8.8in}

\usepackage{amsthm} %needed for \theoremstyle below
\theoremstyle{definition}
\newtheorem{exercise}{Exercise}[section]
\setcounter{section}{3}

% 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{\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)}

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

% classname
\newcommand\examNumber{gReview}
\newcommand\semester{Fall 2023}
\newcommand\className{Foundations of Computer Science}
\newcommand\classNumber{CIS~300}
\newcommand\classFullName{\classNumber~\className}
\renewcommand{\dateseparator}{-}
\yyyymmdddate

% /classname

\title{\examNumber}


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

\begin{document}
\maketitle{}
\section*{Introduction}
This group assignment includes review across the semester

\section*{Assignment Goals}
\paragraph{Learning Outcomes} After completing this group assignment,
each student is expected to be able to
\begin{itemize}
\item Provide definitions for terms used in class.
\item Do some proofs.
\end{itemize}

\section*{Procedure}

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

\begin{quote}
\begin{description}
\item[Manager] Move discussion forward.
\item[Recorder] Writes the report that will be turned in.
\item[Reflector] Monitor that everyone gets heard and is caught
  up. (This is a \textbf{group} obligation, really.)
\item[Speaker] (Combine w/ \textbf{Reflector} if there are not four
  group members.) Asks the facilitator questions and communicates what
  the team has done.
\end{description}
\end{quote}
\noindent
\textbf{Answer these questions.}

\begin{questions}

\question{} Give a precise definition of
  \begin{parts}
  \part{} the \emph{powerset} of the set $S$, $\P{S}$
  \part{} the \emph{countable} predicate
  \part{} $s \ddiv t$
  \part{} \emph{predicate}
  \part{} \emph{proposition}
  \end{parts}

\question{} There is a bin with 10 each of lemon, cinnamon, and
  rose flavored chocolates. How many chocolates must be drawn to
  assure that:
  \begin{parts}
  \part At least two different flavors are picked?
    \begin{solution}[0.0in]
    \end{solution}

  \part At least three of \emph{one} flavor are picked?
    \begin{solution}[0.0in]
    \end{solution}

  \part No flavor is missing from the chocolates picked?
    \begin{solution}[0.0in]
    \end{solution}
  \end{parts}

\question{} List $\P{\{\heartsuit, \star, \circledcirc\}}$.

\question{} How can you prove that two sets have the same cardinality?
\question{} Use a \emph{truth table} to prove that the
  \emph{inverse} and \emph{converse} of $p \limplies q$ are logically
  equivalent. For full credit make sure to format it as we write
  proofs.

\question{} What is the \emph{contrapositive} of $\forall n \in
  \mathbb{Z}^{\ge 0} \forall p \in \{$prime$\} \;\; p \ddiv n^2
  \limplies p \ddiv n$

\question{} \textbf{Prove} that $\sum\limits_{i = 1}^{n} (2i - 1)$ is $n^2$ for
  all positive integers, $n$.

\question{} Use strong induction to show that every positive integer $n$
  can be written as a sum of distinct powers of two, that is, as a sum
  of a subset of the integers $2^0 = 1$, $2^2 = 2$, $2^2 = 4$, and so
  on. [Hint: For the inductive step, separately consider the case
  where $k + 1$ is even and where it is odd.  When it is even, note that
  $\frac{k + 1}{2}$ is an integer.]

\question{} \textbf{Prove} that for any sets $A$ and $B$, $countable(A) \land
  countable(B) \limplies countable(A \cup B)$.

\question{} Let $odd = \{z \in \mathbb{Z} | z $ is
  odd.$\}$. \textbf{Prove} that $|odd| = |\mathbb{Z}|$.

\question{} We have proved that for sets $A$ and $B$, $A \subset B$
  implies $|A| \leq |B|$. Explain \textbf{why} the relationship
  between the cardinalities must be $\leq$ while the relationship
  between the two sets is $\subset$.

\question{} Write a short paragraph arguing that the number of
  \emph{deciders} is \textbf{countable}. Include what a decider
  \emph{is}, how we represent them in this class, and then give your
  argument.

\question{} Using our language shorthand, represent the set of
  \emph{all} \textbf{decimal} strings.
\question{} Give a precise definition of
  \begin{parts}
  \part{} $\mathbb{Q}$
  \part{} \emph{alphabet}, \emph{string}, \emph{language}
  \part{} \emph{countable}
  \part{} the \emph{even} predicate
  \end{parts}
\end{questions}
\end{document}

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