Problem (N. Bernoulli, 1713). Toss a fair coin until the first head; if that takes tosses you win . How much should you pay to play? , so , yet nobody would pay more than a few dollars.
| Resolution | Value of the game |
|---|---|
| expected value | |
| banker with finite wealth () pays | (a billion-dollar bank: about 31) |
| logarithmic utility (D. Bernoulli, 1738), no wealth | : certainty equivalent |
| log utility with wealth , fair entry price solving | grows like : about at , at |
| playing times (Feller) | total winnings : the fair price per game grows like |
Fair entry price under log utility, from the code below: (you must borrow ), , , , .
double cappedValue(double W) { // E[min(2^K, W)], K = number of tosses until the first head
double s = 0;
for (int k = 1; k < 2000; k++) s += ldexp(min(ldexp(1.0, k), W), -k);
return s;
}
double logUtilityPrice(double w) { // largest entry price c with E[ln(w - c + 2^K)] >= ln w
auto f = [&](double c) { double s = 0; for (int k = 1; k < 200; k++) s += ldexp(log(w - c + ldexp(1.0, k)), -k); return s - log(w); };
double lo = 0, hi = w + 2; // c < w + 2 keeps the worst outcome (K = 1) positive
for (int it = 0; it < 200; it++) { double mid = (lo + hi) / 2; (f(mid) >= 0 ? lo : hi) = mid; }
return lo;
}
double averagePayout(int n, mt19937_64& rng) { // average over n games (grows like log2 n)
double s = 0;
for (int i = 0; i < n; i++) { int k = 1; while (rng() & 1) k++; s += ldexp(1.0, k); }
return s / n;
}Proof: capped value, log utility and Feller's law
Capped game. With , the payout is for and for :
. For this is . So a bank worth makes the game worth about 31.Log utility. (differentiate , so , at ). The certain amount with the same utility is . With wealth , is decreasing in , so bisection finds the fair price.
Feller’s weak law. Let be the total of games and . Truncate: . Since , . Next and . By Chebyshev, . Hence in probability: the fair price for games is about per game. All three functions were checked (capped value against , prices against the bisection identity, averages against within a constant factor).