# FC08 Assignment 1

## Contents

### Problem 1: Discrete Probability.

(1) Read the following notes on discrete probability due to Luca Trevisan ps notes

We assume that the range of all the random variables below is contained in the reals.

(2) Let $X,Y$ be finite random variables. Prove that $E[X+Y]=E[X]+E[Y]$. (This equality can be generalized to $n$ random variables.)

(3) Let $X,Y$ be independent finite random variables. Prove that $E[XY]=E[X]E[Y]$. (This equality can be generalized to $n$ mutually independent random variables.)

(4) Optional: Let $X$ be a finite random variable, and let $a,b$ be reals. Prove that $Var[aX+b]=a^2 Var[X]$.

(5) Optional: Let $X_1,...,X_n$ be pairwise independent finite random variables (i.e, $X_i,X_j$ are independent for every $i\neq j$).

Prove that $Var[X_1+...+X_n]=Var[X_1]+...+Var[X_n]$

(6) Give an example for two random variables $X,Y$ such that $E[XY] \neq E[X]E[Y]$.

(7) Give an example for two random variables $X,Y$ such that $Var[X+Y] \neq Var[X]+Var[Y]$.

(8) Let $E_1, E_2$ be two events. Prove that $Pr[E_1\cup E_2]\leq Pr[E_1]+ Pr[E_2]$. (This inequality can be generalized to $n$ events, and is known as the union bound.)

### Problem 2.

Prove that Shannon secrecy implies perfect secrecy. (The other direction was proved in class. The proof for both direction appears in the lecture notes, though I strongly encourage the students to try to write the proof on their known. You can check the notes for assistance; however, avoid mere copying.)

### Problem 3.

Let $f:\{0,1\}^*\rightarrow\{0,1\}$ be a boolean function, let $p(\cdot)$ be a polynomial, and let $A$ be a probabilistic polynomial time algorithm such that for every $x\in\{0,1\}^*$,

$Pr[A(x)=f(x)]\geq\frac12+\frac{1}{p(|x|)}$.

Prove that there exists a probabilistic polynomial time algorithm $A'$ such that for every $x\in\{0,1\}^*$,

$Pr[A'(x)=f(x)]\geq 1-2^{-|x|}$.

Hint: Use Chernoff's Inequality, given in the appendix of the lecture notes.

### Problem 4.

Prove that there exists a collection of OWFs if and only if there exists a single strong OWF. (The highlevel idea of the proof was given in class, and appears in the lecture notes. Here the students are required to formalize this highlevel idea, and in particular, prove that the construction given in class works.)

### Problem 5.

Prove that for any integer n>0, and for every integers a,b>0,

1. $(a~mod~n) + (b~mod~n) = (a+b)~mod~n$

2. $(a~mod~n) \times (b~mod~n) = (a\times b)~mod~n$