\documentclass[11pt]{article}

\usepackage{exscale}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{times,mathptm}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{mathpazo}
\usepackage{amssymb}
\usepackage{mathtools}

\textwidth 6.5truein          
\textheight 9.5truein
\oddsidemargin 0.0in
\topmargin -0.5in
\thispagestyle{empty} 

\parindent 0pt          
\parskip 0pt

\begin{document}

{\bf Name: }
\hspace{13cm}
{\bf Section: }

\begin{large}
\centerline {\bf Computer Science 243}
\centerline {\bf Spring 2025}
\centerline {\bf Homework 7}
% \centerline{\bf My name}
\vskip .7cm

\bf Due: 11:59 p.m., Wednesday, 3/26/25 \hfill Points: 50
\end{large}
\vskip 0.5cm
Answer the following questions and show your work.  Your final submission must be completely your own work.

\begin{enumerate}

\item {[4 points]} Find $a$ {\bf div} $m$ and $a$ {\bf mod} $m$ for each of the following [no work need be shown]:
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item $a = 105, m = 19$
\item $a = -2117, m = 31$
\end{enumerate}

\vskip 0.5cm
\item {[9 points]}  For each representation given in decimal, binary, octal, or hexadecimal, convert the value of each to the other three formats [for
decimal to binary, show repeated division by 2; for binary or hex to decimal, show powers of 2 or 16 that are added; for binary to octal or hex (or reverse), 
show grouping of bits to octal or hex digits]:
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item $114_{10}$
\item $1100\ 0011_{2}$
\item AD$_{16}$
\end{enumerate}


\vskip 0.5cm
\item {[4 points]}  Determine whether the integers in the following sets are pairwise relatively prime [no work need be shown].  
If not, state the integers and their common factor(s).
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item 19, 24, 35
\item 21, 34, 59, 85
\end{enumerate}


\vskip 0.5cm
\item {[6 points]}  Find the gcd’s and lcm’s of the following pairs of integers [express integers in prime factorization first].
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item 24, 32
\item 48, 64
\item $2^2 \cdot 3^3 \cdot 7$, $2^3 \cdot 3^2 \cdot 5^2$ 
\end{enumerate}


\vskip 0.5cm
\item {[4 points]}  Use the Euclidean algorithm to find gcd (105, 96).  Find Bézout coefficients, $s$ and $t$, 
to express this gcd as a linear combination of 105 and 96 [show work similar to slide 45 in Chapter 4].


\vskip 0.5cm
\item {[6 points]}  Use Fermat’s Little Theorem to find the following [show work similar to slide 48 in Chapter 4]:
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item $3^{119}$ mod 5  
\item $5^{143}$ mod 7
\end{enumerate}

\newpage

\vskip 0.5cm
\item {[4 points]}  Decrypt the following messages which were encrypted using the Caesar cipher with a shift of 3 [no work need be shown]:
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item ODCB GRJ
\item LGHV RI PDUFK
\end{enumerate}


\vskip 0.5cm
\item {[3 points]}  Encrypt the word SPRING by translating the letters into numbers (0-25), applying the encryption 
function $f(p) = (2p + 11)$ mod 26, and then changing the numbers back to letters.


\vskip 0.5cm
\item {[10 points]}  Find the following values for various codes [show work similar to slides 54-55 and 70 in Chapter 4].
\begin{enumerate}[label=\alph*.]
\itemsep-0mm
\item {[3 points]}  Compute the check digit for a UPC with the first 11 digits: 84171013869.
\item {[3 points]}  Compute the check digit for an ISBN10 with the first 9 digits: 164558933.
\item {[4 points]}  Encrypt the word JUMP using RSA encryption with key (2537, 13).
\end{enumerate}


\end{enumerate}

\end{document}
