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

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

\begin{document}

\title{Homework 1}

\date{}

\maketitle

\thispagestyle{fancy}
\pagestyle{fancy}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% PLEASE LIST COLLABORATORS BELOW  %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\bfseries Collaborators :}
%%% List your collaborators and any online resources here.

\newpage
\centering
{\Huge{Practice Questions}}

These are practice questions.
They will \textbf{NOT} be graded.
We have also provided the final answers.
However, it is up to you to understand how or why the given solution is correct.

You do not need to submit these on Gradescope.
However, you may find it easier to just include them in the pdf.
In that case, please do not mark these questions on Gradescope.

\newpage

\begin{enumerate}
	\item {\bfseries Basic Probabilities (0 points)}
	      \begin{enumerate}
	      	\item {\bfseries (0 points)}
	      	      Consider 7 balls: 3 yellow, 2 red, and 2 green.
	      	      I pick one ball uniformly at random.
	      	      What is the probability that I pick a red ball?

	      	      {\bfseries Solution.}

	      	      $\frac{2}{7}$

	      	      \vfill

	      	\item {\bfseries (0 points)}
	      	      Consider 7 balls: 3 yellow, 2 red, and 2 green.
	      	      I pick one of them uniformly at random.
	      	      What is the probability that it is NOT a red ball?

	      	      {\bfseries Solution.}

	      	      $\frac57$

	      	      \vfill
	      \end{enumerate}
	      \newpage

	\item {\bfseries Conditional Probabilities and Bayes' Rule (0 points)}
	      $$\Pr[X=x]=0.5$$
	      $$\Pr[Y=y]=0.3$$
	      $$\Pr[X=x, Y=y]=0.15$$

	      What is $\Pr[X=x\vert Y=y]$?

	      {\bfseries Solution.}

	      $\frac12$
	      \vfill

	      \newpage

	\item {\bfseries Conditional Probabilities and Bayes' Rule (0 points)}
	      Write $\Pr[X=x\vert Y=y]$ in terms of $\Pr[Y=y\vert X=x]$. That is, $\Pr[X=x\vert Y=y] = \lambda\cdot\Pr[Y=y\vert X=x]$ where $\lambda$ is some expression.

	      {\bfseries Solution.}

	      $$\Pr[X=x\vert Y=y] = \frac{\Pr[X=x]}{\Pr[Y=y]}\cdot \Pr[Y=y\vert X=x]$$
	      or
	      $$\lambda=\frac{\Pr[X=x]}{\Pr[Y=y]}$$
	      \vfill

	      \newpage

	\item {\bfseries Understanding Joint Distribution (0 points)}
	      Twelve balls will be tossed into six bins numbered $\{1, 2, 3, 4, 5,6\}$.
	      Each ball is thrown into a bin uniformly and independently into the bins.
	      For $i\in\{1,2,3,4,5,6\}$, let $X_i$ represent the {\em number} of balls that fall into bin $i$.

	      \begin{enumerate}
	      	\item {\bfseries (0 points)}
	      	      Find $\prob{[X_1 = 12]}.$

	      	      {\bfseries Solution.}

	      	      $\frac{1}{6^{12}}=\frac{1}{2176782336}$

	      	      \vfill

	      	\item {\bfseries (0 points)}
	      	      Find the (marginal) distribution of $X_5$.

	      	      {\bfseries Solution.}

	      	      The marginal distribution of random variable $X_5$ is binomial with parameters $n=12$, and $p=\frac16$:
	      	      $$\prob{[X_5 = k]} = {\binom{12}{k}} \cdot \left( \frac{1}{6}\right)^k \cdot \left( \frac{5}{6}\right)^{12-k}.$$

	      	      \vfill

	      	\item {\bfseries (0 points)}
	      	      Find $\prob{[X_2 = 2  ~\vert~ X_1 + X_3 + X_5  = 5]}.$

	      	      {\bfseries Solution.}

	      	      $\frac{224}{729}$
	      	      \vfill

	      \end{enumerate}

\end{enumerate}

\newpage
\centering
{\Huge{Homework Questions}}

These are homework questions and will be graded.
Please make sure to clearly mark each problem on Gradescope.
\newpage

\begin{enumerate}
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%%%%%%%%% PROBLEM 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\item {\bfseries Basic Probabilities (2 points)}
	      Consider 9 balls: 5 white and 4 black.
	      I pick two balls uniformly at random without replacement.
	      What is the probability that both balls are black?

	      {\bfseries Solution.}

	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      \newpage

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

	\item {\bfseries Polya's Urn (4+5 points)}
	      \begin{enumerate}
	      	\item {\bfseries (4 points)}
	      	      Suppose there are $R>1$ red balls and $G>1$ green balls in a box. We pick a ball from the box uniformly at random.
	      	      If it is green, we put it back in the box; otherwise, we throw it away.
	      	      After that, we pick another ball from the box uniformly at random.
	      	      What is the probability that the first ball we picked is red, conditioned on the fact that the second ball we picked is green?

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \newpage

	      	\item {\bfseries (5 points)}
	      	      Suppose there are $B>1$ black and $W>1$ white balls in an urn.
	      	      We sample a ball uniformly at random.
	      	      We replace the ball in the urn and add $k\geq 1$ additional balls of the SAME color.
	      	      After that, we sample a ball and report its color.

	      	      What is the distribution of the second ball's color?

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      \end{enumerate}
	      \newpage

	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%% PROBLEM 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\item {\bfseries Sending One Bit (5+5+5+5 points)}

	      Alice intends to send a bit $b\in\{0,1\}$ to Bob.
	      When Alice sends the bit, it goes through a series of $n$ relays before reaching Bob.
	      Each relay flips the received bit independently with probability $p$ before forwarding that bit to the next relay.

	      \begin{enumerate}
	      	\item {\bfseries (5 points)}
	      	      Show that Bob will receive the correct bit with a probability
	      	      $$\sum_{k = 0}^{\lfloor n/2 \rfloor} {\binom{n}{2k}} \cdot p^{2k} \cdot (1 - p)^{n - 2k}.$$
	      	      Hint: Your solution should work irrespective of whether Alice sends $0$ or $1$.

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \newpage

	      	\item {\bfseries (5 points)}
	      	      Let us consider an alternative way to calculate this probability.
	      	      We say that the relay has {\em{bias}} $q$ if the probability it flips the bit is $(1-q)/2$.
	      	      The bias $q$ is a real number between $-1$ and $+1$.
	      	      Show that sending a bit through two relays with bias $q_1$ and $q_2$ is equivalent to sending a bit through a single relay with bias $q_1 \cdot q_2$.

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \vfill

	      	\item {\bfseries (5 points)}
	      	      Prove that the probability you receive the correct bit when it passes through $n$ relays is $$\frac{1+(1-2p)^n}{2}.$$

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \vfill

	      	      \newpage

	      	\item {\bfseries (5 points)}
	      	      Fix a probability $p$ with $0<p<1$.
	      	      Using part (c), show that the probability Bob receives the correct bit tends to $1/2$ as the number of relays $n$ grows.
	      	      Hint: Note that $\left|1-2p\right|<1$ whenever $0<p<1$.

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \vfill

	      \end{enumerate}
	      \newpage

	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%% PROBLEM 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\item {\bfseries Splitting Balls Between Two Boxes (1+3+3 points)}
	      I have 100 balls: 50 purple and 50 golden.
	      \begin{enumerate}
	      	\item {\bfseries (1 point)}
	      	      Suppose I pour all 100 balls into one large box.
	      	      I then select one ball from this box uniformly at random and report its color.
	      	      What is the probability that I pick a golden ball?

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \vfill

	      	\item {\bfseries (3 points)}
	      	      Now suppose I distribute the 100 balls between two boxes instead.
	      	      I place $x$ purple balls and $y$ golden balls in box 1, and the remaining $50-x$ purple balls and $50-y$ golden balls in box 2.
	      	      Neither box may be left empty.
	      	      I select one of the two boxes uniformly at random (each with probability $1/2$), then select one ball from that box uniformly at random and report its color.

	      	      In terms of $x$ and $y$, what is the probability that I pick a golden ball?

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \vfill

	      	      \newpage

	      	\item {\bfseries (3 points)}
	      	      Give a concrete choice of $x$ and $y$ for which the probability in part (b) equals the probability in part (a), and a concrete choice of $x$ and $y$ for which the two probabilities differ.
	      	      In each case, compute the probability from part (b) to justify your answer.

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      \end{enumerate}

	      \newpage

	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%% PROBLEM 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
	      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\item {\bfseries (10 points)}
	      Recall that $x \mod p$ means the remainder of $x$ when divided by $p$.
	      For example, ``$13$ divided by $3$'' is $4$ with remainder $1$ because $13=4\cdot 3 + 1$.
	      We write this as: $13\mod 3 = 1$.
	      \begin{enumerate}
	      	\item {\bfseries (5 points)}
	      	      Recall the definition of binomial coefficient $\binom pk \defeq \frac{p!}{k!(p-k)!}$.
	      	      For a prime $p$, prove that $p$ divides $\binom pk$, if $k\in\{1,2,\dotsc,p-1\}$.

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      	      \newpage

	      	\item {\bfseries (5 points)}
	      	      Recall that $(1+x)^p = \sum_{k=0}^p \binom pk x^k$.
	      	      Prove by induction on $x$ that, for any $x\in\{1,2,\dotsc,p-1\}$, we have
	      	      $$\overbrace{x\times x \times \dotsi \times x}^{p\text{-times}}\mod p=x$$

	      	      {\bfseries Solution.}

	      	      \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE

	      \end{enumerate}
	      \newpage

\end{enumerate}
\end{document}
