Simulate the two envelopes paradox with Monte Carlo trials. Compare switch vs keep strategies, visualize convergence, and understand the probability fallacy.
The Two Envelopes Paradox Simulator lets you explore one of probability theory's most debated puzzles through hands-on Monte Carlo simulation. Two sealed envelopes contain money — one holds X dollars, the other 2X. After picking one, you're offered the chance to switch. A seemingly valid argument says switching always increases your expected payout by 25%. But that can't be right if both players are told to switch!
This calculator simulates thousands of envelope games, tracking the average payout under three strategies: always switch, always keep, and random choice. As the simulation runs, you can watch the running averages converge to the same theoretical value — proving the switching argument is fallacious.
The detailed analysis mode breaks down the paradox step by step, identifying exactly where the reasoning goes wrong: applying equal 50/50 probabilities to the conditional scenario after observing a specific amount. The resolution involves understanding that you cannot simultaneously define the problem symmetrically and then reason asymmetrically about the observed value.
The Two Envelopes Paradox is a powerful teaching tool for understanding conditional probability, expected value, and the role of prior distributions. Unlike dry proofs, this simulator lets you see the resolution empirically — watching two supposedly different strategies converge to identical payouts.
Students in probability courses use it to grasp why E[X|observed info] requires specifying a prior distribution. Decision theorists use it to illustrate how seemingly rational arguments can lead to absurd conclusions. The step-by-step paradox breakdown identifies the exact logical error that makes the switching argument fail.
Envelopes: {X, 2X}. E[any envelope] = (X + 2X)/2 = 1.5X. The fallacious argument: E[switch | see A] = 0.5(2A) + 0.5(A/2) = 1.25A. Resolution: the 50/50 split is incorrect after conditioning on A.
Result: Switch avg: ~150.0, Keep avg: ~150.0, Advantage: ~0.0
With X = 100, envelopes are {100, 200}. Both strategies yield E = 1.5 × 100 = 150 on average. Over 10,000 trials, the empirical averages converge to this theoretical value, demonstrating that switching provides no real advantage.
The Two Envelopes Problem has roots in the "Exchange Paradox" described by mathematician Maurice Kraitchik in 1953. It gained prominence through a 1989 paper by Barry Nalebuff and has since generated hundreds of academic papers. The paradox touches on deep issues in probability theory, decision theory, and the foundations of Bayesian reasoning.
The resolution relies on understanding that the statement "the other envelope has 2A or A/2 with equal probability" implicitly requires a prior distribution where all amounts are equally likely — a so-called improper uniform prior over all positive real numbers. Such a distribution cannot exist (it doesn't integrate to 1), which is why the derived expected value is meaningless.
The Two Envelopes Paradox belongs to a family of probability paradoxes involving self-referential reasoning. Related problems include the St. Petersburg Paradox (infinite expected value), the Surprise Examination Paradox (self-defeating predictions), and the Necktie Paradox (a simpler version of the same switching fallacy). Understanding one helps illuminate the others.
The argument assumes that if you see amount A, there's a 50/50 chance the other envelope has 2A or A/2. But these probabilities aren't both 50% — they depend on the prior distribution of X. Without specifying the prior, the 1.25A calculation is meaningless.
Both are switching paradoxes, but they're fundamentally different. In Monty Hall, the host provides information by opening a door, making switching correct. In the two envelopes, no information is gained — both envelopes are symmetrical, so switching doesn't help.
Even after peeking, switching doesn't help in the standard problem. The key insight is that without knowing the distribution of X, you can't determine which envelope you're holding. The paradox arises from treating every observed amount as equally likely.
Yes, with specific non-uniform prior distributions for X. If you know X follows a particular distribution (e.g., uniform from 1 to 100), and you see a specific amount, you CAN compute correct conditional probabilities. The paradox exists only when no prior is specified.
The simulator uses a seeded pseudo-random number generator (Mulberry32) so results are reproducible. Despite being deterministic, the long-run averages converge to the correct expected values, demonstrating the mathematical truth behind the paradox resolution.
The chart tracks the running average payout for switch and keep strategies as trials accumulate. Both lines converge to the same value (1.5X), visually proving that neither strategy has a long-run advantage. More trials produce smoother convergence.