\documentclass[noanswers,addpoints,11pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[most]{tcolorbox}
\usepackage{datetime}
\usepackage{enumerate}
\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}

\usepackage{fontspec}
\IfFontExistsTF{Gentium Book Basic}{
  \setmainfont{Gentium Book Basic}
}{
  \setmainfont{Times New Roman}
}
\IfFontExistsTF{Comic Code}{
  \setmonofont{Comic Code}[
  Scale = 0.85,
  ]
}{
}

\lstset{
  basicstyle=\ttfamily,
  language={},
}
\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{\checkpoint}{{\Large $\checkmark$} }

% classname
\newcommand\labTitle{Logic Homework}
\newcommand\semester{Spring 2024}
\newcommand\className{Foundations of Computer Science}
\newcommand\classNumber{CIS~300}
\newcommand\classFullName{\classNumber~\className}
\renewcommand{\dateseparator}{-}
\yyyymmdddate

% /classname

\pagestyle{headandfoot}
\firstpageheader{\classNumber\\\semester}{\labTitle\\~}{\today\\~}
\runningheader{\labTitle}{}{\today}

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

\definecolor{outputgray}{gray}{0.95}
\definecolor{lsting}{rgb}{0.95, 0.9, 1.0}


\begin{document}
\pointsinrightmargin{}

\noindent

\section*{Learning Outcomes}
Upon completing this homework, students should be able to

\begin{itemize}
\item \textbf{Manipulate} modern logic notation.
\item Draw \textbf{truth tables} for different numbers of basic propositions.
\item \textbf{Simplify} componund propositions.
\end{itemize}

\section*{Assignment}

\begin{questions}
\question{} What is the difference between a \emph{preposition} and a
  \emph{predicate}?

\question{} Which of the following are or are \emph{not} propositions? Explain
  why or why not.
  \begin{parts}
  \part{} $even(5)$.
  \part{} $y \le 0$
  \part{} $odd(z)$.
  \part{} One of the suits in a deck of cards is \emph{green}.
  \part{} $15 \ge 90$
  \end{parts}

\question{} Draw the truth table for each of the following logical
  expressions (you may make one \emph{wide} table if you like):
\begin{parts}
\part{} p \(\wedge\) q
\part{} p \(\vee\) q
\part{} \(\neg{}\) p
\part{} p \(\limplies\) q
\part{} p \(\oplus\) q
\end{parts}

\question{} Given \emph{compound} propositions \(J\) and \(K\),
  \textbf{define} \(J \equiv K\) ($J$ is logically equivalent to $K$).

\question{} Given the statement "If you drive over 100kmh, then you will get
  a speeding ticket.", we can define two \emph{propositions} to
  translate it into a logic statement.

 Let $S$ ::= "You drive over 100kmh" and $T$ ::= "You get a
speeding ticket."

\begin{parts}
\part{} Express the implication in terms of the variables, \(\neg{}\), and
\(\limplies\).
\part{} Let U ::= "You do \textbf{not} get a speeding ticket". Write
  the original mplication in terms of $S$ and $U$ (without using $T$). Use only
\(\limplies\) and \(\neg{}\) as above.
\end{parts}

\question{} Given the statement: Dr. Ladd bakes bread whenever there is flour
  in the house.
  \begin{parts}
  \part{} Define two simple propsitions that can be combined to make this
    implication.
  \part{} Use your propositions to express the statement as an
    implication
  \part{} Write and label the \emph{inverse}, \emph{converse}, and \emph{contrapositive}
    for the implication.
  \part{} Translate each related implication in the problem above back into
    English.
  \end{parts}

\question{} Rewrite $y \limplies z$ as a \emph{disjunction} or explain
  why it is impossible. (Remember \textbf{Deduction Through the Ages}.)
\question{} Rewrite $y \limplies z$ as a \emph{conjunction} or explain
  why it is impossible. (Remember \textbf{Deduction Through the Ages}.)

\question{} \label{manyvariables}
  Simplify the logical expression $\neg ((e \limplies h)
  \land (\neg (n \lor r) \land v))$

\question{} How many rows would there be in a truth table for the
  expression in question~\ref{manyvariables}?

\question{} \textbf{Prove}, using truth tables, that $((r \limplies s)
  \land (s \limplies t)) \limplies (r \limplies t)$ is a \emph{tautology}.

\question{} List the members of $\mathbb{Z}_8$.


\question{} What does $\lnot(3 | n)$
  \begin{parts}
  \part{} Mean in English?
  \end{parts}
\end{questions}

\noindent
\textbf{Submit} your answers electronically, in a commonly readable
format
(\emph{e.g.} \lstinline{.pdf}, \lstinline{.txt}, \lstinline{.docx}),
through BrightSpace. If you photograph hand-written answers please
make sure there is enough contrast that I can read them and
\emph{please} put all the pages in a single file (Adobe Scan is
available on Android and iOS).


\end{document}

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