Overleaf Homework Template
Author
Tashfeen, Ahmad
Last Updated
5 months ago
License
Other (as stated in the work)
Abstract
This is a LaTeX class aimed towards formatting homework.
For more and documentation see: https://github.com/simurgh9/hw
\documentclass{homework}
\author{Musa Al`Khwarizmi}
\class{CS 3141: Prof. Kamil's Algorithm Analysis}
\date{\today}
\title{Overleaf Homework Template}
\address{Bayt El-Hikmah}
\graphicspath{{./media/}}
\begin{document} \maketitle
\question Write down sets in order of containment.
\begin{sol}
We pretend that equivalence classes are just numbers.
\[
\C \supset \R \supset \Q \supset \Z \supset \N \supset
\P \not\supset (\GF[7] = \modulo[7]) \supset \{\nil\}
\]% the empty line bellow is needed to avoid extra space.
\end{sol}
\question Find roots of $x^2- 8x = 9$.
\begin{sol}
We proceed by factoring,
\begin{align*}
x^2- 8x - 9 & = 9-9 & & \text{Subtract 9 on both sides.} \\
x^2- x + 9x - 9 & = 0 & & \text{Breaking the middle term.} \\
(x - 1)(x + 9) & = 0 & & \text{Pulling out common } (x - 1). \\
x & \in \{1, -9\} & & f(x)g(x) = 0 \Ra f(x) = 0 \vee g(x) = 0.
\end{align*}% the empty line bellow is needed to avoid extra space.
\end{sol}
\question Figure \ref{wheel} shows two cipher wheels. The left one is from Jeffrey Hoffstein, et al. \cite{hoffstein2008introduction} (pg. 3). Write a Python 3 program that uses it to encrypt: \texttt{FOUR SCORE AND SEVEN YEARS AGO}.
\begin{sol}
\img<wheel>[0.26]{Cipher wheels.}{cipher.png, diagram.jpg}
The Python program is given in listing \ref{cpr} and the encryption is given in table \ref{enc}.
\lstinputlisting[language=Python, caption={Python 3 implementing figure \ref{wheel} left wheel.}, label=cpr]{code/prog.py}
\tbl<enc>{Caesar cipher} {
Plain Text & FOUR & SCORE & AND & SEVEN & YEARS & AGO \\
Cipher Text & KTZW & XHTWJ & FSI & XJAJS & DJFWX & FLT \\
}
\end{sol}
% citations
\bibliographystyle{plain}
\bibliography{citations}
\end{document}