Understanding the two envelopes paradox calculator — concept and principle
This calculator explores the two envelopes paradox. One envelope holds twice as much as the other; you open one and see an amount A. Should you switch? The calculator compares the naive "always switch" argument with the expected value based on your actual belief about whether you hold the smaller amount. Use it for probability classes, decision theory and puzzles.
How it is calculated
With A in your envelope and q your probability that A is the smaller amount:
- Other envelope: 2A if yours is smaller, A/2 if yours is larger.
- Expected amount if you switch = q·2A + (1 − q)·A/2.
- Expected gain from switching = that amount − A.
- Switching pays exactly when q > 1/3.
- Naive estimate (assuming q = ½ always) = 5A/4.
The principle
The paradox argues: the other envelope holds 2A or A/2 with equal chance, so switching is worth 5A/4, more than A, and by symmetry you should switch back again forever. The flaw is the assumption that q = ½ for every possible A. Before you look, the envelopes hold x and 2x and each has expected value 3x/2, so switching blindly gains nothing. After you see A, the chance it is the smaller one depends on how the amounts were chosen; no proper rule for choosing amounts makes q = ½ for every A. Your knowledge of the person filling the envelopes, such as a budget limit, shifts q, and the threshold q > 1/3 tells you when switching is worthwhile.
Worked example
Default inputs: A = 100, belief q = 30%.
- If yours is larger, the other holds 50; if smaller, 200.
- Expected amount after switching = 0.3 × 200 + 0.7 × 50 = 60 + 35 = 95.
- Expected gain = 95 − 100 = −5.
- The threshold is q = 33.33%, and 30% is below it, so keep your envelope.
- The naive argument would claim 125, which ignores your belief.
How to read the result
A positive expected gain means switching is favourable under your belief; negative means keep. The threshold 1/3 comes from solving q·2A + (1 − q)·A/2 = A. A very large A usually means you are more likely to hold the larger amount (q low), so keeping is wiser; a small A often suggests the opposite.
Common mistakes
- Assuming q = ½ for every amount.
- Treating the naive 5A/4 as a real expected value.
- Forgetting that before looking, switching has no advantage at all.
- Choosing q after deciding what you want to do rather than from what you know.
Frequently asked questions
What is the resolution of the two envelopes paradox?
The "½ each" step is not valid for every amount; once you account for how the amounts were chosen, the infinite-switching argument breaks down.
When should I switch?
When your probability of holding the smaller amount is above one third.
Does switching help if I have not opened the envelope?
No. Both envelopes have the same expected value, 3x/2.
Sources: Nalebuff, B. (1989), "Puzzles: The Other Person's Envelope is Always Greener", Journal of Economic Perspectives 3(1), 171–181