Yet Another Unfair Game

You were invited to play a game. The game is played with a 6-sided fair dice.
You choose two different numbers from the dice, and then the dice is rolled.

If the result is one of the numbers you chose, you win a dollar, otherwise,​ you lose one dollar.

You knew it is an unfair game, but you wanted to try your luck, so you decided to play with two dollars. You ended up losing your two dollars, but the game owner decided to lend you as much money as you want to spend in the game. You decided to play until you recover your two dollars, and without owing anything to the owner.

Let P P be the probability that you achieve your goal, find 1 0 10 e P + 0.5 \left\lfloor {10^{10} e^P + 0.5} \right\rfloor .


The answer is 12840254167.

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.

2 solutions

Mark Hennings
Jun 20, 2016

Relevant wiki: Conditional Probability - Problem Solving

Let p n p_n be the probability of breaking even, given that your current indebtedness is $ n n . The friendly game owner allows you have indebtedness of arbitrarily large n n . Then p 0 = 1 p_0 = 1 and p n = 1 3 p n 1 + 2 3 p n + 1 n 1 . p_n \; = \; \tfrac13p_{n-1} + \tfrac23p_{n+1} \qquad \qquad n \ge 1\;. Solving this recurrence relation by trying p n = λ n p_n = \lambda^n we see that we need 2 λ 2 3 λ + 1 = 0 2\lambda^2 - 3\lambda + 1 = 0 , so that λ = 1 2 , 1 \lambda = \tfrac12,1 . Thus p n = A + B 2 n p_n \; = \; A + B2^{-n} where p 0 = A + B = 1 p_0 = A + B = 1 . Where to go from here is not totally obvious. It may seem reasonable to assume that p n p_n must tend to 0 0 as n n \to \infty , giving the (correct) answer p n = 2 n p_n = 2^{-n} , but let us actually prove this.

For any N 1 N \ge 1 , let p n , N p_{n,N} be the probability of breaking even, given that your initial indebtedness is $ n n , and you are never more than $ N N in debt. Then it is clear that p n , N = 1 3 p n 1 , N + 2 3 p n + 1 , N 1 n N p_{n,N} \; =\; \tfrac13p_{n-1,N} + \tfrac23p_{n+1,N} \qquad \qquad 1 \le n \le N while p 0 , N = 1 p_{0,N} = 1 and p N + 1 , N = 0 p_{N+1,N} = 0 . We can solve this recurrence relation exactly, obtaining p n , N = 2 N + 1 2 n 2 n ( 2 N + 1 1 ) 0 n N + 1 p_{n,N} \; =\; \frac{2^{N+1} - 2^n}{2^n(2^{N+1} - 1)} \qquad \qquad 0 \le n \le N+1 Now p n = P [ C l e a r d e b t s I n i t i a l d e b t i s $ n ] = N = n P [ C l e a r d e b t s w h i l e a c c r u i n g a m a x i m u m d e b t o f $ N I n i t i a l d e b t i s $ n ] = N = n ( P [ C l e a r d e b t s w h i l e a c c r u i n g a m a x i m u m d e b t o f a t m o s t $ N I n i t i a l d e b t i s $ n ] P [ C l e a r d e b t s w h i l e a c c r u i n g a m a x i m u m d e b t o f a t m o s t $ ( N 1 ) I n i t i a l d e b t i s $ n ] ) = N = n ( p n , N p n , N 1 ) = lim N ( p n , N p n . n 1 ) = 2 n \begin{array}{rcl} p_n & = & \displaystyle \mathbb{P}\big[\mathrm{Clear\, debts}\,\big|\,\mathrm{Initial\, debt\, is\, \$}n\big] \\ & =& \displaystyle \sum_{N=n}^\infty \mathbb{P}\big[\mathrm{Clear\,debts\, while\, accruing\, a\, maximum\, debt\, of\, \$}N\,\big|\,\mathrm{Initial\, debt\,is\, \$}n\big] \\ & = & \displaystyle \sum_{N=n}^\infty \left(\begin{array}{l}\mathbb{P}\big[\mathrm{Clear\, debts\, while\, accruing\, a\, maximum\, debt\, of\, at\, most\, \$}N\,\big|\,\mathrm{Initial\, debt\, is\, \$}n\big] \\ - \mathbb{P}\big[\mathrm{Clear\, debts\, while\, accruing\, a\, maximum\, debt\, of\, at\, most\, \$}(N-1)\,\big|\,\mathrm{Initial\, debt\, is\, \$}n\big]\end{array} \right) \\ & = & \displaystyle \sum_{N=n}^\infty \big(p_{n,N} - p_{n,N-1}\big) \; = \; \lim_{N \to \infty}\big(p_{n,N} - p_{n.n-1}\big) \\ & = & \displaystyle 2^{-n} \end{array} The probability we want is P = p 2 = 1 4 P = p_2 = \tfrac14 , and 1 0 10 e P + 0.5 = 12840254167 \big\lfloor 10^{10}e^P + 0.5\big\rfloor \,=\, \boxed{12840254167} .

'Probability of breaking even'....What does that mean ?

Vishal Yadav - 4 years, 3 months ago

Log in to reply

How did you solve that recurrence ? I'm new to conditional and it seems a bit tricky.

Vishal Yadav - 4 years, 3 months ago

Log in to reply

"Breaking even" means "recovering your losses".

The recurrence relation p n , N = 1 3 p n 1 , N + 2 3 p n + 1 , N 1 n N p_{n,N} \; = \; \tfrac13p_{n-1,N} + \tfrac23p_{n+1,N} \hspace{2cm} 1 \le n \le N with the conditions p 0 , N = 1 p_{0,N} = 1 and p N + 1 , N = 0 p_{N+1,N} = 0 is solved in just the same way as I solved the less detailed one. We look for a solution of the form p n , N = A N + B N 2 n 0 n N + 1 p_{n,N} \; = \; A_N + B_N2^{-n} \hspace{2cm} 0 \le n \le N+1 and choose the constants A N , B N A_N,B_N so that p 0 , N = 1 p_{0,N} = 1 and p N + 1 , N = 0 p_{N+1,N} = 0 .

Mark Hennings - 4 years, 3 months ago

Sorry, I am new to recursion and can't easily set up these equations,can you please explain how you formed this equation. My reasoning was : We can "Reset" our probability to P(n) by either losing $1 when our debt if $1 less than n or by gaining a dollar if our debt is $1 more than n . So P(n)= (2/3)P(n-1) + (1/3)P(n+1)

saket goyal - 10 months, 1 week ago

Probability p {n, N} can also be solved by martingale. Suppose i is the balance we have, then 2^i is a martingale. p {n, N} can be solved by optional stopping theorem. But we need to notice that the martingale only holds for N > n. Thus, p {n, n} needs to be solved separately. Summing all p {n, N} - p {n, N - 1} for N from n + 1 to infinity similar to the solution, then add back p {n, n} will solve the problem.

Jassy Kal - 4 months, 3 weeks ago
Daniel Turizo
Jun 18, 2016

In every round, the probability of earning one dollar is 2 6 = 1 3 \frac{2}{6} = \frac{1}{3} , and the probability of losing one dollar is 4 6 = 2 3 \frac{4}{6} = \frac{2}{3} . As you arleady lost 2 2 dollars, your profit is 2 -2 dollars. You want to recover your money, that is, you want a profit of 0 0 dollars. As the owner accepted to lend you as much money as you want, your profit can be arbitrarily low, and the game can go on indefinitely. This fact is unchanged by your actual profit, and for this reason, the probability P 1 P_1 of increasing your actual profit by 1 1 dollar is independent of your actual profit. Suppose your actual profit is p p dollars, and you want to achieve a profit of p + 1 p+1 dollars. There are two ways for this to happen: either you win the first round, or you lose the first round and then you increase your profit by 1 1 dollar twice. Therefore, P 1 P_1 can be defined recursively as: P 1 = 1 3 + 2 3 P 1 P 1 0 = 2 P 1 2 3 P 1 + 1 0 = ( 2 P 1 1 ) ( P 1 1 ) P 1 = 1 P 1 = 1 2 P_1 = \frac{1}{3} + \frac{2}{3}P_1 P_1 \\ 0 = 2P_1 ^2 - 3P_1 + 1 \\ 0 = \left( {2P_1 - 1} \right)\left( {P_1 - 1} \right) \\ P_1 = 1 \vee P_1 = \frac{1}{2} It can be proved by contradiction that P 1 = 1 P_1 = 1 is not a valid solution. Let Q Q be the probability of losing in the first round and then recovering your initial profit. Q Q can be expressed as: Q = 2 3 P 1 Q = \frac{2}{3}P_1 Notice that all the ways of losing in the first round and then recovering your initial profit are also ways of NOT increasing your initial profit by 1 1 dollar, whose probability is 1 P 1 1-P_1 . Therefore, the event with probability Q Q is a sub-event of the event with probability 1 P 1 1-P_1 , and thus: Q 1 P 1 Q \le 1 - P_1 Let P 1 = 1 P_1 = 1 , then Q = 2 3 Q = \frac{2}{3} and 2 3 0 \frac{2}{3} \le 0 . This is a contradiction, so our initial assumption P 1 = 1 P_1 = 1 is false. Finally, the only solution left for P 1 P_1 is: P 1 = 1 2 P_1 = \frac{1}{2} Your initial profit is 2 -2 dollars, and you want a profit of 0 0 dollars. That is equivalent to raising your profit by 1 1 dollar twice, and thus the probability of achieving your goal is P = P 1 2 = 1 4 P = P_1 ^2 = \frac{1}{4} . Then the final answer is: 1 0 10 e P + 0.5 = 1 0 10 e 1 4 + 0.5 12840254167 . 377414 = 12840254167 \left\lfloor {10^{10} e^P + 0.5} \right\rfloor = \left\lfloor {10^{10} e^{\frac{1}{4}} + 0.5} \right\rfloor \approx \left\lfloor {{\rm 12840254167}{\rm .377414}} \right\rfloor = \boxed{12840254167} Another way of solving this problem is by directly calculating the probability Q Q defined above. Remember that Q Q is the probability of losing in the first round and then recovering your initial profit. Suppose 1 1 represents a winning round and 1 -1 a losing round. Then a set of rounds can be expressed as a sequence of 1 1 's and 1 -1 's. Let S S be the set of all the set of rounds in which you lose the first round and in the end you recover your initial profit. An element of S S must be of the form ( 1 , , 1 ) \left( { - 1, \ldots ,1} \right) , whose sum of numbers must be zero (because in the end you recover your initial profit), so each element must have a even amount of numbers in the sequence. For a sequence in S S , the subsequence of each element formed with the second to the penultimate number is equivalent to a Dyck word of length 2 n 2n , because you only reach your initial profit in the last round. For this reason, the number of sequences of length 2 n + 2 2n+2 in S S is equal to the number of Dyck words of length 2 n 2n . Notice that the probability of a sequence in S S of length 2 n + 2 2n+2 happening is ( 2 3 ) n + 1 ( 1 3 ) n + 1 = ( 2 9 ) n + 1 \left( {\frac{2}{3}} \right)^{n + 1} \left( {\frac{1}{3}} \right)^{n + 1} = \left( {\frac{2}{9}} \right)^{n + 1} because the number of losing rounds is the same as the number of winning rounds. Finally, Q Q can be calculated as: Q = n = 0 ( n u m b e r o f D y c k w o r d s o f l e n g t h 2 n ) ( 2 9 ) n + 1 Q = \sum\limits_{n = 0}^\infty {\left( {number~of~Dyck~words~of~length~2n} \right)\left( {\frac{2}{9}} \right)^{n + 1} } The number of Dyck words of length 2 n 2n corresponds to the Catalan number n n , C n C_n . Now Q Q can be expressed as: Q = 2 9 n = 0 C n ( 2 9 ) n Q = \frac{2}{9}\sum\limits_{n = 0}^\infty {C_n \left( {\frac{2}{9}} \right)^n } The generating function for the Catalan numbers is c ( x ) = n = 0 C n x n c\left( x \right) = \sum\limits_{n = 0}^\infty {C_n x^n } which converges to 1 1 4 x 2 x \frac{{1 - \sqrt {1 - 4x} }}{{2x}} for x < 1 4 \left| x \right| < \frac{1}{4} , as proven here . Therefore, Q Q can be calculated as: Q = 2 9 c ( 2 9 ) = 1 3 Q = \frac{2}{9}c\left( {\frac{2}{9}} \right) = \frac{1}{3} Remember that, as explained in the first solution, Q = 2 3 P 1 Q = \frac{2}{3}P_1 , where P 1 P_1 is the probability of increasing your initial profit by 1 1 dollar. Then P 1 = 1 2 P_1=\frac{1}{2} and: P = P 1 2 = 1 4 P = P_1 ^2 = \frac{1}{4} The rest of the problem follows.

Discarding P 1 = 1 P_1 = 1 may be intuitively obvious, but not simple mathematically. It needs justification.

Mark Hennings - 4 years, 12 months ago

Log in to reply

I agree with you. I have added a proof of why P 1 = 1 P_1=1 cannot be a solution, and a second solution to the problem. Thanks for the observation.

Daniel Turizo - 4 years, 11 months ago

Order matters, since it can make some outcomes more likely than others! If you toss two fair coins, then the probability of throwing exactly one head is 2 × 1 2 × 1 2 = 1 2 2 \times \tfrac12\times\tfrac12 = \tfrac12 . The 2 2 at the front reflects the fact that you can throw either H T HT or T H TH , so you can throw exactly one head in two different ways.

Since you want to lose n n times and win n + 2 n+2 times (with one win right at the end), this can happen in ( 2 n + 1 n ) \binom{2n+1}{n} ways, the number of ways of arranging n n losses amongst n + 1 n+1 wins (followed by a final win).

This sum, while possible to determine, is not easy to evaluate. That is why either of the solution methods presented here are preferable.

Mark Hennings - 4 years, 11 months ago

can someone please explain what I did wrong. I took the summation of (2/3)^n(1/3)^(n+2) from zero to infinite and i got the wrong value for P. Thank you for your help!

Ashish Sacheti - 4 years, 11 months ago

If you win n + 2 n+2 times and lose n n times (winning on the last go), in how many ways can that happen? Answer: ( 2 n + 1 n ) \binom{2n+1}{n} ways. You need to multiply your ( 2 3 ) n ( 1 3 ) n + 2 (\tfrac23)^n(\tfrac13)^{n+2} term by this Binomial coefficient before adding...

Mark Hennings - 4 years, 11 months ago

Log in to reply

hi thank you so much for replying! I have a few questions. 1. Why do we need to figure out the number of ways it can happen I didn't think order mattered 2. How did you get the numbers 2n+1 choose n and how do you calculate that since n=infinite. Thank you!!!

Ashish Sacheti - 4 years, 11 months ago

I am not sure what this problem has to do with being a conditional probability question and I think the answer should be 1. It is a gambler's ruin problem and the answer is always the party with the infinite bank wins with probability 1.

Amir Yousefi - 2 years ago

Log in to reply

It is not a symmetric ( p = 1 2 p=\tfrac12 ) problem, and so it is not a gambler’s ruin problem.

Mark Hennings - 2 years ago

Noticing P1 is independent of initial starting point and solve for it is brilliant!

Jassy Kal - 4 months, 3 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...