Post

Arabian Nights

the st. petersburg paradox and ergodicity

Jan 8, 2025 – Jan 8, 2025 | Post

arabian-nights
please don’t sue me for copyright Disney

You hop off the train and find yourself in an outdoor bazaar, sun beating down on you with white tents as far as the eye can see. A short man who looks oddly like the peddler from Aladdin immediately accosts you and tries to sell you some strange looking knick knacks. You shake your head no and start walking on, but he starts singing Arabian Nights and honestly his voice is pretty nice. Maybe he can give you singing lessons at a dirt cheap price. Before you’re able to ask him for those lessons, he notices he has your attention again & abruptly stops singing.

“I have an offer for you,” he begins. “We’ll start by flipping a fair coin. If it comes up heads, I’ll give you $2. If it comes up tails, we’ll double the payout and flip again.”

“Wait,” you say, “if tails comes up 9 times in a row, and then finally heads, you’ll pay me $1024?”

“That’s right. If you keep getting tails your payout doubles over and over, until you flip a heads. I’ll even let you use your own coin, so you can be sure it’s fair.”

Grinning, you start calculating the number of kabobs you could buy. But wait, how much should you pay to play this game?

Since it’s 1713 and you’re Nicolas Bernoulli, you’ve encountered this game before. You haven’t had a chance to talk with your cousin Daniel yet, but you’ve at least thought about it. You remember you had realized the game has infinite expected value, which is a generally accepted way to figure out how much you should expect to make from playing. The chance of an immediate heads is ½ and the payout is $2, the chance of one tails followed by heads is ¼ and the payout is $4, etc., so you would calculate the expected value as ½×$2 + ¼×$4 + ⅛×$8 + …, or 1 + 1 + 1 + …, which is clearly infinite.

Briefly you wonder if the peddler is good for any amount larger than $1001. But then you remember the story of Aladdin, published just 9 years ago, and notice for the first time the lamp gleaming in the peddler’s tent. Worst case he could call upon his magic genie to give him the money, you suppose. You think about quickly grabbing the lamp and making a break for it, but first you want to figure out how much you should pay to play this strange game.

Since the expected value is infinite, should you pay an infinite amount? Your hand drifts to your wallet and it definitely doesn’t feel thick enough for that. Traveling to North Africa in the 1700s ain’t cheap. Even if you could afford the infinite ticket price, that feels insane. You consider yourself a rational agent who calculates the expected value before taking any bet… but you can’t bring yourself to do it in this instance. You feel like something like $10 is more reasonable, and you’re sure other people you know offered this game would say something similar. Why is that?

Maybe it’s because to get anywhere near an infinite payoff, you’d have to get an absurd number of tails in a row which you know is extremely unlikely. Even though mathematically you can see the expected value is infinite, maybe you automatically are just ignoring any events with such a tiny chance? That would certainly explain your instinct to pay only $10… but you don’t feel satisfied. You’re smarter than that, you tell yourself. You’ve done the math, see the infinite expected value, but still only barely want to play the game.

Perhaps it’s risk aversion? Betting all your wealth, which is an impressive $100000 in your bank back home, on an uncertain game seems way too risky for someone of your social standing. Imagine the headlines if you came back penniless from your trip and people found out you had bet it all on a silly game in Marrakesh. They don’t make Disney movies about riches-to-rags stories. If instead you were a poor man who had nothing to lose, perhaps you’d be willing to go all in on this game. In other words, your starting wealth influences how much risk you’re willing to take – if you already have a bunch of money, the value of additional money is less than if you had started with a tiny amount. This feels intuitively satisfying. It also seems to explain why poor folks in your hometown keep buying lottery tickets and why some poor Dutch families took out loans to speculate in tulips over 75 years ago2.

The tune of Arabian Nights interrupts your reverie. Annoyed, you look at the peddler and he again immediately stops singing. “So, do you want to play? The cost is only $500 for a potentially infinite gain! And I’m good for it too”, he says with a sly smile.

“Aha!” you say, “I’ve just realized that wealth has diminishing marginal utility, so there’s no way playing is worth that much to me.” You start walking away.

“Wait!” the peddler shouts, “I’m willing to negotiate on the price. How much are you willing to pay to play?”

Back to square one.

Your initial instinct was $10, but is that actually the right amount? You realize that if you really believe in your diminishing marginal utility theory, you’ll need to figure out some utility function that describes how much utility/pleasure/usefulness you get from each additional $1 if you already have $W ($100000 in your case). Some utility function that might vary across people and take into account their risk preferences, but always has the property that the more wealth you already have, the less each additional dollar will be worth. Maybe something like log(W) or √(W) for you? You do some quick math and see that if you substitute log(payout) or √(payout) into the expected value formula instead of the payout itself (ie $log(2) or $√(2) instead of $2), the expected value is no longer infinite. Taking into account your current wealth of $100k, if you go with log(W), the formula tells you that you should pay $17.55 or less to play, and if you think your utility function is √(W) you should pay ≤ $19.553. Your guess of $10 wasn’t toooo far off.

Both of these seem reasonable – both of these functions match up with your observations of how humans behave in reality as they have the properties of diminishing marginal utility. But how do you choose between them? They may not give too dissimilar answers now, but they might in another context. Are you a logarithm guy or a square root gal? It seems like figuring out the particulars of your own utility function (not to mention other people’s!) might require a bit too much introspection, so you wonder if there’s another way to think about the problem.

You start thinking about expected value as a concept. It involves evaluating each possibility separately – computing the payoff times the chance of that possibility – and then adding them all up. There’s one universe where you get heads immediately, with probability ½, and get paid $2. There’s another universe where you get a tails and then heads, which has probability ¼, and you get paid $4. And there’s infinitely more universes, for each possible number of tails you could get. Averaging over all these parallel universes is what is known as the expected value, or an ensemble average. But why should you care about all these possible parallel universes? You can’t actually achieve the average payout over all these universes – you only get to live in one universe and you have to keep living in it after the game is over.

Another way of averaging is what’s known as the time average. The idea here is that instead of averaging all these parallel and mutually exclusive universes, you instead focus on the one universe you’re in and what might happen if you play the game repeatedly. So instead of looking at the expected value of playing the game once, you consider if the game has a positive growth rate over time. Even if you don’t actually choose to play this game over and over, this is potentially a better model for how people think about individual decisions. People may act in a way to maximize their wealth over time, making the assumption they will encounter a particular kind of decision over and over, rather than maximize their wealth based on the almost-always-unattainable expected value over all possibilities of a single decision.

A process (game) is called ergodic if the time average equals the ensemble average. In other words, if one individual playing a game repeatedly ends up with the same result on average in the long run4 as the average of a large group of individuals (parallel universes) playing the game a single time, the game is ergodic.

You’re a smart cookie so you quickly calculate the time average for the game, and see that it is not infinite and does not equal the ensemble average. So the game is non-ergodic and we shouldn’t be using the expected value/ensemble average anyways. You should care about what happens to you specifically over time rather than all the parallel universes you can’t actually access. The time average gives you reasonable results for what you should pay to play – it tells you to pay $17.55 or less.

Wait, doesn’t that number seem familiar? Magically the time average is exactly equal to the ensemble average if you use a utility function of log(W)! How strange that you arrived at one of the utility functions you were considering but in a totally different way. But if you had chosen √(W) instead as your utility function, the ensemble average and time average wouldn’t have been equal, even though √(W) also satisfies diminishing marginal utility… Perhaps we should just drop the idea of an arbitrary person-dependent utility function and ensemble average/expected value entirely, and stick with the time average. It introduces the logarithm5 in a more physically meaningful way, as a consequence of the multiplicative dynamics of playing the game repeatedly.

You start explaining the math to the peddler, but decide to skip it for now as he’s already pretty annoyed (better save that for a future stroll through Marrakesh). You offer $17 to play. The peddler scowls and counters immediately with $300. You walk away, resolving to come back with a massive group of friends who will all play, agree to pool their winnings, and achieve that mythical infinite expected value. Hopefully the one friend who gets 20 tails in a row won’t go back on their promise to share.

Arabian Nights starts up again behind you. You wish there was a mathematical formula for getting Disney songs out of your head.

Footnotes

  1. This is one resolution of the paradox. I find it unsatisfying. I also find unsatisfying the somewhat related resolution that no rational human would ever offer such a game to another due to the infinite expected loss.

  2. Probably a bit of historical fiction – there seems to be conflicting evidence on if anyone outside rich / some middle class families actually speculated in tulips. But this kind of logic helps to explain some of the meme stock/Bitcoin craze IMO.

  3. log(W) case, √(W) case. The idea is to set the expected change in utility to zero to get the break-even ticket price. I did this numerically to get an approximation since I couldn’t figure out how to get WolframAlpha to solve setting an infinite sum to zero :(

    See here for where the sums to calculate expected change in utility come from, though note the definition of the game in this paper is slightly different vs the Wikipedia definition (this post uses the latter). The Wikipedia game has you win $2 if the first flip is heads whereas the game in the paper has you win $1. This doesn’t really change anything fundamental, as it only changes the exponent of the payoff in the average calculations by 1. The notation is a bit different too, as the Wikipedia game has the number of consecutive tails tosses as the index in the sum, while the paper uses the total number of coin tosses.

  4. Ergodicity can be defined over a finite period as well, of course. A particular process could appear ergodic in the short run but not so in the long run, and this is highly related to tail events in finance (eg “picking up pennies in front of a steamroller”).

  5. A fascinating link here to the Kelly Criterion, from the paper I based this whole post on:

    A different heading for these results is the ‘Kelly criterion’ [2527]. In contrast to ensemble-average exponential growth rates, which often diverge (for instance with leverage), time-average exponential growth rates can be optimized [24,28]. Kelly [25] used this fact to optimize wager sizes in a hypothetical horse race using private information. While he refrained from using utilities because he deemed them ‘too general to shed any light on the specific problems’ he considered [25, p. 918], he did not point out the fundamental difference in perspective his treatment implies: in essence, arbitrary utility functions are replaced by the physical truth that time cannot be reversed. My aim here is to emphasize this difference in perspective. It is crucial that logarithmic utility from this point of view is not a utility at all. Rather, the logarithm accounts for the multiplicative nature of the process: the ensemble average of the logarithm of growth factors equals the logarithm of the time average of growth factors.