If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Mean (expected value) of a discrete random variable

We can calculate the mean (or expected value) of a discrete random variable as the weighted average of all the outcomes of that random variable based on their probabilities. We interpret expected value as the predicted average outcome if we looked at that random variable over an infinite number of trials.

## Want to join the conversation?

• Why didn't we divide by the number of observations when taking the mean of the random variable? •   The expected value of a random function is like its average. We see that in the calculation, the expectation is calculated by multiplying each of the values by its relative frequency. Notice, however, that the relative frequency is the frequency divided by the total number of observations. So, in reality, we did divide by the total number of expectations, it was just embedded in the relative frequency.

• Hi. I don't understand why the value 0 is not important in the calcul of the mean. If the probability of 0 is .9, the mean is not impacted? • A confusing question , what if we have a continuous probability distribution
i mean how can we get the mean? • Nice question!

If X is a continuous random variable and we are given its probability density function f(x), then the expected value (or mean) of X, E(X), is given by the formula

E(X) = integral from -infinity to infinity of xf(x) dx.

(Note: if f(x) is nonzero only on a bounded interval such as [a,b], then the above integral is equivalent to integrating x times the nonzero portion of f(x) just on the interval [a,b] rather than on the entire interval (-infinity, infinity). This is because the integral of x times the zero function, for x in (-infinity, infinity) but not in the interval [a,b], is zero.)

Have a blessed, wonderful day!
• Couldnt understand what Expected value of (X) means.
how is expected value equal to mean?
Does it mean that in a week ill be working out for 2.1 times on an average considering the probabilities? • Where does randomness come into this? How are these random variables? • Random variables are outcomes related to random processes. So for number of outcomes in a week to generate random variables, one has to assume that on any given day, one decides to exercise or not randomly. In reality, one decides based on his schedule that may vary systematically and hence difficult to be random. But we can imagine that it is a random process for the sake of this video
• Hi !
I could not understand the concept of Expected values in the case of example of flood insurance, a woman has to pay for 600 dollars and insurance cost is 50,000 dollars. she estimates there are 2% chances of flooding this year. Find the expected value of buying this flood insurance this year. , The solution is 400\$ .

So , In this case what does this expected value of buying flood insurance (400\$) means ,intuitively ?
(1 vote) • Expected value is, roughly, the average cost or payout of something. If you play a game where you toss a coin and win a dollar on heads and lose a dollar on tails, you would expect to come out with a net \$0 gain/loss in the long run. But if you win a dollar on heads and lose \$10 on tails, you would expect to lose money in the long run, so the expected value is negative.

We compute the expected value like this:
1. List out all possible outcomes
2. For each outcome, determine its probability and the payout/loss for if it occurs
3. For each outcome, multiply its probability by its payout
4. Add all of these numbers together

So for the first coin game, there is a 0.5 probability of winning \$1, and a 0.5 probability of losing \$1. So the expected value is
0.5(1)+0.5(-1)=0.

For the second coin game, the expected value is
0.5(1)+0.5(-10)=-4.5

which means that if you play the second game a lot, you will expect to lose a total of (\$4.50)·(number of plays) in the end.

For your flood insurance problem, it's not obvious whether the expected value is positive or negative, because you have a very small chance of winning a lot of money, and a high chance of losing a little (the \$600 cost).

But we can compute the expected value: there is a 98% chance that nothing happens and you just pay \$600, and a 2% chance that you earn a total of \$50,000-600=\$49,400. So the expected value of the insurance is
0.98(-600)+0.02(49400)=\$400.

This means that, if one woman buys insurance every year and another doesn't, we expect, in the long run, that the buying woman will have about \$400 per year more than the non-buyer.
• I understood how to compute expected value, but still cannot understand intuitively why probability weighted mean becomes expected value.

Is it because a value converges to a mean after we do many trials (say 10,000 times) as we seen in the previous video (Experimental versus theoretical probability simulation)? • Yes, think of expected value as the expected average value after 𝑛 trials.
It makes more sense that way.

For example, if we had a six-sided die with probabilities
𝑃(1) = 𝑃(2) = 𝑃(3) = 𝑃(4) = 𝑃(5) = 0.1 and 𝑃(6) = 0.5

Then after 50 trials we could expect to have rolled
five 1's, five 2's, five 3's, five 4's, five 5's and twenty-five 6's.

Thus the expected value (again, think of it as expected average value) is
(5⋅1 + 5⋅2 + 5⋅3 + 5⋅4 + 5⋅5 + 25⋅6)∕50
= 5⋅1∕50 + 5⋅2∕50 + 5⋅3∕50 + 5⋅4∕50 + 5⋅5∕50 + 25⋅6∕50
= 0.1⋅1 + 0.1⋅2 + 0.1⋅3 + 0.1⋅4 + 0.1⋅5 + 0.5⋅6
= 𝑃(1)⋅1 + 𝑃(2)⋅2 + 𝑃(3)⋅3 + 𝑃(4)⋅4 + 𝑃(5)⋅5 + 𝑃(6)⋅6,
which is the weighted probability mean.
• At , "weighted sum".

Is "weighted sum" the same as "weighted average"? • What does the d stand for in the formula for the expected value? xf(x)dx • I keep on hearing, "weighted sum" in several videos but never thoroughly understood it. Can someone explain it to me, please?
(1 vote) • The probability of a certain outcome is sometimes referred to as the "weight" of that outcome.

For example, a six-sided die has six possible outcomes:
1, 2, 3, 4, 5, or 6.

The weights of those outcomes are
𝑃(1), 𝑃(2), 𝑃(3), 𝑃(4), 𝑃(5), and 𝑃(6).

The expected value is calculated as the weighted sum of all the possible outcomes:
1⋅𝑃(1) + 2⋅𝑃(2) + 3⋅𝑃(3) + 4⋅𝑃(4) + 5⋅𝑃(5) + 6⋅𝑃(6)

If the die is fair all the weights are equal to 1∕6, and the weighted sum is equal to the arithmetic mean of the outcomes:
(1 + 2 + 3 + 4 + 5 + 6)∕6 = 3.5