# 4.5 Expectation

## Fair And Biased Coins

Say I flip 200 coins, 100 of which are fair, and 100 of which land on heads with probability $$\frac{1}{4}$$.
What is the expected number of heads?

Exercise 1

Let $$R_i$$ be an indicator variable for the $$i^{th}$$ fair coin, where $$R_i = \begin{cases} 1 & i^{th}\text{ flip is heads} \\ 0 & i^{th}\text{ flip is tails} \end{cases}$$.
Similarly, define $$S_j$$ as the indicator variable for the $$j^{th}$$ biased coin.
Then, the number of heads is given by $$H=R_1+R_2+\ldots +R_{100}+S_1+S_2+\ldots+S_{100}$$.
By linearity of expectation, $E[H]=E[R_1+R_2+\ldots +R_{100}+S_1+S_2+\ldots+S_{100}]$ $=E[R_1]+E[R_2]+\ldots +E[R_{100}]+E[S_1]+E[S_2]+\ldots+E[S_{100}]$ $=100\cdot\frac{1}{2}+100\cdot\frac{1}{4}=50+25=75.$