This problem causes us to confuse prior (before information is learned) and posterior (after information is learned) probabilities. The prior probability that A has the lower amount is 1/2. The same posterior probability is:
Pr(A=x & B=2x)/[Pr(A=x & B=2x) + Pr(A=x & B=x/2)].

The posterior probability that A has the higher amount is:
Pr(A=x & B=x/2)/[Pr(A=x & B=2x) + Pr(A=x & B=x/2)].

These are the expressions you must use in the expectation under "What if you open envelope A?". In general, they can't both be 1/2 - your benefactor would have to possess an infinite supply of money.

## Formula still wrong.

This problem causes us to confuse prior (before information is learned) and posterior (after information is learned) probabilities. The prior probability that A has the lower amount is 1/2. The same posterior probability is:

Pr(A=x & B=2x)/[Pr(A=x & B=2x) + Pr(A=x & B=x/2)].

The posterior probability that A has the higher amount is:

Pr(A=x & B=x/2)/[Pr(A=x & B=2x) + Pr(A=x & B=x/2)].

These are the expressions you must use in the expectation under "What if you open envelope A?". In general, they can't both be 1/2 - your benefactor would have to possess an infinite supply of money.