Beginner Topic 13 of 51 Math for Computing
Expected Value
Probability-weighted average outcome.
How it works
The expected value, or mean, of a random variable is the probability-weighted average of its possible values: the sum of x times P(x) for discrete variables or the integral of x times f(x) for continuous ones. By linearity of expectation, the expected value of a sum equals the sum of the expected values, even when variables are dependent, which simplifies many calculations. It represents the long-run average over many repetitions, not necessarily a value that will occur.
Where it is used
Analyzing randomized algorithms such as expected running time of quicksort, decision-making in games and finance, insurance pricing, hashing and load analysis and machine-learning risk minimization use expected values.
Common pitfall
The expected value may not exist for heavy-tailed distributions, and it can be misleading when variance is large, such as a lottery with positive expectation but a rare payoff. The expectation of a product equals the product of expectations only for independent variables. The expectation of a function is not the function of the expectation, except for linear functions. Combine with variance and quantiles.
Where it fits in the course
Expected Value is topic 13 of 51 in Math for Computing, rated Beginner. It follows Random Variables. The next topic is Mean, Median and Mode.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Math for Computing quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Math for Computing quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Expected Value?
Where do people use Expected Value?
What is the most common mistake with Expected Value?
What should I learn before this topic?
How can I practice it?
Is Expected Value hard to learn?
How long does it take to learn Expected Value?
Which topics are related to Expected Value?
What should I study after Expected Value?
Related topics
- Random Variables (Math for Computing)
- Mean, Median and Mode (Math for Computing)
- Probability Basics (Math for Computing)
- Variance and Standard Deviation (Math for Computing)
- Pass by Value vs Reference (Programming Fundamentals)
- Key-Value Stores (Databases)