Andrei K. answered 01/07/20
Yale Math PhD: SAT prep, gifted-child math and physics
The formula for the expected winning is [always] the sum in which each term is a possible winning times the probability of getting that winning. In this case, there are N := (150 choose 2) = 150 · 149 / 2 different pairs of envelopes, each pair being as likely to be picked as any other pair, i.e. with probability 1/N. Thus, in forming the above sum, one can just divide by N at the end (1/N is a common factor in each term).
There are (25 choose 2) ways to pick two envelopes with $100 each; the corresponding term in the sum (before we divide by N) is 2 · $100 · (25 choose 2). There are (30 choose 2) ways to pick two envelopes with $150 each; the corresponding term is 2 · $150 · (30 choose 2). Etc., for the other 5 cases of picking two envelopes with the same amount.
There are also 30 · 25 ways to pick an envelope with $150 and another with less (i.e. with $100) and thus win $150; the corresponding term is $150 · 30 · 25. There are 50( 30 + 25 ) ways to pick an envelope with $200 and another with less; the corresponding term is $200 · 50( 30 + 25 ). Etc., for the other 4 cases.
Sum these all up, and divide by N.