High Stakes Coin Flipping

Xavier, Yvonne and Zac are playing a game with standard coins. Initially, Xavier has 50 coins, Yvonne has 30 coins and Zac has 22 coins. At each turn, they all simultaneously toss just one of their coins. If all the coins come up heads or all the coins come up tails, each player takes back his/her coin. However, if one of the coins shows a different symbol to the other 2, the tosser of that coin takes all 3 coins. The game ends when someone has 0 coins. What is the expected length (in number of turns) of this game?


The answer is 440.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Josh Rowley
Jan 28, 2014

At some point, let the number of coins that Xavier has be x , the number of coins that Yvonne has be y and the number of coins that Zac has be z . When someone has 0 coins, the product of the number of coins of the players will be 0. Therefore let's calculate the expected product at the beginning of the turn after ( x , y , z ) (x,y,z) . The probability that all are heads or all are tails is 1 4 \frac{1}{4} and the remaining 3 options are all equally likely, and thus each must also have probability of 1 4 \frac{1}{4} . Therefore the expected product, E, is: E = ( 1 4 ) ( x y z + ( x 1 ) ( y 1 ) ( z + 2 ) + ( x 1 ) ( y + 2 ) ( z 1 ) + ( x + 2 ) ( y 1 ) ( z 1 ) ) E = (\dfrac{1}{4})(xyz + (x-1)(y-1)(z+2) + (x-1)(y+2)(z-1) + (x+2)(y-1)(z-1)) Simplifying this whole thing we achieve: E = x y z + 1 4 ( 6 3 ( x + y + z ) ) E = xyz + \dfrac{1}{4}(6-3(x+y+z)) But we know that x + y + z = 102 x+y+z=102 irrespective of their product. Therefore E = x y z + 1 4 ( 6 306 ) E = xyz + \dfrac{1}{4}(6-306) so E = x y z 75 E = xyz - 75 . Therefore the expected change of the product is 75, irrespective of what the product is at any point in the game. Since the initial product is 33,000 and the product is expected to decrease by 75 every turn, it will take 33000 75 = 440 \dfrac{33000}{75} = \fbox{440} turns until we expect the product to first be zero and thus until we expect the game to end.

I was trying to approach this by first finding out the expected gain/loss per player per turn. It turned out to be: 0 with a probability of 1/4, +2 with a probability of 1/4 and -1 with a probability of 1/2. In total that gives an expected gain/loss of 0 per turn. From there I thought that the game will go on infinitely (expected value). Again, I realize it is not possible for this value to be either positive or negative, since all can't at the same time gain or lose. I am having trouble to intuitively reconcile this with the fact that the game as an expected end. Can someone please help me understand?

Anindya Bhattacharjee - 7 years, 4 months ago

Log in to reply

Your problem is: the game can continue forever. But the probability drops to zero by 'leakage' to finishes after some time.

Now, an infinite sequence can both result in an infinite sum, or result in a finite sum. E.g. 1 + 1 2 + 1 3 + . . . 1+\frac 1 2 +\frac 1 3 + ... is unbound (goes to infinity), while 1 + 1 2 + 1 4 + 1 8 + . . . 1+\frac 1 2 +\frac 1 4 +\frac 1 8 + ... approaches 2.

Therefore, the endless series can either converge to a finite sum, or diverge to infinity. It depends on the 'speed' at which the terms go to zero. In case of this game, the speed is high enough to have a finite sum.

Ron van den Burg - 7 years, 4 months ago

I'm not certain but I think your problem there is that in effect you're trying to work out the expected change in the sum of the coins, but the sum is constant so you are correctly getting that the expected change is 0

Josh Rowley - 7 years, 4 months ago

Log in to reply

I too followed the same approach as Anindya and concluded that the game is going to go on forever. @Josh whats the theory behind the approach that you have taken.

Owais Siddiqui - 7 years, 4 months ago

Log in to reply

@Owais Siddiqui I don't quite understand your question? The theory is the solution itself?

Josh Rowley - 7 years, 4 months ago

Log in to reply

@Josh Rowley Thanks Josh. Understood. Somehow I was not able to get it earlier.

Owais Siddiqui - 7 years, 4 months ago

I think this makes sense. Thanks!

Anindya Bhattacharjee - 7 years, 4 months ago

You may want to see the gambler's ruin problem for different perspective to see this problem because this problem is the gambler's ruin problem.

Tunk-Fey Ariawan - 7 years, 2 months ago

Thank you, Josh! A very nice problem and very nice formulas! However, I do not agree with your interpretation. It seems like the only thing that you actually proved was that if the game lasts 440 turns and the players are allowed to get into debt, then the expected value of the product will be zero. This is really not what you want.

However, the same formulas can be simply given a different interpretation. Instead of looking for the expected length of the game for one particular triple ( x , y , z ) (x,y,z) , we look for it as a function of F ( x , y , z ) , F(x,y,z), for all non-negative ( x , y , z ) (x,y,z) with the sum of 102. 102. Note that the expected length of the game is finite, because at every moment there is a constant positive probability that during the next 100 moves Xavier wins. This expected length of game function must satisfy the following properties:

1) If x , x, y , y, or z z is 0 , 0, then F ( x , y , z ) = 0 F(x,y,z)=0

2) If all x , x, y , y, z z are positive, then F ( x , y , z ) = 1 + 1 4 F ( x , y , z ) + 1 4 F ( x + 2 , y 1 , z 1 ) + 1 4 F ( x 1 , y + 2 , z 1 ) + 1 4 F ( x 1 , y 1 , z + 2 ) F(x,y,z)=1+\frac{1}{4}F(x,y,z)+\frac{1}{4}F(x+2,y-1,z-1)+\frac{1}{4}F(x-1,y+2,z-1)+\frac{1}{4}F(x-1,y-1,z+2)

Now the same calculation as in the original proof justifies that F ( x , y , z ) = x y z 75 F(x,y,z)=\frac{xyz}{75} satisfies both conditions. Note that F ( x , y , z ) F(x,y,z) is determined by these conditions uniquely: if F 1 ( x , y , z ) F_1(x,y,z) and F 2 ( x , y , z ) F_2(x,y,z) both satisfy them, we can consider their difference, G ( x , y , z ) = F 1 ( x , y , z ) F 2 ( x , y , z ) . G(x,y,z)=F_1(x,y,z)-F_2(x,y,z). Consider the point ( x , y , z ) (x,y,z) , where G G has absolute maximum. Then one can check that at all of its "neighbors" (in the sense of the game) the value of G G is the same. Doing the same argument for the neighbors, we can get to the boundary, so the the absolute maximum of G G is 0 0 . Similarly, the absolute minimum is 0 , 0, so G G is identically zero.

So the expectation of the length of the game is x y z 75 , \frac{xyz}{75}, as claimed.

Alexander Borisov - 7 years, 4 months ago

Well, it is an interesting approach which I will have to think about. I actually came up with the same reasoning as Anindya: the expected gain per turn is 0, so the game should in theory go on infinitely.

Claus-Dieter Volko - 7 years, 4 months ago

Log in to reply

I answered this already above, but you can also do the following little computation. Simplify the game by having 6 coins: 3 coins each. Also skip the unsuccessful tosses (you can repair this by multiplying with 8/6).

Denote the expected length with E ( i ; j ; k ) E(i;j;k) .

What follows:

E ( 3 ; 3 ; 3 ) = 1 + 1 3 E ( 5 ; 2 ; 2 ) + 1 3 E ( 2 ; 5 ; 2 ) + 1 3 E ( 2 ; 2 ; 5 ) = 1 + E ( 5 ; 2 ; 2 ) E(3;3;3) = 1 + \frac 1 3 E(5;2;2) + \frac 1 3 E(2;5;2) + \frac 1 3 E(2;2;5) = 1 + E(5;2;2) where I used the fact that the expected number of tosses is symmetrical in i , j i, j and k k .

E ( 5 ; 2 ; 2 ) = 1 + 1 3 E ( 7 ; 1 ; 1 ) + 2 1 3 E ( 4 ; 4 ; 1 ) E(5;2;2)=1+\frac 1 3 E(7;1;1) + 2 \frac 1 3 E(4;4;1)

E ( 7 ; 1 ; 1 ) = 1 E(7;1;1)=1 since each possible toss will end the game

E ( 4 ; 4 ; 1 ) = 1 + 1 3 E ( 3 ; 3 ; 3 ) E(4;4;1)=1+\frac 1 3 E(3;3;3) since the only way to continue the game is if the player with 1 coin left wins. Here we have the circular computation and the endless loop starts.

But combining this, you will get:

E ( 5 ; 2 ; 2 ) = 1 + 1 3 . 1 + 2 1 3 ( 1 + 1 3 E ( 3 ; 3 ; 3 ) ) E(5;2;2)=1+\frac 1 3 . 1 + 2 \frac 1 3 (1 + \frac 1 3 E(3;3;3))

= 1 + 1 + 2 9 E ( 3 ; 3 ; 3 ) =1+1+ \frac 2 9 E(3;3;3)

and finally:

E ( 3 ; 3 ; 3 ) = 1 + E ( 5 ; 2 ; 2 ) = 3 + 2 9 E ( 3 ; 3 ; 3 ) E(3;3;3) = 1 + E(5;2;2) = 3 + \frac 2 9 E(3;3;3)

From this, you can easily compute E ( 3 ; 3 ; 3 ) = 3 7 9 = 27 7 E(3;3;3) = \frac 3 {\frac 7 9 } = \frac {27} 7 .

Ron van den Burg - 7 years, 4 months ago

To make this approach rigorous, we need the machinery of Optional Stopping Theorem . See the solution that I posted.

Abhishek Sinha - 7 years, 4 months ago

Log in to reply

Or you can use Standard Markov chain methods.

Tunk-Fey Ariawan - 7 years, 2 months ago

This is a great problem and a very informative solution!

Narahari Bharadwaj - 6 years, 12 months ago
Abhishek Sinha
Feb 3, 2014

Assume the random variables X n , Y n , Z n X_n,Y_n,Z_n denote their respective number of coins after n n plays. We have the invariant X n + Y n + Z n = 50 + 30 + 22 = 306 X_n+Y_n+Z_n=50+30+22=306 , valid for all n 1 n\geq 1 .

Define a new sequence of random variables ζ n = X n Y n Z n + 75 n \zeta_n=X_nY_nZ_n + 75n , n 1 n\geq 1 . Now we'll show that { ζ n } n 1 \{\zeta_n\}_{n\geq 1} is a Martingale sequence , w.r.t. the natural filtration F n = σ ( X 1 , X 2 , X n ; Y 1 , Y 2 , Y n ; Z 1 , Z 2 , Z n ) , n 1 \mathcal{F}_n = \sigma ( X_1,X_2,\ldots X_n; Y_1,Y_2, \ldots Y_n; Z_1,Z_2,\ldots Z_n), n\geq 1

Since X n , Y n , Z n X_n, Y_n, Z_n are non-negative w.p. 1, A.M.-G.M inequality tells us that X n Y n Z n ( 102 ) 3 X_n Y_n Z_n \leq (102)^3 w.p. 1. Hence, E ζ n < \mathbb{E}\zeta_n < \infty , n 1 ,\forall n \geq 1 .

Also, E ( ζ n + 1 F n ) = E ( X n + 1 Y n + 1 Z n + 1 + 75 ( n + 1 ) F n ) \mathbb{E}(\zeta_{n+1}| \mathcal{F}_n) = \mathbb{E} (X_{n+1}Y_{n+1}Z_{n+1} + 75(n+1) | \mathcal{F}_n) = 1 4 ( X n Y n Z n + ( X n + 2 ) ( Y n 1 ) ( Z n 1 ) + ( X n 1 ) ( Y n + 2 ) ( Z n 1 ) = \frac{1}{4} (X_nY_nZ_n + (X_n+2)(Y_n-1)(Z_n-1) + (X_n-1)(Y_n+2)(Z_n-1) + ( X n 1 ) ( Y n 1 ) ( Z n + 2 ) ) + (X_n-1)(Y_n-1)(Z_n+2))

= 1 4 ( 4 X n Y n Z n 3 ( X n + Y n + Z n ) + 6 ) = \frac{1}{4} (4X_nY_nZ_n -3(X_n+Y_n+Z_n)+6) = X n Y n Z n + 75 n = ζ n = X_nY_nZ_n + 75n = \zeta_n

The above steps show that indeed { ζ n } n 1 \{\zeta_n\}_{n\geq 1} is a Martingale sequence.

Let T T be the random time denoting the length of this game. Now, it is easy to see that T T is a stopping time w.r.t. the filtration F n \mathcal{F}_n defined above.

Finally we can use the Optional Stopping Theorem (assuming finite expectation for T T , the condition (b) is satisfied here) to conclude that E ( ζ T ) = E ( ζ 0 ) = X 0 Y 0 Z 0 = 50 × 30 × 22 \mathbb{E}(\zeta_T) = \mathbb{E}(\zeta_0) = X_0Y_0Z_0 = 50\times 30 \times 22

However, we know that at time T T at least one of X T , Y T , Z T X_T, Y_T, Z_T is zero. Hence, E ( ζ T ) = 0 + 75 E ( T ) \mathbb{E}(\zeta_T)=0+75 \mathbb{E}(T) . Hence, we get

E ( T ) = 50 × 30 × 22 75 = 440 \mathbb{E}(T) = \frac{50\times 30 \times 22}{75}= 440

well i tried it too by probability but my calculations put me back for an infinite number of games....so i just wasted my answers to get to know written answer.....its not very helping either

someone would care to help?????

zain aabdin - 7 years, 3 months ago

Log in to reply

See my solution below, maybe could give you a different viewpoint and a new perspective to understand this problem.

Tunk-Fey Ariawan - 7 years, 2 months ago

Yay to Martingale theory! It's such a beautiful topic.

Calvin Lin Staff - 7 years, 3 months ago
Ron van den Burg
Feb 3, 2014

First observe that there is 6 / 8 6/8 chance of progress and a 2 / 8 2/8 chance of no-progress (triple head or triple tail). WLOG, reduce the problem to look at the successful tosses only and then correct the answer by multiplying with 8 / 6 8/6 .

Let E ( i ; j ; k ) E(i;j;k) denote the expected number of tosses, starting with respectively i , j , i, j, and k k coins, where i , j , k i,j,k denote non-negative integers and i + j + k > 2 i+j+k>2 .

Theorem E ( i ; j ; k ) = i . j . k i + j + k 2 E(i;j;k)=\frac{i.j.k}{i+j+k-2}

Proof

If a player has zero coins, the game is finished and the expected number of (successful) tosses equals 0 0 : E ( i ; j ; 0 ) = i . j . 0 i + j 2 = 0 E(i;j;0)=\frac{i.j.0}{i+j-2}=0

and similar for i = 0 i=0 or j = 0 j=0 .

If two of the players are left with a single coin, there will remain exactly one successful toss with probability 1 1 . This is in accordance with the suggested formula: E ( i ; 1 ; 1 ) = i . 1.1 i + 1 + 1 2 = 1 ; E(i;1;1)=\frac{i.1.1}{i+1+1-2}=1;

E ( 1 ; j ; 1 ) = 1. j . 1 1 + j + 1 2 = 1 ; E(1;j;1)=\frac{1.j.1}{1+j+1-2}=1;

E ( 1 ; 1 ; k ) = 1.1. k 1 + 1 + k 2 = 1 E(1;1;k)=\frac{1.1.k}{1+1+k-2}=1

For all other combinations of coins: E ( i ; j ; k ) = E(i;j;k) =

= 1 + E ( i + 2 ; j 1 ; k 1 ) + E ( i 1 ; j + 2 ; k 1 ) + E ( i 1 ; j 1 ; k + 2 ) 3 =1+\frac{E(i+2;j-1;k-1)+E(i-1;j+2;k-1)+E(i-1;j-1;k+2)}{3}

= 1 + ( i + 2 ) ( j 1 ) ( k 1 ) + ( i 1 ) ( j + 2 ) ( k 1 ) + ( i 1 ) ( j 1 ) ( k + 2 ) 3 ( i + j + k 2 ) = 1+\frac{(i+2)(j-1)(k-1)+(i-1)(j+2)(k-1)+(i-1)(j-1)(k+2)}{3(i+j+k-2)}

= 1 + i j k i j i k + 2 j k + i 2 j 2 k + 2 + i j k i j + 2 i k j k 2 i + j 2 k + 2 + i j k + 2 i j i k j k 2 i 2 j + k + 2 3 ( i + j + k 2 ) = 1+\frac{ijk-ij-ik+2jk+i-2j-2k+2+ijk-ij+2ik-jk-2i+j-2k+2+ijk+2ij-ik-jk-2i-2j+k+2}{3(i+j+k-2)}

= 1 + 3 i j k 3 i 3 j 3 k + 6 3 ( i + j + k 2 ) =1+\frac{3ijk-3i-3j-3k+6}{3(i+j+k-2)}

= 1 + i j k i + j + k 2 1 = i j k i + j + k 2 =1+\frac{ijk}{i+j+k-2}-1=\frac{ijk}{i+j+k-2}

So, all the possible situations and their 3 possible sequels after a (successful) toss are in accordance with the formula.

Therefore, E ( 50 ; 30 ; 22 ) = 50 30 22 50 + 30 + 22 2 = 5 3 22 = 330 E(50;30;22)=\frac{50*30*22}{50+30+22-2}=5*3*22=330 . The solution of this problem is, as described in the first alinea, 8 6 330 = 440 \frac{8}{6}*330=440 .

Tunk-Fey Ariawan
Mar 22, 2014

This problem is basically a gambler's ruin problem. I've spent a day to learn this topic in my college library and solve this problem by using standard Markov chain methods. Since that method seems sophisticated, I wouldn't explain it here. Actually, there is already a solution of gambler's ruin for 3 3 players. Let a a , b b , and c c be the initial capitals, then the expected of the game duration T 1 T_1 if each player has probability of win 1 3 \dfrac{1}{3} (without draw system) is E [ T 1 ] = a b c a + b + c 2 . \text{E}[T_1]=\frac{abc}{a+b+c-2}. If the draw system is also included, then each player has probability of win 1 4 \dfrac{1}{4} . Let us turn attention to the symmetric 3 3 -player game: ( a , b , c ) { ( a , b , c ) if the game is draw with probability 1 4 , ( a + 2 , b 1 , c 1 ) if player 1 wins with probability 1 4 , ( a 1 , b + 2 , c 1 ) if player 2 wins with probability 1 4 , ( a 1 , b 1 , c + 2 ) if player 3 wins with probability 1 4 . (a,b,c) \mapsto \left\{ \begin{array}{l l} (a,b,c) & \quad \text{if the game is draw with probability}\frac{1}{4},\\ (a+2,b-1,c-1)& \quad \text{if player 1 wins with probability}\frac{1}{4},\\ (a-1,b+2,c-1)& \quad \text{if player 2 wins with probability}\frac{1}{4},\\ (a-1,b-1,c+2)& \quad \text{if player 3 wins with probability}\frac{1}{4}.\\ \end{array} \right. Or you can see the total possible outcomes if we throw 3 3 coins: HHH,TTT, HTT, THH, HTH, THT, HHT, TTH \text{{HHH,TTT, HTT, THH, HTH, THT, HHT, TTH}} The probability of draw is 2 8 \frac{2}{8} , HHH \text{HHH} and TTT \text{TTT} , and the probability of each player wins is 2 8 \frac{2}{8} , HTT, THH \text{HTT, THH} or HTH, THT \text{HTH, THT} or HHT, TTH \text{HHT, TTH} . The expected number of rounds until one of the gamblers is ruined or goes broke for the symmetric 3 3 -player is simply E [ T 2 ] = 4 3 ( a b c a + b + c 2 ) . \text{E}[T_2]=\frac{4}{3}\left(\frac{abc}{a+b+c-2}\right). The formula above can be seen as this simple inversely proportion: if the symmetric 3 3 -player game where each player has chance to win the game 1 3 \dfrac{1}{3} its expected of the game duration is E [ T 1 ] \text{E}[T_1] , then for the symmetric 3 3 -player game where each player has chance to win the game 1 4 \dfrac{1}{4} its expected of the game duration is E [ T 2 ] \text{E}[T_2] , therefore 1 3 E [ T 1 ] = 1 4 E [ T 2 ] . \dfrac{1}{3}\cdot\text{E}[T_1]=\dfrac{1}{4}\cdot\text{E}[T_2]. Logically, when the draw system is included, the game duration tends to be longer than without using draw system. Thus, based on the formula above, the expected of the game duration is E [ T ] = 4 3 ( 50 30 22 50 + 30 + 22 2 ) = 440 . \text{E}[T]=\frac{4}{3}\left(\frac{50\cdot30\cdot22}{50+30+22-2}\right)=\boxed{440}. For advance study and to understand more comprehensive this problem, I really recommend you to read a very nice article "A game with three players" by D. Sandell, 1988 and also see 3 3 -tower problem (or Hanoi tower problem ). Anyway, you can try the gambler's ruin simulation for 2 2 players with this Wolfram Demonstrations Project . Have fun!

The Gambler's Ruin Simulation The Gambler's Ruin Simulation


# Q . E . D . # \text{\# }\mathbb{Q.E.D.}\text{ \#}

In a move there are 8 possibilities in 2 of which there is no change(all heads or all tails), and 2 cases each where one of the 3 picks up 3 coins. 1/4 probability of no change, 1/4 for X picking 3, 1/4 for Y picking 3, 1/4 for Z picking 3. if initially they have i,j,k coins, after n moves X has 1/4 probability of having i, 1/2 probability of having (i-n), 1/2 probability of having (i+2n) Expectation value of i after n moves is 1/4 i + 1/2 (i-1)+1/4 (i+2) = i....no change ! same for j and k. They appear to be expected not to change at all. But the product ijk is expected to change. after n moves expected ijk = 1/4 (ijk) + 1/4 (i-n)(j-n)(k+2n) + 1/4 (i-n)(j+2n)(k-n) + 1/4 (i+2n)(j-n)(k-n) = ijk + 1/4 (6n - 3n(i+j+k))=ijk + n/4(6-306)=ijk-75n if the expectation value is zero, ijk-75n = 0 Initial ijk = 33000. so n= 440

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...