You can put this solution on YOUR website! Intuitively, expected value is the value that you "expect" to obtain for a trial involving a random variable (or the average value if you repeat this trial indefinitely). For example, if you have a 1/100 chance of winning $200 and a 99/100 chance of losing $5 in a bet, your expected value is
(1/100)(200) + (99/100)(-5) = -2.95
This means that you expect to lose 2.95 on average.
The expected value is defined as
, in other words, the weighted average of the probabilities. Note that the random variable has to be numerical, e.g. P(6 on a die roll), not P(boy).