hanegreefs.com/Statistics I
Chapter 6 of 10

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

Formula
E(X) = μ = Σ x P(x)Var(X) = σ2 = Σ (x − μ)2 P(x)SD(X) = σ = √Var(X)

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.

Worked example

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.

1

Check the model

0.70 + 0.20 + 0.07 + 0.03 = 1
2

Expected value

μ = 0(0.70) + 80(0.20) + 250(0.07) + 600(0.03) = 0 + 16 + 17.5 + 18 = 51.5 euro
3

Squared deviations times probabilities

(−51.5)2(0.70) ≈ 1,856.6; (28.5)2(0.20) ≈ 162.5; (198.5)2(0.07) ≈ 2,758.2; (548.5)2(0.03) ≈ 9,025.5
4

Variance and SD

Var(X) ≈ 13,802.75 euro2; SD(X) ≈ 117.5 euro
Answer

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

OperationMeanVarianceSD
X ± cE(X) ± cVar(X)SD(X)
aXa E(X)a2 Var(X)|a| SD(X)
X ± YE(X) ± E(Y)Var(X) + Var(Y) ± 2Cov(X, Y)square root of the variance
X ± Y, independentE(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.

Worked example

Two independent warranty contracts

Total repair cost of two independent contracts like the one above.

1

Mean

51.5 + 51.5 = 103 euro
2

Variance

13,802.75 + 13,802.75 = 27,605.5 euro2
3

SD

√27,605.5 ≈ 166.1 euro, less than 2 × 117.5 = 235 euro
Answer

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.

Common trapX + X is not the same as X1 + X2. Doubling one outcome multiplies the SD by 2; adding two independent outcomes multiplies it by √2.

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:

Formula
P(X = x) = n! / (x!(n − x)!) · px (1 − p)n − xE(X) = np and SD(X) = √(np(1 − p))
Worked example

Sales calls

A call centre agent closes a sale on 20% of calls, independently. Take 10 calls.

1

Conditions

success or no success; p = 0.2 every call; calls independent
2

Exactly 3 sales

C(10, 3) = 120 orders; P(X = 3) = 120 × 0.23 × 0.87 ≈ 120 × 0.008 × 0.2097 ≈ 0.2013
3

At most 2 sales

P(0) + P(1) + P(2) ≈ 0.1074 + 0.2684 + 0.3020 = 0.6778
4

At least 3 sales

1 − 0.6778 = 0.3222
5

Mean and SD

E(X) = 10 × 0.2 = 2 sales; SD(X) = √(10 × 0.2 × 0.8) ≈ 1.26 sales
Answer

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)).

Loading cards
Question
Click, tap or press space to flip
Answer

Multiple choice (10)

Question 1 · Chapter 6

X takes 0, 1, 2 with probabilities 0.5, 0.3, 0.2. E(X) =

Why: 0 + 0.3 + 0.4.
Question 2 · Chapter 6

Same X: Var(X) =

Why: 0.49(0.5) + 0.09(0.3) + 1.69(0.2).
Question 3 · Chapter 6

SD(X) = 4. Then SD(3X − 5) =

Why: The shift does not matter; |3| × 4.
Question 4 · Chapter 6

Independent X and Y with SD 3 and 4. SD(X − Y) =

Why: √(9 + 16).
Question 5 · Chapter 6

Which situation is NOT binomial?

Why: The number of trials is not fixed.
Question 6 · Chapter 6

n = 5, p = 0.1. P(exactly 2 successes) is about...

Why: 10 × 0.01 × 0.729.
Question 7 · Chapter 6

n = 200, p = 0.15. E(X) and SD(X) are...

Why: np = 30; √(200 × 0.15 × 0.85) ≈ 5.05.
Question 8 · Chapter 6

A raffle sells tickets for 2 euro; one in 500 wins 600 euro. Expected net gain per ticket?

Why: 600/500 − 2.
Question 9 · Chapter 6

35% of firms in a region are owned by women. Three are called at random. P(all three owned by women) ≈

Why: 0.353.
Question 10 · Chapter 6

A probability bar chart of X is drawn as a density with bars of width 1. The height of each bar equals...

Why: Area = height × 1 = probability.

Exam-style open questions (2)

Open question · Chapter 6

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).
Open question · Chapter 6

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.