Problem. Two envelopes hold and . You pick one uniformly at random and see . “The other one holds or with probability each, so it is worth : always switch.” The same argument applied to the other envelope says to switch back. Where is the error?

Answer. The step ” or with probability each, for every ” is false for every probability distribution on . Once a real prior is used, the answer depends on ; without looking, switching gains nothing; with a prior of finite mean, switching cannot gain for every ; and a randomized threshold beats against every prior.

SituationConclusion
no information usedstaying and switching both give in expectation (symmetry)
prior on , you see switch iff
” / for every “needs a uniform distribution on all of , which does not exist
prior with switching cannot have positive conditional gain for every
Broome’s prior , conditional gain for every (and for ), but
unknown prior, random threshold with positive density (Cover)switch iff : win probability

Where the argument breaks

Let be the prior on the smaller amount. Seeing , you hold the smaller envelope with posterior probability

and the expected gain of switching is , positive iff . The paradox silently assumes for all .

// prior p[k] = P(smaller amount = 2^k), k = 0..K-1; you see x = 2^k. Returns E[other - x | x].
double switchGain(const vector<double>& p, int k) {
    double small = k < sz(p) ? p[k] : 0;           // you hold the smaller: smaller = 2^k
    double big = k > 0 ? p[k - 1] : 0;             // you hold the larger: smaller = 2^(k-1)
    double x = ldexp(1.0, k), ps = small / (small + big);
    return ps * x - (1 - ps) * x / 2;
}
 
// Cover's randomized switching: threshold T ~ Exp(1); switch iff x < T. Returns the empirical win rate for smaller amount a.
double coverWinRate(double a, int trials, mt19937_64& rng) {
    exponential_distribution<double> T(1.0); int win = 0;
    for (int t = 0; t < trials; t++) {
        bool holdSmall = rng() & 1; double x = holdSmall ? a : 2 * a;
        bool sw = x < T(rng);
        win += (holdSmall != sw) ? 0 : 1;          // end with 2a iff (hold small and switch) or (hold big and stay)
    }
    return double(win) / trials;
}