Expected Value

The expected value of a random variable with values `x_1, x_2,..., x_n` is $$E = x_1 P \left( X = x_1 \right) + x_2 P \left( X = x_2 \right) + ...+ x_n P \left( X = x_n \right)$$


There are 5 marbles in a jar: 2 are blue, 3 are red. You pick a marble randomly. If it is blue, you earn \$2, otherwise you lose \$1.