%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\sect{Large deviation theory}

Consider a set of $N$ random variables $\hat{x}_j$. 
Each variable can get the values 1 or 0 with probabilities $p$ and ${q=1-p}$ respectively.  
Define ${\hat{x}=(1/N)\sum_j \hat{x}_j}$. Define ${F(x)=\text{Prob}(\hat{x}>x)}$. \\

(1)
Find an approximation for $F(x)$ based on the central limit theorem.


(2)
Find an approximation for $F(x)$ based on the the large deviations theory.


(3)
Plot the two approximations as well as the exact $F(x)$ using a semi-log scale. 

(4)
What would be the answers if the $\hat{x}_j$ had normal 
probability distribution with the same average and variance?  


