Random Variables and Expected Value… · Revision note | StemPy Lab
Statistics & Data ScienceAlso Mathematics
Random Variables and Expected Value: Quick Revision
A brief note on random variables and expected value: probability tables, the expected value as the long-run mean, and the variance and standard deviation of a distribution. With a worked example, practice, a program and questions to check yourself.
A brief note on Random Variables and Expected Value. Read it before a test. Try each question at the end before you open its answer.
Tables
Random variable: a number that comes from chance. Discrete ones count, continuous ones measure.
Distribution: each value x with P(X=x). Each is from 0 to 1, and they add up to 1.
From a survey: the probability of a value is its count divided by the number asked.
Expected value
Formula:E(X)=μ=∑xP(X=x).
Meaning: the mean in the long run. A simulation of many trials settles near it.
Totals: the expected value of a total is the total of the expected values.
Spread
Variance:σ2=∑(x−μ)2P(X=x).
Shortcut:σ2=E(X2)−μ2.
Standard deviation:σ, in the unit of X. It is the population kind.
Changing units: adding a constant leaves σ alone. Multiplying by a multiplies σ by ∣a∣.
A worked example
A made-up hockey team scores 0, 1, 2 or 3 goals in a match with probabilities 0.15, 0.35, 0.3 and 0.2.
Check.0.15+0.35+0.3+0.2=1.
Expected goals.E(X)=0.35+0.6+0.6=1.55 goals.
Spread.E(X2)=0.35+1.2+1.8=3.35, so σ2=3.35−1.552=0.9475 and σ≈0.973 goals.
Practice with new numbers
A program to try
The program checks the worked example with exact fractions.
Mistakes to avoid
A plain average in place of a weighted one.
The most likely value taken as the expected value.
Stopping at the variance when the standard deviation is asked.
Trusting a short simulation to match the expected value.
Check yourself
X is 0, 1 or 2 with probabilities 0.4, 0.3 and 0.3. Find E(X).
Find the variance of the X of question 1.
A random variable has σ=4cm. What is σ in millimetres?
A shop expects 2.5 returns a day. How many should it plan for in 30 days?
Sources
OpenStax, Introductory Statistics, Chapter 4, sections on discrete random variables, their distributions, the expected value and the standard deviation.