\documentclass[11pt]{article}
\input{headers02}

\usepackage{fancyhdr}   
\pagestyle{fancy}      
\lhead{CS 355, FALL 2018}               
\rhead{Name: Hemanta K. Maji} %%% <-- REPLACE Hemanta K. Maji WITH YOUR NAME HERE

\usepackage[strict]{changepage}  
\newcommand{\nextoddpage}{\checkoddpage\ifoddpage{\ \newpage\ \newpage}\else{\ \newpage}\fi}  


\begin{document}

\title{Homework 2}

\date{}

\maketitle 

\thispagestyle{fancy}  
\pagestyle{fancy}      




\begin{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item {\bfseries Some properties of $(\bbZ_p^*,\times)$.} 
  Recall that $\bbZ_p^*$ is the set $\{1,\dotsc,p-1\}$ and $\times$ is integer multiplication $\mod p$, where $p$ is a prime. 
  For example, if $p=5$, then $2\times 3$ is $1$. 
  In this problem we shall prove that $(\bbZ_p^*,\times)$ is a group. 
  The only part missing in the lecture was the proof that every $x\in\bbZ_p^*$ has an inverse. 
  We will find the inverse of any element $x\in\bbZ_p^*$. 
  \begin{enumerate}
  \item(10 points) Recall $\smallchoose pk \defeq \frac{p!}{k!(p-k)!}$. 
    For a prime $p$, prove that $p$ divides $\smallchoose pk$, if $k\in\{1,2,\dotsc,p-1\}$. \newline
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
   \newpage
  \item(10 points) Recall that $(1+x)^p = \sum_{k=0}^p \smallchoose pk x^k$. 
    Prove by induction that, for any $x\in\bbZ_p^*$, we have  
      $$\overbrace{x\times x \times \dotsi \times x}^{p\text{-times}}=x$$\newline
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
   \newpage
   \item(10 points) For $x\in\bbZ_p^*$, prove that the inverse of $x$ is given by 
     $$\overbrace{x\times x \times \dotsi \times x}^{(p-2)\text{-times}}$$ 
  Formally, prove that $x^{p-1}=1\mod p$, for any prime $p$ and $x\in\bbZ_p^*$.      
     \newline
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
   \newpage
  \end{enumerate} 
  

  


  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\bfseries Understanding Groups: Part One.} 
In this problem we shall derive some basic results based on the definition of groups as introduced in the lectures. 
  Let $(G,\circ)$ be a group and let $e$ be the identity element of the group. \newline
  \newline
%  {\bfseries Part One.}
  \begin{enumerate}
 \item (5 points) Prove that it is impossible that there exists $a,b,c\in G$ such that $a\neq b$ but $a\circ c = b\circ c$. \newline
    {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
    \newpage
 \end{enumerate}
 
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \item    {\bfseries Understanding Groups: Part Two. } 
    Recall that when we defined a group $(G,\circ)$, we stated that there exists an element $e$ such that for all $x\in G$ we have $x\circ e=x$. 
  Note that $e$ is ``applied on $x$ from the right.'' 
  
  Similarly, for every $x\in G$, we are guaranteed that there exists $\inv(x)\in G$ such that $x\circ\inv(x)=e$. 
  Note that $\inv(x)$ is again ``applied to $x$ from the right.'' 
  
  In this problem, however, we shall explore the following questions: (a) Is there an ``identity from the left?,'' and (b) Is there an ``inverse from the left?'' 
  
  We shall formalize and prove these results in this question. 
  \begin{enumerate}
  \item (5 points) Prove that $e\circ x = x$, for all $x\in G$.  \newline
    {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (8 points) Prove that if there exists an element $\alpha\in G$ such that for all $x\in G$ we have $\alpha\circ x=x$, then $\alpha = e$.  \newline
  (Remark: Note that these two steps prove that the ``left identity'' is identical to the right identity $e$.) 
  \newline 
  {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  
  
  
  \item (5 points) Prove that $\inv(x)\circ x = e$.  \newline
    {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (8 points) Prove that if there exists an element $\alpha\in G$ and $x\in G$ such that $\alpha\circ x=e$, then $\alpha=\inv(x)$.  \newline
  (Remark: Note that these two steps prove that the ``left inverse of $x$'' is identical to the left inverse $\inv(x)$. ) \newline
  {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
 
 \end{enumerate}
 
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \item {\bfseries Understanding Groups: Part Three.}
  In this part, we will prove a crucial property of inverses in groups - they are unique. And finally, using this property, we will prove a result that is crucial to the proof of security of one-time pad over the group $(G,\circ)$. 
 
 \begin{enumerate} 
   \item(5 points) Suppose $a,b\in G$. 
     Let $\inv(a)$ and $\inv(b)$ be the inverses of $a$ and $b$, respectively (\ie, $a\circ\inv(a)=e$ and $b\circ\inv(b)=e$). 
     Prove that $\inv(a)=\inv(b)$ if and only if $a=b$.  \newline
    {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
    % \end{itemize}
     \newpage
  
  \item (5 points) Suppose $m\in G $ is a message and $c\in G$ is a cipher text. 
    Prove that there exists a unique $\sk\in G$ such that $m\circ \sk = c$.  \newline
    {\bfseries Solution.}  \newline
    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
   \newpage
  \end{enumerate}
  
 \newpage 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item {\bfseries Calculating Large Powers mod $p$.} 
  Recall that we learned repeated squaring algorithm in class. 
\newline 
  (8 points).  
  Calculate the following using this concept \newline
  $$ 11^{507} \pmod{1237} $$
  (Remark: $1237$ is a prime number). \newline 
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  
  
 
   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item {\bfseries Practice with Fields.} 
  We shall work over the field $(\bbZ_7,+,\times)$. 
  
  \begin{enumerate}
  \item (5.6 points) Addition Table. 
    The $(i,j)$-th entry in the table is $i+j$. 
    Complete this table. 
    You do not need to fill the black cells because the addition is commutative. 
  
    \begin{table}[H]
    \begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline
     & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 
    0 & & & & & & & \\\hline
    1 & \cellcolor{black} & & & & & & \\\hline
    2 & \cellcolor{black} & \cellcolor{black} & & & & & \\\hline
    3 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & & & \\\hline
    4 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & & \\\hline
    5 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & \\\hline
    6 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \\\hline
    \end{tabular}
    \end{center}
    \caption{Addition Table.}
    \end{table}
  
  \item (5.6 points) Multiplication Table. 
    The $(i,j)$-th entry in the table is $i\times j$. 
    Complete this table. 
  
    \begin{table}[H]
    \begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline
     & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 
    0 & & & & & & & \\\hline
    1 & \cellcolor{black} & & & & & & \\\hline
    2 & \cellcolor{black} & \cellcolor{black} & & & & & \\\hline
    3 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & & & \\\hline
    4 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & & \\\hline
    5 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & & \\\hline
    6 & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \cellcolor{black} & \\\hline
    \end{tabular}
    \end{center}
    \caption{Multiplication Table.}
    \end{table}
    
  \item (2.6 points) Additive and Multiplicative Inverses. 
    Write the additive and multiplicative inverses in the table below. 
  
    \begin{table}[H]
    \begin{center}
    \begin{tabular}{|l|c|c|c|c|c|c|c|}\hline
    & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 
    Additive Inverse & & & & & & &\\\hline
    Multiplicative Inverse & \cellcolor{black} & & & & & &\\\hline 
    \end{tabular}
    \end{center}
    \caption{Additive and Multiplicative Inverses Table.}
    \end{table} 
  
  \item (7.2 points) Division Table. 
    The $(i,j)$-th entry in the table is $i/ j$. 
    Complete this table. 
  
    \begin{table}[H]
    \begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|}\hline
      & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 
    0 & & & & & & \\\hline
    1 & & & & & & \\\hline
    2 & & & & & & \\\hline
    3 & & & & & & \\\hline
    4 & & & & & & \\\hline
    5 & & & & & & \\\hline
    6 & & & & & & \\\hline
    \end{tabular}
    \end{center}
    \caption{Division Table.}
    \end{table}
  
  \end{enumerate} 



\end{enumerate}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PLEASE LIST COLLABORATORS BELOW  %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\bfseries Collaborators :} \newline 
% ENTER THEIR NAMES HERE  

\end{document}
