# Identity for the probability of a coin having an even number of heads

1. Nov 22, 2009

### koab1mjr

1. The problem statement, all variables and given/known data
Given that n independent tosses having probability of p of coming up heads are made, show that an even number of heads results is 0.5(1+(q-p)^n) where q is 1-p, by proving the identity
Sigma from i=0 to n/2 of (n choose 2i) (p^2i)(q^(n-2i))=0.5(((p+q)^n)+(q-p)^n)

2. Relevant equations

3. The attempt at a solution
I expanded it, (n choose 0)p^0 q^n + (n choose 2)p^2 q^(n-2)+....letting i=n/2 we get (n choose n)p^n q (n-n) ends up being just p^n.

2. Nov 22, 2009

### tiny-tim

Hi koab1mjr!

(have a sigma: ∑ and try using the X2 and X2 tags just above the Reply box )
Hint: start at the end …

what is the coefficient of pjqn-j of 0.5(((p+q)n)+(q-p)n) for j even? and for j odd?

3. Nov 22, 2009

### koab1mjr

thanks, but...
I tried it, but i am still not getting it, because starting from the end for even, i got p^2q^(n-2), p^4q^(n-4) and so on, plus i cannot get the factorials to work out....

4. Nov 23, 2009

### tiny-tim

(just got up :zzz: …)

p2qn-2 time what? p4qn-4 times what? … p2jqn-2j times what?

5. Nov 23, 2009

### Staff: Mentor

Couldn't resist: The probability of a coin having an even number of heads should be zero.

6. Nov 24, 2009

### koab1mjr

timing each one by (n choose 2), (n choose 4), and so on until i hits n/2, and at that point all becomes just p^n
???

7. Nov 25, 2009

### tiny-tim

Hi koab1mjr! :smile
(you can write that nC2 etc )

Yup!

And that's exactly the left-hand-side of the original identity, isn't it?

8. Nov 25, 2009

### koab1mjr

yeah, when you plug in i=n/2 on the he left side you get p^n, but when you expand the right side and at the end you do the exact same thing, but the problem is that the identity of (1/2)[(p+q)^n + (q-p)^n) doesnt show up at all??

9. Nov 25, 2009

### tiny-tim

Sorry, I'm not following you at all.

10. Nov 25, 2009

### koab1mjr

Hi Tiny Tim

I finally got it. I applied newton's bionomial expansion to prove the identity. Thank you so much for your help. IT help get me thinking in the right direction. You are the best.