Let the random variable X represent your return on the first investment. If I understood the problem description correctly, then there are two possibilities -- either X takes the value -$5000 (you invest $5000 but the investment doesn't "pay off") or X takes the value $20000 (you earn $25000 less your initial investment).
If X is a random variable taking one of n values x1,..., xn then the expected value is:
E[X] = x1 P(X = x1) + ... + xn P(X = xn)
so for this problem
E[X] = -$5000 · P(X = -$5000) + $20000 P(X = $20000)
= -$5000 · (7/10) + $20000 * (3/10)
Similarly, if Y represents the return on the second investment, then Y = -$2000 or Y = $8000 and
E[Y] = -$2000 · P(Y = -$2000) + $8000 P(Y = $8000)
= -$2000 · (3/5) + $8000 · (2/5)
Since E[X] > E[Y], you should choose the first investment opportunity.
All this is based on the assumption you can't get your initial investment back -- if you could then it would change your answer.