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

\usepackage{fancyhdr}  %%% <-- Newly Added 
\pagestyle{fancy}      %%% <-- Newly Added
\lhead{}               %%% <-- Newly Added
\rhead{Name: Hemanta K. Maji} %%% <-- YOUR NAME HERE, Newly Added

\usepackage[strict]{changepage}  %%% <-- Newly Added
\newcommand{\nextoddpage}{\checkoddpage\ifoddpage{\ \newpage\ \newpage}\else{\ \newpage}\fi}  %%% <-- Newly Added

\begin{document}

\title{Homework 1}

\date{}

\maketitle 

\thispagestyle{fancy}  %%% <-- Newly Added
\pagestyle{fancy}      %%% <-- Newly Added


\begin{enumerate}


\item {\bfseries Practice with Fields.} 
  We shall work over the field $(\bbZ_7,+,\times)$. 
  
  \begin{itemize}
  \item (7 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 (7 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 (3.25 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 (10.5 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{itemize} 


\nextoddpage 
\item {\bfseries An Illustrative Execution of Shamir's Secret Sharing Scheme.} 
  We shall work over the field $(\bbZ_7,+,\times)$. 
  We are interested in sharing a secret among 6 parties such that any 4 parties can reconstruct the secret, but no subset of 3 parties gain any additional information about the secret. 
  
  Suppose the secret is $s=5$. 
  The random polynomial of degree $<4$ that is chosen during the secret sharing steps is $p(X) = 2X^2 + 3X + 5$. 
  \begin{itemize}
  \item (12 points) What are the respective secret shares of parties 1, 2, 3, 4, 5, and 6? 
  \item (16 points) Suppose parties 1, 3, 5, and 6 are interested in reconstructing the secret. 
    Run Lagrange Interpolation algorithm as explained in the class. 
    
    ({\footnotesize {\em 
      Remark:} 
      It is essential to show the step-wise reconstruction procedure to score full points. 
      In particular, you need to write down the polynomials $p_1(X)$, $p_2(X)$, $p_3(X)$, and $p_4(X)$.% 
    })
  \item (18 points) Suppose parties 1, 3, and 5 get together. 
    Let $q_{\widetilde s}(X)$ be the polynomial that is consistent with their shares and the point $(0,\widetilde s)$, for each $\widetilde s\in \bbZ_p$. 
    Write down the polynomials $q_0(X)$, $q_1(X)$, $\dotsc$, $q_6(X)$.  
  \end{itemize} 
  
  
\nextoddpage   
\item {\bfseries A bit of Counting.} 
  In this problem, we will do a bit of counting related to polynomials that pass through a given set of points in the plane. 
  
  We are working over the field $(\bbZ_p,+,\times)$, where $p$ is a prime number. 
  Let $\cP_t$ be the set of all polynomials in the indeterminate $X$ with degree $<t$ and coefficients in $\bbZ_p$. 
  
  \begin{itemize}
  \item (15 points) Let $(x_1,y_1)$, $(x_2,y_2)$, $\dotsc$, and $(x_t,y_t)$ be $t$ points in the plane $\bbZ_p^2$. 
    We have that $x_i \neq x_j$ for all $i\neq j$, that is, the first coordinates of the points are all distinct. 
    
    Prove that there exists a {\em unique polynomial} in $\cP_t$ that passes through these $t$ points. 
    
    ({\footnotesize
      Hint: 
        Use Lagrange Interpolation and Schwartz--Zippel Lemma. 
    }%
    )
  \item (15 points) Let $(x_1,y_1)$, $(x_2,y_2)$, $\dotsc$, and $(x_{t-1},y_{t-1})$ be $(t-1)$ points in the plane $\bbZ_p^2$.
    We have that $x_i \neq x_j$ for all $i\neq j$, that is, the first coordinates of the points are all distinct.
    
    Prove that there are $p$ polynomials in $\cP_t$ that pass through these $(t-1)$ points. 
  \item (20 points) Let  $(x_1,y_1)$, $(x_2,y_2)$, $\dotsc$, and $(x_k,y_k)$ be $k$ points in the plane $\bbZ_p^2$, where $k\leq t$. 
    We have that $x_i \neq x_j$ for all $i\neq j$, that is, the first coordinates of the points are all distinct.
    
    Prove that there are $p^{t-k}$ polynomials in $\cP_t$ that pass through these $k$ points. 
  \end{itemize} 
  



\nextoddpage 
\item {\bfseries A bit of Probability.} 
  Recall Shamir's secret sharing algorithm. 
  In this problem, we shall prove a few properties of this secret sharing scheme. 
  
  Suppose we are working over the field $(\bbZ_p,+,\times)$. 
  Let $\probX{S=s}$, for $s\in\bbZ_p$, be the a priori probability of the secret $s$. 
  We are interested in sharing secrets among $n$ parties such that any $t$ parties can reconstruct the secret, and no additional information about the secret is revealed to any subset of $(t-1)$ parties. 
  
  Let $\cP_t$ be the set of all polynomials in the indeterminate $X$ with degree $<t$ and coefficients in $\bbZ_p$. 
  Let $p(X)$ represent the polynomial used to secret share $s$. 
  Let $s_i$ represent the evaluation of the polynomial $p(X)$ at $X=i$, represented by $p(i)$, for $i\in\{1,\dotsc,p-1\}$. 
  That is, the secret share received by party $i$ is $s_i$. 
  
   
  \begin{itemize}
  \item (10 points) For a fixed secret $s\in\bbZ_p$, prove that  
    $$\probX{p(0)=s} = \probX{S=s}$$  
  \item (10 points) For $x_1\in\bbZ_p^*$ and $y_1\in\bbZ_p$, prove that 
    $$\probX{p(0)=s, p(x_1)=y_1} = \frac{\probX{S=s}}{p}$$
  \item (10 points) For $0\leq k<t$, distinct $x_1,\dotsc,x_k\in\bbZ_p^*$ and $y_1,\dotsc,y_k\in\bbZ_p$
    $$\probX{p(0)=s, p(x_1)=y_1,\dotsc,p(x_k)=y_k}=\frac{\probX{S=s}}{p^k}$$
  \item (10 points) For $0\leq k<t$, distinct $x_1,\dotsc,x_k\in\bbZ_p^*$ and $y_1,\dotsc,y_k\in\bbZ_p$
    $$\probX{p(x_1)=y_1,\dotsc,p(x_k)=y_k} =\frac{1}{p^k}$$  
  \end{itemize} 
  
\nextoddpage  
\item (36.25 points) {\bfseries Privacy Concern.} 
  In the class, a few students proposed that we restrict Shamir's Secret Sharing scheme to use only polynomials of degree $(t-1)$ instead of all polynomials of degree $<t$. 
  We will demonstrate a security flaw with this modified scheme. 
  
  Suppose $t=3$ and we are working over $(\bbZ_5,+,\times)$. 
  A priori, we have $\probX{S=s}=\frac15$, for all secrets $s\in\bbZ_5$.  
  Assume that $p(X) = X^2 + 1$ was the polynomial used for secret sharing. 
  
  Suppose party 1 and party 3 get together. 
  Given their secret shares, what is the a posteriori probability of each secret? 



  


\end{enumerate}









\end{document}
