2

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?

Sameer
  • 201

1 Answers1

0

I think you might be able to follow this route ($q=1-p$):

  1. $\sum_k {N\choose k} (xp)^k (1-p)^{N-k}=(xp+q)^n$
  2. $f(z)=(zp+q)^n(\frac{p}{z}+q)^n$ has your sum $\sum_k {N\choose k}^2 p^{2k} (1-p)^{2N-2k}$ as the free term (no $z$)
  3. Your sum is the integral $\frac{1}{2\pi i}\int\frac{f(z)}{z}dz$ over the unit circle.
  4. $z=e^{2\pi i t}$ reduces the integral to $\int_0^{2\pi}f(e^{2\pi i t})dt$
sds
  • 4,533
  • This looks promising. Did you forget a 1/2πi before the integral? Unfortunately, I couldn't calculate the integral. Mathematica was unsuccessful too. Can you give it a try? Thanks. – Sameer Jul 27 '15 at 23:16