From charlesreid1

m (Admin moved page FMM15 to FMM16)
(8 intermediate revisions by the same user not shown)
Line 10: Line 10:
  
 
How much should Petra von Player pay Paul de Bank for the privilege of playing the game?
 
How much should Petra von Player pay Paul de Bank for the privilege of playing the game?
 +
 +
  
 
If the game can go on forever, the expected winnings are
 
If the game can go on forever, the expected winnings are
Line 20: Line 22:
  
 
If Petra is to make money off the game, she should be willing to pay a quantity less than the expected payoff to play the game. But if the expected payoff is infinite, Petra should be willing to pay an infinite amount of money to play the game - hence the paradox.
 
If Petra is to make money off the game, she should be willing to pay a quantity less than the expected payoff to play the game. But if the expected payoff is infinite, Petra should be willing to pay an infinite amount of money to play the game - hence the paradox.
 +
 +
  
 
The Petersburg Paradox is resolved by recognizing that Petra von Player and Paul de Bank have finite resources, and money is not "infinite" the way that numbers are infinite, so ultimately the game must be limited by de Bank's total amount of money and von Player's capacity to procure (or borrow) money to keep playing.
 
The Petersburg Paradox is resolved by recognizing that Petra von Player and Paul de Bank have finite resources, and money is not "infinite" the way that numbers are infinite, so ultimately the game must be limited by de Bank's total amount of money and von Player's capacity to procure (or borrow) money to keep playing.
Line 37: Line 41:
 
|solution=
 
|solution=
  
---
+
'''Part A - number of coin tosses for von Player to clear out de Bank?'''
Part a - number of coin tosses for von Player to clear out de Bank?
 
  
Probability Paul de Bank will get cleared out:
+
We can find the number of times we have to double 1 to reach Paul de Bank's billion dollar fortune:
  
 +
<pre>
 
>>> np.log2(1e12)
 
>>> np.log2(1e12)
 
39.86
 
39.86
Line 47: Line 51:
 
>>> np.power(2,39)
 
>>> np.power(2,39)
 
549,755,813,888
 
549,755,813,888
 +
</pre>
  
If Petra von Player wins 39 times in a row it would leave de Bank with a measely
+
But remember that bets start at 1, or <math>2^0</math>, so <math>2^{39}</math> takes 40 wins to reach.
  
>>> 1e12 - np.power(2,39)
+
If Petra von Player wins 40 times in a row it would leave de Bank with a measely
 +
 
 +
<pre>
 +
>>> 1e12 - np.power(2,40-1)
 
450,244,186,112
 
450,244,186,112
 +
</pre>
  
half a trillion dollars to live on. If Petra von Player wins 40 times in a row, it leaves de Bank underwater
+
half a trillion dollars left to live on. If Petra von Player wins 41 times in a row, it leaves de Bank underwater
  
>>> 1e12 - np.power(2,40)
+
<pre>
 +
>>> 1e12 - np.power(2,41-1)
 
-99,511,627,776
 
-99,511,627,776
 +
</pre>
  
 
and de Bank ends up with 99 billion dollars of debt.
 
and de Bank ends up with 99 billion dollars of debt.
  
  
Alternative way to think about it:
 
  
2^10 ~ 10^3
+
An alternative way to think about it is to use the back of the envelope approximation:
 +
 
 +
<math>
 +
2^{10} \sim 10^3
 +
</math>
  
 
so it follows that
 
so it follows that
  
10^12 ~ (10^3)^4 ~ (2^10)^4 ~ 2^40
+
<math>
 +
10^{12} \sim (10^3)^4 \sim (2^{10})^4 \sim 2^{40}
 +
</math>
 +
 
 +
Our back of the envelope estimate is about 40 times, which matches the more precise calculations above.
 +
 
  
so approx. 40
 
  
---
+
'''Part b - amount to play?'''
Part b - amount to play?
 
  
A maximum of 40 tosses leads to an expected payoff of
+
Given our maximum of 40 tosses, and the 50% probaability, a maximum of 40 tosses leads to an '''expected payoff''' of
  
 +
<pre>
 
E = 1/2 + 1/2 + ... + 1/2
 
E = 1/2 + 1/2 + ... + 1/2
 
E = 40*1/2
 
E = 40*1/2
E = $20
+
E = 20
 +
</pre>
 +
 
 +
So we should expect to win $20 from the game.
 +
 
  
  
---
+
'''Part c - What is probability Paul de Bank will get cleaned out?'''
Part c - What is probability Paul de Bank will get cleaned out?
 
  
1/2^n = 1/2^40 = 9.09e-13
+
The probability of getting a heads once is <math>\dfrac{1}{2}</math>; twice is <math>\dfrac{1}{4}</math>; and so on. The probability of 40 heads in a row is:
  
Alternatively,
+
<math>
 +
\dfrac{1}{2}^n = \dfrac{1}{2}^{40} = \dfrac{1}{2^{40}} = 9.09 \times 10^{-13}
 +
</math>
  
1/2^40 ~ 2^-40 ~ (2^10)^-4
+
Alternatively, using our back of the envelope estimate of
1/2^40 ~ (10^3)^-4
+
 
1/2^40 ~ 10^-12
+
<math>
 +
2^{10} \sim 10^3
 +
</math>
 +
 
 +
we get a back of the envelope estimate of
 +
 
 +
<math>
 +
\begin{align}
 +
\dfrac{1}{2}^{40} & \sim & 2^{-40} \sim (2^{10})^{-4} \\
 +
\dfrac{1}{2}^{40} & \sim & (10^3)^{-4} \\
 +
\dfrac{1}{2}^{40} & \sim & 10^{-12}
 +
\end{align}
 +
</math>
  
 
if Paul de Bank paints a single one dollar bill red, and then put all of his dollars into one giant pile, it's the probability of pulling out that one single dollar bill
 
if Paul de Bank paints a single one dollar bill red, and then put all of his dollars into one giant pile, it's the probability of pulling out that one single dollar bill
  
---
 
Part d - What is the probability that Petra von Player will lose money on the game?
 
  
> 97%
 
  
to make back $20, we would need to win a power of 2 quantity more than 16 - which is 32
+
'''Part d - What is the probability that Petra von Player will lose money on the game?'''
 +
 
 +
To make back $20, we would need to win a power of 2 quantity more than 16 - which is 32
  
 +
<pre>
 
>>> np.log2(20)
 
>>> np.log2(20)
 
4.32
 
4.32
Line 106: Line 141:
 
>>> np.power(2,5)
 
>>> np.power(2,5)
 
32
 
32
 +
</pre>
  
To make $32 we have to win 6 times, which has the probability  
+
To make $32 we have to win 6 times (remember, the first bet is $1, so we are starting at <math>2^0</math> and it takes 6 wins to receive a payoff of at least <math>2^5</math>), which has the probability:
  
1/2^6 = 0.0156
+
<math>
 +
\dfrac{1}{2^6} \sim 0.0156
 +
</math>
  
 
so probability of Petra von Player losing money on the game is
 
so probability of Petra von Player losing money on the game is
  
 +
<pre>
 
>>> 1-(1/np.power(2,6))
 
>>> 1-(1/np.power(2,6))
 
0.9843
 
0.9843
 +
</pre>
  
 
}}
 
}}

Revision as of 10:56, 4 December 2019

Friday Morning Math Problem

Petersburg Paradox Revisited

Consider the famous Petersburg Paradox:

Petra von Player and Paul de Bank agree to play a game based on the toss of a coin. If a head is thrown on the first toss (prob = 1/2), Paul de Bank pays Petra von Player a dollar, and the game is over. If the first toss is tails and the second toss is head (prob = 1/4), Paul de Bank pays Petra von Player two dollars, and the game is over. If the first head appers on the third toss (prob = 1/8), Paul de Bank pays Petra von PLayer four dollars, and so on. Each time the winning head does not appear, the payoff doubles.

Once heads appears, the game is over, and the player is paid off. The probability that the game is won on the nth toss is 1/2^n. Since Petra von Player is the only player and she will always win, she must pay to play.

How much should Petra von Player pay Paul de Bank for the privilege of playing the game?


If the game can go on forever, the expected winnings are

1 * 1/2 + 2*1/4 + 4*1/8 + ... = 1/2 + 2/4 + 4/8 + ... = 1/2 + 1/2 + 1/2 + ...

which is infinite - meaning if the game goes on forever, the expected winnings are infinite.

If Petra is to make money off the game, she should be willing to pay a quantity less than the expected payoff to play the game. But if the expected payoff is infinite, Petra should be willing to pay an infinite amount of money to play the game - hence the paradox.


The Petersburg Paradox is resolved by recognizing that Petra von Player and Paul de Bank have finite resources, and money is not "infinite" the way that numbers are infinite, so ultimately the game must be limited by de Bank's total amount of money and von Player's capacity to procure (or borrow) money to keep playing.


Now suppose Paul de Bank has a trillion (10^12) dollars.

a. How many coin tosses would it take Petra von Player to clean out Paul de Bank?

b. How much should Petra von Player be willing to pay to play?

c. What is the probability Paul de Bank will get cleaned out?

d. What is the probability that Petra von Player will lose money on the game?

Solution
Part A - number of coin tosses for von Player to clear out de Bank?

We can find the number of times we have to double 1 to reach Paul de Bank's billion dollar fortune:

>>> np.log2(1e12)
39.86

>>> np.power(2,39)
549,755,813,888

But remember that bets start at 1, or 2^0, so 2^{39} takes 40 wins to reach.

If Petra von Player wins 40 times in a row it would leave de Bank with a measely

>>> 1e12 - np.power(2,40-1)
450,244,186,112

half a trillion dollars left to live on. If Petra von Player wins 41 times in a row, it leaves de Bank underwater

>>> 1e12 - np.power(2,41-1)
-99,511,627,776

and de Bank ends up with 99 billion dollars of debt.


An alternative way to think about it is to use the back of the envelope approximation:


2^{10} \sim 10^3

so it follows that


10^{12} \sim (10^3)^4 \sim (2^{10})^4 \sim 2^{40}

Our back of the envelope estimate is about 40 times, which matches the more precise calculations above.


Part b - amount to play?

Given our maximum of 40 tosses, and the 50% probaability, a maximum of 40 tosses leads to an expected payoff of

E = 1/2 + 1/2 + ... + 1/2
E = 40*1/2
E = 20

So we should expect to win $20 from the game.


Part c - What is probability Paul de Bank will get cleaned out?

The probability of getting a heads once is \dfrac{1}{2}; twice is \dfrac{1}{4}; and so on. The probability of 40 heads in a row is:


\dfrac{1}{2}^n = \dfrac{1}{2}^{40} = \dfrac{1}{2^{40}} = 9.09 \times 10^{-13}

Alternatively, using our back of the envelope estimate of


2^{10} \sim 10^3

we get a back of the envelope estimate of


\begin{align}
\dfrac{1}{2}^{40} & \sim & 2^{-40} \sim (2^{10})^{-4} \\
\dfrac{1}{2}^{40} & \sim & (10^3)^{-4} \\
\dfrac{1}{2}^{40} & \sim & 10^{-12}
\end{align}

if Paul de Bank paints a single one dollar bill red, and then put all of his dollars into one giant pile, it's the probability of pulling out that one single dollar bill


Part d - What is the probability that Petra von Player will lose money on the game?

To make back $20, we would need to win a power of 2 quantity more than 16 - which is 32

>>> np.log2(20)
4.32

>>> np.power(2,5)
32

To make $32 we have to win 6 times (remember, the first bet is $1, so we are starting at 2^0 and it takes 6 wins to receive a payoff of at least 2^5), which has the probability:


\dfrac{1}{2^6} \sim 0.0156

so probability of Petra von Player losing money on the game is

>>> 1-(1/np.power(2,6))
0.9843

Flags