Two Envelopes Paradox Calculator: Expected Value and the Switching Fallacy
Open your envelope, enter the amount you see, and this calculator shows you two things side by side: the naive switching argument that claims you should always switch (and why it is mathematically wrong), and the correct expected-value analysis that proves staying and switching are equally good. The step-by-step panel walks through the exact algebra so you can see where the famous fallacy breaks down.
What is the two envelopes paradox?
Two sealed envelopes sit on a table. One contains some amount of money; the other contains exactly twice that amount. You pick one at random and peek inside. You see, say, $100. Now you are offered a chance to switch to the other envelope. Should you? The naive reasoning says yes: the other envelope is either $200 (if yours was the smaller) or $50 (if yours was the larger), each with probability 1/2. The expected value of the other envelope is therefore 0.5 * $200 + 0.5 * $50 = $125, which beats the $100 you are holding. But by the same logic, if you had opened the other envelope first and seen $125, you would calculate an expected value of $156.25 for switching back - and so on forever. This circular conclusion is the paradox: you should always switch, yet switching is symmetric and cannot always be beneficial.
Where the switching argument goes wrong
The flaw is a subtle equivocation. Let the two envelopes hold amounts m and 2m, where m > 0 is unknown. You open yours and see X dollars. There are two mutually exclusive scenarios:
- Scenario A: your envelope holds 2m, so X = 2m, meaning m = X/2, and the other envelope holds X/2.
- Scenario B: your envelope holds m, so X = m, and the other envelope holds 2X.
The correct expected-value analysis
Fix the two amounts as m (smaller) and 2m (larger), where m is drawn from some unknown prior distribution. You pick an envelope uniformly at random, so:
- E(your envelope) = 0.5 * m + 0.5 * 2m = 1.5m
- E(other envelope) = 0.5 * 2m + 0.5 * m = 1.5m
The threshold strategy: when you actually can do better
There is a surprising result from decision theory: even without knowing m, a randomized strategy lets you select the larger envelope with probability strictly greater than 50%. Before you open your envelope, choose a random threshold T from any continuous probability distribution that covers all positive numbers (for example, a log-normal distribution). After opening the envelope and seeing X:
- If X < T, switch to the other envelope.
- If X ≥ T, stay with yours.
Real-world applications and related paradoxes
The two-envelopes problem is a vivid example of how conditional expected values can mislead. Related paradoxes include the St. Petersburg paradox (an infinite expected value from repeated coin flips), Bertrand's paradox (ambiguous probability of geometric events), and the Monty Hall problem (where switching genuinely does help because a door is deliberately revealed). Unlike Monty Hall, no new information is revealed in the two-envelopes problem that breaks the symmetry, so switching yields no advantage. The paradox is used in philosophy of probability to illustrate the dangers of improper prior distributions and the importance of grounding expected-value calculations in a well-defined sample space.
Two-envelope paradox: key scenarios
| Your envelope (X) | If yours is the smaller (m) | Other envelope = 2X | If yours is the larger (2m) | Other envelope = X/2 | Naive EV of switching |
|---|---|---|---|---|---|
| 10 | Yes | 20 | No | 5 | 12.5 |
| 50 | Yes | 100 | No | 25 | 62.5 |
| 100 | Yes | 200 | No | 50 | 125 |
| 500 | Yes | 1000 | No | 250 | 625 |
| 1000 | Yes | 2000 | No | 500 | 1250 |
| 10000 | Yes | 20000 | No | 5000 | 12500 |
For each amount seen in your envelope, the table shows both possible states of the world and the implied values.
Frequently asked questions
Should I switch envelopes if I open mine and see a large amount?
No. The correct expected-value analysis shows that both envelopes have the same expected value, regardless of what you see. Switching does not improve your expected payoff. The naive argument that says you should switch is mathematically flawed: it treats the same symbol X as if it simultaneously represents both the smaller and the larger of the two unknown amounts, which is an equivocation.
Why does the naive switching argument give 1.25X as the expected value?
The naive formula averages two scenarios: other envelope = 2X (if yours is the smaller) and other envelope = X/2 (if yours is the larger), each with probability 0.5. That gives 0.5 * 2X + 0.5 * (X/2) = 1.25X. The problem is that X in the two branches refers to different base amounts - in one branch it is the smaller amount m, in the other it is the larger amount 2m - so averaging them as if they are the same quantity is invalid.
Is the two-envelopes paradox the same as the Monty Hall problem?
No, they are different paradoxes with different resolutions. In Monty Hall, the host deliberately opens a losing door after your choice, adding new information that genuinely changes the probability distribution and makes switching beneficial (2/3 vs. 1/3 chance of winning). In the two-envelopes problem, no new information is added that breaks the symmetry between your envelope and the other, so switching offers no advantage.
What is the threshold strategy and does it really beat 50/50?
Yes, provably. Before opening your envelope, pick a random number T from any continuous distribution over positive numbers. After seeing your amount X, switch if X < T, stay if X >= T. Because T is independent of the envelope amounts and is drawn from a continuous distribution, there is always a positive probability that T falls strictly between the smaller and larger amounts. When that happens, the strategy correctly identifies which envelope is larger. The overall probability of picking the larger envelope exceeds 0.5, though you can never know exactly by how much without knowing the envelope amounts.
What prior distribution do the envelopes require for the naive argument to work?
For the naive conditional expectation E(other | you see X) > X to hold for every possible value of X, the prior distribution on the envelope amounts would need to be improper - meaning it cannot integrate to 1 over the positive reals. In practice, this means the expected value of the envelopes would be infinite. With any finite, proper prior distribution, the expected values of both envelopes are equal, and the switching argument collapses.
Does seeing the actual amount in your envelope give you any useful information?
In the abstract setting where you have no prior knowledge of the envelope amounts, no: the symmetry between the two envelopes means that whatever you see, you cannot tell whether you are holding the smaller or the larger. However, if you have some prior belief about the likely range of amounts (for example, if you know the amounts are between $1 and $100), then seeing $90 gives you reason to believe you are probably holding the larger envelope, and you might rationally decide to stay.
What is the connection between this paradox and improper priors in Bayesian statistics?
The two-envelopes fallacy is essentially an improper Bayesian prior in disguise. For the naive argument to hold universally - for every possible amount X you might see - the distribution over the base amount m must assign equal probability density to every positive number, which is impossible for a normalized probability distribution. This is an improper prior, and reasoning with it produces nonsensical results such as the infinite chain of 'always switch' conclusions. The lesson is that Bayesian reasoning requires proper, normalizable priors to produce valid expected values.
Sources
- Nickerson, R.S. (2004). Cognition and Chance: The Psychology of Probabilistic Reasoning. Lawrence Erlbaum Associates. Chapter on the two-envelopes problem.
- Wikipedia: Two envelopes problem - comprehensive treatment of the paradox, its history, and resolutions.
- Cover, T.M. (1987). Pick the largest number. Open Problems in Communication and Computation. Springer. (Threshold strategy proof.)