Advertisement
Advertisement
PROBABILITY

Two Envelopes Paradox Calculator — where the switching argument breaks

Set a prior over the amounts, open an envelope, and see the real expected value of switching next to the fallacious 25% the naive argument claims.

The lowest value the smaller envelope can hold. The pairs are this amount doubled repeatedly.
A proper prior must be finite or at least summable. This is where the paradox is defused.
Each successive pair is this many times as likely as the one before. Below 0.5 large amounts are very unlikely; at 1 every pair is equally likely.
Must be one of the values the prior can produce. The tool lists them if it is not.
Expected value of the other envelope
 
Naive argument's claim
Actual gain from switching
Chance you hold the smaller
Gain from always switching
Every possible observation:
Advertisement

The two envelopes paradox calculator exists to show why a famous piece of reasoning is wrong. Two envelopes are placed in front of you; one holds twice as much money as the other. You pick one, and before opening it you are offered a swap. An apparently airtight argument says the swap has an expected gain of 25%, which would also apply to the envelope you swapped into, and so on forever. Something has to give.

Arb Digital publishes this as part of a free probability library that already covers several classical puzzles. This page does not present “always switch” as a result. It reproduces the flawed calculation exactly as it is usually stated, then lets you supply an actual prior distribution over the amounts and watch the conclusion collapse.

The Argument, Stated Fairly

Call the amount in your envelope a. The other envelope holds either 2a or a/2. Treating those as equally likely gives an expected value of ½ × 2a + ½ × a/2 = 1.25a. Switching therefore appears to gain 25% of whatever you are holding, whatever that is. Since the argument used no information about a, it applies before you open anything, and it applies again after you switch. You would swap back and forth forever, gaining 25% each time.

That conclusion is absurd, so at least one step is wrong. The calculator above shows which one.

Where It Fails

The error is the assumption that the other envelope is equally likely to hold double or half, whatever amount you are holding. That is a statement about your beliefs concerning the amounts, and it cannot be true for every possible a at once. If it were, every amount would have to be exactly as likely as its double, forever, in both directions — and no probability distribution over the positive numbers behaves like that. Any distribution you can actually write down has to thin out somewhere, and where it thins out, seeing a large amount is evidence that you are holding the larger envelope.

The Stanford Encyclopedia of Philosophy treats this directly in its discussion of tacitly infinite decision problems, noting that the reasoning quietly assumes a uniform distribution over all possible values and that when the expectations involved are infinite the inference itself breaks down. The paradox is not a discovery about envelopes. It is what happens when an improper prior is smuggled into an expected-value calculation.

How to Use the Calculator

  1. Set the smallest possible amount. The prior places the smaller envelope at this value, or twice it, or four times it, and so on.
  2. Choose how many pairs are possible. Any finite number gives a proper prior, which is exactly what the naive argument lacks.
  3. Set the decay ratio — how much less likely each successive pair is than the last. This is the single most important control on the page.
  4. Enter what you saw in the envelope you opened, using one of the values the prior can produce.
  5. Compare the four figures: the naive 25%, the actual conditional gain, your posterior chance of holding the smaller envelope, and the expected gain of a policy of always switching.

The Formula

Let the smaller amount be the base value times 2k, with prior weight wk proportional to the decay ratio raised to the power k, normalised to sum to one. You are handed one of the two envelopes at random, so seeing the value base × 2j can happen two ways: the pair was the jth one and you took the smaller, or the pair was the (j−1)th and you took the larger. Bayes' rule then gives

P(you hold the smaller | you saw a) = wj ÷ (wj + wj−1)

and the expected value of the other envelope is that probability times 2a, plus its complement times a/2. With a geometric prior of ratio q, the posterior probability simplifies to q ÷ (1 + q) for every interior observation, which is why the conditional gain in the middle of the range is the same percentage at every amount.

Work the default settings by hand. With a ratio of 0.7, the posterior chance of holding the smaller envelope is 0.7 ÷ 1.7 = 0.411765. Having seen 40, the expected value of the other envelope is 0.411765 × 80 + 0.588235 × 20 = 32.941 + 11.765 = 44.706, a gain of 4.706, or 11.76%. Not 25%.

Advertisement

The Number That Settles It

The fourth grid figure is the expected gain of a policy of switching no matter what you see, averaged over every amount you might have seen, weighted by how likely each observation is. Under any proper prior that number is exactly zero, and the calculator computes it from the same weights rather than asserting it.

That is the resolution in one line. Switching can genuinely be favourable at some observed amounts — with the default settings it gains 11.76% at every interior value and a full 100% at the very smallest, because seeing the minimum tells you with certainty that you hold the smaller envelope. But it must be unfavourable somewhere else, and it is: at the largest possible amount you certainly hold the larger envelope, and switching loses half. Those losses are rare and large; the gains are common and small. They cancel exactly. Nothing is created by moving your hand.

This is also why the unopened case is not paradoxical at all. Before you look, the two envelopes are symmetric by construction, so switching cannot have positive expected value. The naive argument produces one anyway, and that alone is enough to show the reasoning is invalid.

What the Prior Actually Controls

Change the decay ratio and watch the interior gain move. At exactly 0.5 the conditional gain is zero everywhere in the interior: seeing a doubled amount is exactly half as likely a pair, and that evidence precisely offsets the doubling of the payoff. Above 0.5 the interior gain is positive, and switching is a reasonable thing to do at those amounts. Below 0.5 it is negative, and switching at an interior amount is a mistake.

So the answer to “should you switch” is genuinely prior-dependent, which is the honest conclusion and the reason this tool asks you to choose one. What is never prior-dependent is the total: whatever ratio you pick, the always-switch policy returns zero. Try several and confirm it.

Reading the Table of Every Observation

The panel under the results lists every amount the prior can produce, the expected value of the other envelope given that you saw it, and the percentage gain. It repays a slow read, because the whole resolution is visible in one line of numbers.

At the smallest amount the gain is exactly 100%. That is not a bug: if you open an envelope and find the lowest value the setup allows, you know for certain that yours is the smaller of the pair, so the other one certainly holds double. At the largest amount the gain is exactly −50%, for the mirror-image reason. Between those two extremes the gain is a single constant percentage, because a geometric prior gives the same likelihood ratio at every interior step.

Now look at how often each of those cases happens. The extreme high observation is the rarest thing in the table, and it is also the only place where switching loses. Multiply each gain by the probability of seeing that amount, add them up, and the total is zero. That weighted sum is the fourth figure in the results grid, and watching it stay at zero while you change the base, the number of pairs and the decay ratio is the most convincing demonstration of the resolution that a calculator can offer.

Why the Infinite Version Is Worse, Not Better

You might hope to rescue the argument by choosing a prior with no upper limit. Some do exist for which the interior gain is positive at every observation — a ratio above 0.5 with infinitely many pairs, for instance. But those priors have infinite expected value, and once the expectation is infinite the whole apparatus of comparing expected values stops behaving. You cannot subtract infinity from infinity and read the difference as a gain.

That failure is closely related to the St. Petersburg game, where a payoff doubling as fast as its probability halves produces an infinite expectation that nobody would pay much to enter; the Stanford Encyclopedia's entry on the St. Petersburg paradox sets out the standard responses. Both puzzles are cases where an unbounded expectation is treated as if it were an ordinary number. Restricting yourself to proper, finite priors — which is what this calculator does — makes both of them ordinary arithmetic again.

Common Mistakes to Avoid

  • Assuming double and half are equally likely for every amount. No proper prior has that property, and it is the entire error.
  • Mixing the two roles of a — in the naive calculation, a stands for the smaller amount in one branch and the larger in the other, so the two branches are not about the same quantity.
  • Concluding “always switch” from a positive conditional gain at one observed value, without checking the observations where the gain is negative.
  • Reaching for an unbounded prior, which replaces a finite error with an undefined expectation.
  • Treating the unopened case as identical to the opened one. Before you look there is no information to condition on, and the symmetry is exact.
Want explainers that hold up to a sceptical reader?

Arb Digital builds free tools and reference pages that earn organic traffic because they are honest about what the maths does and does not show. Browse the library, or tell us what your audience keeps searching for.

Browse Free Tools Talk to Arb Digital

Related Free Tools From Arb Digital

Work through the conditioning step itself with the conditional probability calculator, compare with another puzzle where opening a door really does change the odds in the Monty Hall calculator, look at two more classical traps in the Bertrand's box paradox calculator and the boy or girl paradox calculator, and see how a utility function changes a decision in the expected utility calculator. The free online tools hub lists every probability tool we publish.

Frequently Asked Questions

Should you switch envelopes?

It depends entirely on your prior over the amounts and on what you saw. There is no general answer, and “always switch” is not one. Averaged over every observation, a policy of always switching has an expected gain of exactly zero under any proper prior.

What exactly is wrong with the 25% argument?

It assumes the other envelope is equally likely to hold double or half whatever you are holding, for every possible amount. No probability distribution over the positive numbers has that property, so the assumption is not merely unlikely, it is impossible.

Why is the expected gain zero overall?

Because switching gains a little at the amounts you see often and loses a lot at the rare extreme amounts, and the two exactly cancel. The calculator computes this total from the prior weights rather than asserting it.

Does opening the envelope change anything?

Yes. Once you see an amount you have information to condition on, and under some priors switching then has genuinely positive expected value at that amount. Before you look, the two envelopes are symmetric and switching cannot help.

What does the decay ratio do?

It sets how much less likely each successive pair of amounts is. At exactly 0.5 the conditional gain from switching is zero at every interior amount. Above 0.5 it is positive there, and below 0.5 it is negative.

Can I use a prior with no upper limit?

You can write one down, but priors that make switching favourable at every amount have infinite expected value, and comparing infinite expectations is not valid arithmetic. That replaces the original error with an undefined one.

Is this the same as the Monty Hall problem?

No. In Monty Hall the host's choice genuinely carries information and switching really does double your chance. Here the switching argument is a fallacy, and the correct answer depends on a prior the naive version never states.

Advertisement
Advertisement

Take it further