The two-envelope paradox
There are two envelopes, both containing money. One envelope has exactly twice the amount of money as the other. You can keep the money inside the envelope that you choose.
You pick one of the envelopes and open it. Inside is $20. Should you switch envelopes?
Since one envelope contains twice as much as the other, this means that the other envelope has either $10 or $40, and there is a 50% chance of either. If you switch you will either lose $10 or gain $20, so it makes sense to switch.
The probability calculation could be seen as ½ (2A) + ½ (A/2) = 5/4 A where A is the amount in the envelope. This is greater than A so you gain on average by swapping.
However, if you had originally chosen the other envelope, the same reasoning would lead you to switch to the envelope you’re holding now. That is, if the original envelope chosen held $10 you would reason that the other has either $5 or $20. You would either lose $5 or gain $10, so it makes sense to switch. The probability calculation is the same.
This is paradoxical as it says that it doesn’t matter which envelope you choose initially – you should always switch!
What’s going on?
The problem is the equation. The variable A stands for different things at different places. In the first term A is the smaller amount while in the second term A is the larger amount.
Let the smaller amount be X then by definition the larger is 2X. The probability calculation becomes ½ (2X) + ½ X = 3/2 X. So 1.5X is the average expected value in either of the envelopes and, being less than 2X, there is no reason to swap the envelopes.
There is a lot of discussion on the web, some using Bayes Theorem, which you might find interesting.