I have a coin that show heads with a probability $p$. I toss it $N$ times and count the number of heads. I repeat the experiment once more. What's the probability that I get the same number of heads as before?
Using the binomial expansion, the probability of getting $k$ heads is ${N\choose k} p^k (1-p)^{N-k}$. So the probability of getting the same number of heads in the two independent experiments is $\sum_k {N\choose k}^2 p^{2k} (1-p)^{2N-2k}$, or the sum of squares of all terms in a binomial expansion. Can somebody help me calculate this analytically?
I repeat thje experiment once more
means what? You toss the coin a $N+1$-th time, or you toss $N$ times again? – Bernard Jul 27 '15 at 20:37