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

\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 4}

\date{}

\maketitle 

\thispagestyle{fancy}  
\pagestyle{fancy}      




\begin{enumerate}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item {\bfseries Lagrange Interpolation.} 
We want to derive a part of the Chinese Remainder Theorem using principles of Lagrange Interpolation. Our goal is the following 
\begin{boxedalgo}
Suppose $p$ and $q$ are two distinct primes. Suppose $a\in \{0,\ldots,p-1\}$ and $b\in \{0,\ldots,q-1 \}$. We want to find a natural number $x$ such that 
\begin{align*}
    x \pmod p =a\ \text{and}\ x\pmod q=b 
\end{align*}
\end{boxedalgo}
\begin{enumerate}
    \item (10 points) Find a natural number $x_p$ such that : $x_p \pmod p = 1$ and $x_p \pmod q =0$. \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
    \item (12 points) Find a natural number $x_q$ such that : $x_q \pmod p = 0$ and $x_q \pmod q =1$. \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
    \item (5 points) Find a natural number $x$ such that : $x \pmod p = a$ and $x \pmod q =b$. \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
\end{enumerate}
 
     

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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{enumerate}
  \item (10 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. 
    }%
    )\newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (10 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. \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (10 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. \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \end{enumerate} 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\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{enumerate}
  \item (6 points) What are the respective secret shares of parties 1, 2, 3, 4, 5, and 6? \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (10 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)$.% 
    })\newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \item (7 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)$.  \newline 
     {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  \end{enumerate} 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item (20 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? \newline
 {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage


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

\end{document}
