>>11270119Let's say the prior probability of smaller envelope having x is P(x). Then prior probability of 5,10 is P(5) and probability of 10, 20 is P(10).
Conditional probability of 5,10 given that we saw a 10 is P(5) / (P(5) + P(10))
Conditional probability of 10,20 given that we saw a 10 is P(10) / (P(5) + P(10))
In the case of 5,10 we lose 5.
In the case of 10,20 we gain 10.
The sought expectation is
-5 P(5) / (P(5) + P(10)) + 10 P(10) / (P(5) + P(10))