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

Posted 2 years ago
1626 Views
|
6 Replies
|
1 Total Likes
|
 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
6 Replies
Sort By:
Posted 2 years ago
 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 2 years ago
 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 2 years ago
 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 2 years ago
 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}]