Skip to content
All apps

Expected utility & risk types

About this app

The St. Petersburg paradox (expected value ∞, yet nobody pays much), Bernoulli utility functions with certainty equivalent (insurance vs. lottery), and the S-shaped prospect value function with loss aversion.

With explain mode: an AI tutor walks you through the app, points out what matters in the scene and answers your questions.

The paradox

In the St. Petersburg game a coin is tossed until it lands heads. If heads comes on the k-th toss, you win 2^k €. Each stage occurs with probability 1/2^k and so adds exactly 1 € to the expected value; the sum 1 + 1 + 1 + … is infinite. Yet hardly anyone would pay more than a few euros to play. Daniel Bernoulli resolved the paradox in 1738 with utility: what matters is the diminishing marginal utility of money, not the amount. Expected utility theory grew out of this idea.

Three modes

In “St. Petersburg paradox” mode you play single rounds or 1000 at once, set a price between 1 and 64 € and see the payout distribution, mean, median and balance. In “Risk types & utility” mode you choose u(x) = x^γ and two equally likely payoffs A and B. The chord shows the expected utility, which gives the certainty equivalent and the risk premium. In “Prospect theory” mode you move the reference point and the outcome and set the loss aversion λ.

Things to try

Play 1000 rounds several times: the mean grows only roughly logarithmically with the number of rounds, and at a price of a few euros the balance usually turns negative. Then switch between risk-averse, neutral and risk-seeking and see whether the certainty equivalent lies below or above the expected value. One explains insurance, the other lotteries. In prospect theory, watch the same outcome flip from gain to loss when you only shift the reference point.

Frequently asked questions

What is the St. Petersburg paradox?
The St. Petersburg paradox describes a gamble with an infinite expected value for which almost nobody would pay more than a small amount. It shows that expected value alone cannot explain sensible decisions under risk. In 1738 Daniel Bernoulli proposed valuing the utility of money instead of the amount.
What are the certainty equivalent and the risk premium?
The certainty equivalent is the sure amount that is worth exactly as much to a person as a risky lottery, so u(CE) = E[u]. The risk premium is the difference between the expected value and the certainty equivalent. For risk-averse people it is positive, which is why they pay more for insurance than the expected loss.
What does loss aversion mean?
Loss aversion means that a loss weighs more heavily than a gain of the same size. In Kahneman and Tversky’s prospect theory the value function is therefore steeper in the loss domain. A commonly cited estimate for the factor λ is about 2.25.
What can I try in this app?
You play the St. Petersburg game at a price of your choice, shape a utility function via the exponent γ and read off the certainty equivalent and risk premium. In the third mode you move the reference point and set the loss aversion of the prospect value function.

Subject: Data & decisions

More from Data & decisions

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps