How to calculate the expectation of the square of the number of heads in N tosses?

964 Views Asked by At

Suppose we have a coin that has a probability $p$ of landing head. Let H be the number of heads obtained in N tosses. How to calculate $E(H^2)$? I need this to calculate some other things. But I can't figure out. I know I need to take $\sum x^2p(x)$, but I am unable to evaluate it to a nice expression.

3

There are 3 best solutions below

0
On BEST ANSWER

$$E_n[H^2] = \sum_{k=0}^{n}\binom{n}{k}p^k(1-p)^{n-k}k^2 =n^2p^2 - np^2 + np $$

0
On

I assume that you're talking about $N$ independent coin tosses. (Actually, the calculation below assumes only that the tosses are pairwise independent.) Let $p$ be the probability that the coin comes up heads, and let $q=1-p$ be the probability that it comes up tails.

Let $H_i$ be the indicator variable which takes the value $1$ if the $i^{\text{th}}$ toss comes up heads, $0$ otherwise. Thus $$H=H_1+H_2+\cdots+H_N.$$ and $$H^2=(H_1+\cdots+H_N)^2=\sum_{i=1}^NH_i^2+\sum_{i\ne j}H_iH_j,$$ so $$E(H^2)=\sum_{i=1}^NE(H_i^2)+\sum_{i\ne j}E(H_iH_j)=\sum_{i=1}^Np+\sum_{i\ne j}p^2$$$$=Np+N(N-1)p^2=Np(1-p)+N^2p^2=Npq+E(H)^2.$$

0
On

It appears that you know $H$ follows a binomial distribution with parameters $N, p$. Since the variance and the expectation of the binomial distribution are well-known, you can solve the variance formula for $E[H^2]$ and do $$E[H^2] = \operatorname{Var}(H)+(E[X])^2 = Np(1-p) +(Np)^2.$$

Of course, if you are proving what the variance value is ("calculate some other things"), this doesn't quite work.