What Is the Two Envelopes Paradox Calculator?
The two-envelopes paradox is a probability puzzle about a choice between two sealed envelopes, one holding an amount X and the other twice that amount. It is famous less for being a good puzzle than for the fact that its usual solution is wrong in an instructive way.
The setup hides a genuine asymmetry. A right switch doubles your money, a wrong one halves it, so even a strategy that wins less than half the time can be profitable. Most statements of the paradox ignore this and reason purely about which event is more likely.
How Does the Two Envelopes Paradox Calculator Work?
You open an envelope showing y. Either it holds X, so X = y, or it holds 2X, so X = y/2. Both readings are consistent with what you see, so the question is which is more likely.
A prior turns that into arithmetic. Each reading gets a weight from the prior density, and the doubled reading carries an extra factor of one half because the map x to 2x stretches the range and flattens the density. Dividing gives P(larger | y).
Switching gains y when you hold the smaller envelope and loses y/2 when you hold the larger one, so the expected gain is P(smaller)·y − P(larger)·y/2 and the break-even probability is two thirds.
The classic argument sidesteps all of this by assuming a uniform distribution over the positive reals, whose density 1/x has an infinite integral. The resulting "probability" grows past 1 as the cutoff climbs, which is the contradiction and also the diagnosis.
Two Envelopes Paradox Calculator Formula & Variables
The core mathematical equation utilized by this calculator is expressed as:
Variable Definitions
| Symbol | Variable Meaning & Units |
|---|---|
| y | the amount written in the envelope you opened |
| X | the unknown smaller amount; the other envelope holds 2X |
| p(x) | the prior density for X |
| P(larger | y) | chance you are holding the 2X envelope, given the amount you see |
| E[gain] | expected change in your amount if you switch |
The amount you see has two readings: the envelope holds X, so X = y, or it holds 2X, so X = y/2. The prior gives each reading a weight, and the second reading carries a factor of one half because doubling X spreads the same probability over twice the range. The switch decision then follows from the payoffs, which are asymmetric: +y when you are right and −y/2 when you are wrong. The final term is the naive argument, and its divergence is the diagnosis.
How to Use the Two Envelopes Paradox Calculator
- Pick what you want to work out: the decision for an amount you have actually seen, the flaw in the classic argument, the behaviour under a scale-invariant prior, or a simulation of many attempts.
- Give the range X is drawn from. This is the only real input to the problem and the one the paradox never mentions, so treat it as the assumption doing all the work.
- Enter the amount from your envelope. The calculator reports the chance you hold the larger envelope, the gain from switching and the loss from a wrong switch, then names the better move.
- Read the Method row as a prior in disguise. Different ranges give different answers, and that variation is the point: the puzzle has no answer until you supply a prior.
Step-by-Step Example Calculation
An envelope showing 6, with X somewhere in [1, 10]
Input Values:
Understanding Your Result
The probability that you hold the larger envelope is the number that organises everything else. Below the prior minimum times two it is zero, in the interior it is a fixed fraction, and above the prior maximum it is one.
The expected gain is measured against keeping the envelope, which is the zero baseline. A negative number means the swap costs you money in expectation, whatever the odds say.
The two-thirds threshold is the difference between the optimal strategy and the intuitive one. The intuitive rule swaps only when you certainly hold the smaller envelope, which leaves profitable swaps on the table.
A small positive expected gain is a statement about the bounds you supplied, not about the envelopes. Widen the range and the evidence gets rarer, so the edge shrinks.
Factors That Affect the Result
- The range of the prior. It decides how often an amount you see can rule one envelope out, which is the only source of information in the problem.
- Which prior you choose. A log-uniform prior makes the interior completely uninformative, while a uniform one gives a fixed 1/3 chance of holding the larger envelope wherever both readings survive.
- Where the amount falls in the range. Near the ends the answer is certain; in the middle it is not.
- The factor between the envelopes. A factor of two makes the two branches look alike to a scale-invariant prior; a larger factor would not.
When Should You Use This Calculator?
- Understanding the standard resolutions of the paradox, including the improper-integral diagnosis.
- Deciding what a prior-free version of the question can and cannot tell you.
- Teaching why some apparently reasonable probability arguments are not.
- Any practical version of the puzzle where the range of the hidden amount really is known.
Assumptions & Limitations
- The result depends entirely on the prior you supply. There is no prior-free answer to this question, which is the whole content of the paradox.
- The puzzle assumes the two envelopes are equally likely to be the one you receive and that the amounts are exactly related by the stated factor.
- It says nothing about who chose X or why. If X is a prize designed to be interesting, that is information the prior has not captured.
- The simulation reports averages over the prior, which is a different quantity from the average a single player experiences, and the two can differ sharply.
Frequently Asked Questions
Calculation Accuracy & Reference Note
The posteriors are ratios of prior densities and the expected gains are closed-form arithmetic, so both are exact up to floating point. The improper integral is evaluated at a finite cutoff, which is precisely why it can exceed 1 while no true probability ever does.
Standard Reference: Mollow, J. (1994), On the two-envelope paradox. Analysis 54 (3), 240–242. Original puzzle attributed to Lewis Carroll and to a 1970 Putnam paper.