Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I flip a coin three times, and then another three times. If the number of heads is the same the first and second time, I win. If the number of heads is different, then I win. If I win, you pay me one dollar. If you win, I give you 3 dollars. Is this game worth playing?

So I've figured out that for this game the $E[X] = 3p - (1-p)$ but I'm having a hard time coming up with $p$.

share|improve this question
3  
So you win both times? Certainly worth playing for you ;-) –  fgp Oct 16 '12 at 13:58
1  
You win regardless of whether the number of heads on the first, second and third tosses is the same or different as the number of tosses on the fourth, fifth, and sixth tosses. So the game is definitely worth playing for you, and not worth playing at all for me. If it is required for me as a matter of law to play, let's skip the coin tosses and I will give you a dollar. –  Dilip Sarwate Oct 16 '12 at 13:58
    
Can you explain that a bit more formally? I'm curious as to the actual expectation of the game. –  Emir Oct 16 '12 at 13:59
    
They're commenting on a typo in the text regarding who wins when. –  Arthur Oct 16 '12 at 14:03
add comment

2 Answers 2

Let's suppose player A wins if the two sets have the same number of heads and the coins are fair. The probability of this is $$\left(\frac{1}{8}\right)^2 + \left(\frac{3}{8}\right)^2+\left(\frac{3}{8}\right)^2+\left(\frac{1}{8}\right)^2 = \frac{5}{16}.$$

Suppose B wins if the two sets are different. The probability of this is $$1-\frac{5}{16}=\frac{11}{16}.$$

So if A gains 3 dollars when winning and loses 1 dollar when losing, then A's expected net gain is $$3 \times \frac{5}{16} -1 \times \frac{11}{16} = +\frac14$$ per game.

share|improve this answer
add comment

Well, the probabily of seeing the same number of heads twice is the probability that you get $0$ both times plus the probability that you get $1$ both times plus the probability that you get $2$ both times.

Now, to find the probability that you get $k$ heads if you flip a coin $n$ times, observe that the probability of seeing the specific sequence (head, tail, head) is $p_{head}(1-p_{head})p_{head}$ = $p_{head}^2(1-p_{head})^1$. In general, the probability of seeing a particular sequence with $k$ heads is $p_{head}^k(1-p_{head})^{n-k}$. To get the probabily of seeing $k$ heads, you thus have to multiply that with the number of sequences with $k$ heads. That is the same as the number of ways that you can pick $k$ elements from $n$, i.e. $\binom{n}{k}$ = $\frac{n!}{k!(n-k)!}$. You thus get that the probability of seeing $k$ heads if you flip a coin $n$ times is $$ \binom{n}{k}p_{head}^k(1-p_{head})^{n-k} $$

For the special case of a fair coin, i.e. $p_{head}=0.5$, you get $$ \binom{n}{k}\frac{1}{2^n} $$

Now, summing up the square of those probability for all possible numbers of heads gives you the probability that the same number of heads turns up twice in a row, i.e. you get $$ \sum_{k=0}^{n} \left(\binom{n}{k}\frac{1}{2^n}\right)^2 = \frac{1}{2^{2n}} \sum_{k=0}^{n} \binom{n}{k}^2 $$

Thus, for $n=3$ you get the probability $$ \frac{1^2 + 3^2 + 3^2 + 1^2}{2^6} = \frac{20}{64} = \frac{5}{16} $$ of seeing the same number of heads twice in two rows of 3 coin flips

share|improve this answer
    
you sure that's right? P<=1 should hold –  Emir Oct 16 '12 at 14:49
    
@Emir Duh, 'course not, I dropped the $^2$ of the denominator by accident. Fixed. –  fgp Oct 16 '12 at 14:54
    
@Emir And was apparently also unable to correctly compute $1^2+3^2+3^2+1^2$ - how I got $11$ there is beyond me. Fixed also. –  fgp Oct 16 '12 at 14:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.