Two Envelopes Problem

You are given 2 envelopes which are exactly the same and are told that one envelope has twice as much money as the first. You open the first envelope and find that there is \$10 inside. Should you switch or should you take the \$10, if you want to maximise your earnings?

In this case, we think that it does not make a difference if we switch or not, but actually, it does.

Case 1:
You took the envelope with more money.
The envelope with less money has $5.

Case 2:
You took the envelope with less money.
The envelope with more money has $20.

Expected value = (Case 1 + Case 2)/2
= $12.50

Hence you should switch!

*Update: a reader spotted a fallacy in this, can you decipher what it is?