Random variables and probability models
Discrete and continuous random variables, probability models, expected value, variance and standard deviation, the rules for shifting, rescaling and adding random variables, the uniform model, Bernoulli trials and the binomial model with its mean and standard deviation.
Textbook: Ch. 6 (without the geometric and Poisson models) · Sessions: Module 6, lectures 8 and 9, tutorials 8 and 9 · About 65 minutes
Random variables and probability modelsImportant
A random variable X assigns a number to each outcome of a random phenomenon. It is discrete when you can list its possible values (number of defects: 0, 1, 2, ...) and continuous when it can take any value in an interval (a waiting time). Capital X names the variable; small x is a particular value.
A probability model for a discrete X lists every value x with its probability P(X = x); the probabilities add up to 1. In a probability bar chart drawn as a density, the area of each bar equals its probability, so the height is a probability per unit on the horizontal axis.
Expected value and standard deviationImportant
The expected value is the long-run average outcome over many repetitions, not necessarily a value X can take. The standard deviation is the typical distance of an outcome from that average: a measure of risk.
An extended warranty
A shop sells a warranty on washing machines. The repair cost X (euro) per contract is 0 with probability 0.70, 80 with 0.20, 250 with 0.07 and 600 with 0.03.
Check the model
Expected value
Squared deviations times probabilities
Variance and SD
On average a contract costs the shop 51.5 euro in repairs, but single contracts vary a lot (SD ≈ 117.5 euro). A price above 51.5 euro covers the repairs in the long run.
Shifting, rescaling and addingImportant
| Operation | Mean | Variance | SD |
|---|---|---|---|
| X ± c | E(X) ± c | Var(X) | SD(X) |
| aX | a E(X) | a2 Var(X) | |a| SD(X) |
| X ± Y | E(X) ± E(Y) | Var(X) + Var(Y) ± 2Cov(X, Y) | square root of the variance |
| X ± Y, independent | E(X) ± E(Y) | Var(X) + Var(Y) | √(Var(X) + Var(Y)) |
Adding a constant moves the centre but not the spread; multiplying stretches both. For independent variables variances add, even when you subtract the variables: a difference is just as uncertain as a sum.
Two independent warranty contracts
Total repair cost of two independent contracts like the one above.
Mean
Variance
SD
Standard deviations never add; variances of independent variables do. Compare with 2X (one contract counted twice): SD(2X) = 2 × 117.5 = 235 euro, because 2X has no averaging out.
Uniform and binomial modelsImportant
In a discrete uniform model every value is equally likely, such as the six faces of a fair die (each 1/6, mean 3.5).
Bernoulli trials satisfy three conditions (learn them: they are not on the formula sheet): (1) each trial has two outcomes, success or failure; (2) the probability of success p is the same in every trial; (3) the trials are independent. When sampling without replacement, independence is close enough if the sample is less than 10% of the population.
The binomial model gives the probability of exactly x successes in n Bernoulli trials:
Sales calls
A call centre agent closes a sale on 20% of calls, independently. Take 10 calls.
Conditions
Exactly 3 sales
At most 2 sales
At least 3 sales
Mean and SD
TI-84: binompdf(10, 0.2, 3) ≈ 0.2013 and binomcdf(10, 0.2, 2) ≈ 0.6778. In R: dbinom(3, 10, 0.2) and pbinom(2, 10, 0.2).
Key takeaways
- Discrete: listable values; continuous: any value in an interval.
- E(X) = ΣxP(x); Var(X) = Σ(x − μ)2P(x); SD = √Var.
- Shift: mean moves, SD stays; scale by a: mean and SD times a (SD times |a|).
- Independent X and Y: variances add for sums and differences.
- Bernoulli: two outcomes, constant p, independent trials (10% condition).
- Binomial: E = np, SD = √(np(1 − p)).
Multiple choice (10)
X takes 0, 1, 2 with probabilities 0.5, 0.3, 0.2. E(X) =
Same X: Var(X) =
SD(X) = 4. Then SD(3X − 5) =
Independent X and Y with SD 3 and 4. SD(X − Y) =
Which situation is NOT binomial?
n = 5, p = 0.1. P(exactly 2 successes) is about...
n = 200, p = 0.15. E(X) and SD(X) are...
A raffle sells tickets for 2 euro; one in 500 wins 600 euro. Expected net gain per ticket?
35% of firms in a region are owned by women. Three are called at random. P(all three owned by women) ≈
A probability bar chart of X is drawn as a density with bars of width 1. The height of each bar equals...
Exam-style open questions (2)
A small investment
A one-year investment of 1,000 euro returns −200 euro with probability 0.2, 50 euro with 0.5 and 300 euro with 0.3. Find the expected return and its standard deviation, and the expected value and SD for an investor who puts in 5,000 euro (five times the amounts).
Show the worked outline
- E = −40 + 25 + 90 = 75 euro.
- Var = (−275)2(0.2) + (−25)2(0.5) + 2252(0.3) = 15,125 + 312.5 + 15,187.5 = 30,625 euro2; SD = 175 euro.
- Five times the amounts: E = 375 euro, SD = 875 euro (aX rule).
Binomial or not, then compute
A webshop knows that 8% of orders are returned. Take 15 independent orders. Check the binomial conditions, then find P(no returns) and P(at least 2 returns).
Show the worked outline
- Two outcomes, p = 0.08 constant, independent orders: binomial with n = 15.
- P(0) = 0.9215 ≈ 0.2863.
- P(1) = 15 × 0.08 × 0.9214 ≈ 0.3734.
- P(at least 2) = 1 − 0.2863 − 0.3734 ≈ 0.3403.
LabRandom variable lab
The default numbers are the warranty example.
LabBinomial lab
The default numbers are the sales call example.
LabModel sorter
Practise the conditions before the formulas.