Message Boards Message Boards

0
|
4158 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Bernoulli's resolution of the St Petersburg Paradox - how to find the limit

Posted 8 years ago

Hi,

How can the infinite sum of Bernoulli's proposed resolution of the St Petersburg paradox be calculated using Mathematica?

I tried the below formula in Mathematica but it didn't give me a numerical solution. I was expecting 'c', the player's maximum price to take part in the lottery, to be 10.95 dollars.

w = 1000000;
NSolve[Sum[1/2^n*(ln[w + 2^n - c] - ln[w]), {n, 1, Infinity}] == 0, c]

I tried simulating the infinite sum using a spreadsheet and for a player with a wealth of 1,000,000 dollars who has a natural log utility function, I found that he would pay a maximum of 10.95 dollars. This spreadsheet is here.

The formula above

Sum[1/2^n*(ln[w + 2^n - c] - ln[w]), {n, 1, Infinity}] 

is the solution proposed by Daniel Bernoulli. The details of the St Petersburg paradox are described here.

Thanks for your help. Apologies if this is a silly question.

Cheers,

Keith

POSTED BY: Keith Woodward
6 Replies

Hi Daniel and Sander,

Thank you very much for your excellent answers. After more than 10 years of showing an erroneous value (10.95), the Wikipedia page about the Bernoulli Paradox can now be fixed and set to 20.88!

This is close to the reference value of 20.84. Playing with various options brings it a hair closer, to 20.874. Maybe I'm not using the best options though. Or maybe the reference value had a typo, hard to say.

That reference value was crudely computed in a spreadsheet using a sum of the first 500 or so values together with MS Excel's Solver function. That's a relief that the Mathematica-calculated value is very similar.

I'm sorry I overlooked the natural log function notation, ln rather than Log.

By the way, I wonder how Bernoulli attempted to calculate these values back in the 1700's? I guess that he somehow calculated that the series converged and then did a crude approximation by summing the first few dozen values.

Thank you for your help. I actually asked the same question on MathExchange (http://math.stackexchange.com/questions/1767884/st-petersburg-paradox-cant-replicate-max-lottery-price-on-wikipedia) before coming here and was treated quite rudely. My question was dismissed, put on hold and derided by some unknown administrators, and then heavily edited as if to cover up the way I was treated. Bizarre.

POSTED BY: Keith Woodward

Well, It is definitely not gonna work when you write

ln

instead of

Log

!

Here is the correct code to solve this problem:

ClearAll[GetSum]
GetSum[w_?NumberQ,c_?NumberQ]:=NSum[1/2^n*(Log[w+2^n-c]-Log[w]),{n,1,Infinity}]

w=1000000;
Plot[GetSum[w,c],{c,1,30}]

c/.FindRoot[GetSum[w,c],{c,20,15,25}]

enter image description here

POSTED BY: Sander Huisman

I just see Daniel's answer. Pretty much the same. well... anyhow...

POSTED BY: Sander Huisman

Best I can tell, Sum has no real chance to handle that input, and so Solve and even NSolve are likely to fail. I'd suggest making a function that can be evaluated numerically by NSum and using FindRoot on the result. Something like below.

Define w and the NSum.

w = 1000000;
util[c_?NumberQ] :=  NSum[1/2^n*(Log[w + 2^n - c] - Log[w]), {n, 1, Infinity}]

Now find the value of c that zeroes the sum.

FindRoot[util[c] == 0, {c, 2}]

(* Out[1148]= {c -> 20.8753540254} *)

This is close to the reference value of 20.84. Playing with various options brings it a hair closer, to 20.874. Maybe I'm not using the best options though. Or maybe the reference value had a typo, hard to say.

POSTED BY: Daniel Lichtblau

Read the Wikipedia link again. The value of c=10.95 is for a different w.

Also it is better to post actual Mathematica code for purposes of others testing/fixing it.

POSTED BY: Daniel Lichtblau

Hi Daniel,

Thanks for your reply.

I'm sorry, I mistakenly wrote 100 in my initial wealth rather than 1,000,000 which is what I tried in Mathematica and which didn't give a numerical result.

I changed the value to the correct 1,000,000 five minutes after my initial post, but I guess you only saw the first incorrect version. Sorry about that.

Here is the mathematica code that I tried to run with no numerical result:

w = 1000000;

Solve[Sum[1/2^n*(ln[w + 2^n - c] - ln[w]), {n, 1, Infinity}] == 0, c]

Best regards, Keith

POSTED BY: Keith Woodward
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract