hanegreefs.com/Statistics I
Chapter 5 of 10

Randomness and probability

Random phenomena, the law of large numbers, three kinds of probability, the probability rules (complement, addition, multiplication), disjoint versus independent events, conditional probability, joint and marginal probabilities in a contingency table, and probability trees.

Textbook: Ch. 5 (without 5.9, Bayes' rule) · Sessions: Module 5, lecture 7, tutorial 7 · About 60 minutes

Random phenomena and the law of large numbersNeutral

A random phenomenon has outcomes we cannot predict one by one, but that show a regular pattern in the long run. Each attempt is a trial, each result an outcome, a set of outcomes an event, and the set of all possible outcomes the sample space S.

The law of large numbers: when trials are independent, the relative frequency of an event settles down to its probability as the number of trials grows. It says nothing about the short run: after five tails a fair coin is not "due" for heads (that mistaken belief is the gambler's fallacy).

Kind of probabilityWhere it comes fromExample
Empiricallong-run relative frequency35,000 of 100,000 applicants qualified, so P ≈ 0.35
Theoretical (model based)equally likely outcomes: favourable / totalP(rolling a 4) = 1/6
Personal (subjective)a degree of beliefthe chance that gold ends next year above some price

The probability rulesImportant

RuleFormulaCondition
Range0 ≤ P(A) ≤ 1always
TotalP(S) = 1always
ComplementP(not A) = 1 − P(A)always
Addition, disjoint eventsP(A or B) = P(A) + P(B)A and B cannot happen together
General additionP(A or B) = P(A) + P(B) − P(A and B)always
Multiplication, independent eventsP(A and B) = P(A) × P(B)A and B independent
General multiplicationP(A and B) = P(A) × P(B | A)always
Worked example

At least one sale

A salesperson visits four customers. Each buys with probability 0.30, independently of the others. What is the probability of at least one sale?

1

Complement

P(at least one) = 1 − P(none)
2

No sale at one visit

1 − 0.30 = 0.70
3

No sale at all four (independent)

0.704 = 0.2401
4

Answer

1 − 0.2401 = 0.7599
Answer

About a 76% chance of at least one sale. "At least one" is almost always quickest through the complement.

Conditional probability and independenceImportant

Formula
P(B | A) = P(A and B) / P(A)

P(B | A) is the probability of B given that A has happened: the sample space shrinks to the cases in A. Events A and B are independent when knowing that A happened does not change the probability of B: P(B | A) = P(B), which is the same as P(A and B) = P(A) × P(B).

Worked example

Newsletter readers and app users

Among a shop's customers, 35% read the newsletter (A), 50% use the app (B) and 20% do both.

1

Either one

P(A or B) = 0.35 + 0.50 − 0.20 = 0.65
2

Neither

1 − 0.65 = 0.35
3

App use among readers

P(B | A) = 0.20/0.35 ≈ 0.571
4

Independence check

P(A) × P(B) = 0.175, not 0.20, so A and B are dependent
Answer

Newsletter readers use the app more often (57%) than customers in general (50%). The rules lab checks any three numbers.

Common trapDisjoint is not independent. Disjoint events (P(A and B) = 0) with positive probabilities are always dependent: if A happens, B becomes impossible.

Contingency tables and probability treesImportant

A contingency table of counts turns into probabilities by dividing by the grand total. A cell gives a joint probability P(A and B), a row or column total a marginal probability, and a cell divided by its row or column total a conditional probability, exactly the total, row and column percentages of chapter 2.

A probability tree lays out events in stages. The first branches carry P(A) and P(not A); the next branches carry conditional probabilities such as P(B | A). Multiply along a path for the joint probability (general multiplication rule) and add the paths that end in the same event.

Worked example

A quality check

8% of parts are faulty (A). The automatic check flags 85% of faulty parts and wrongly flags 10% of good parts (B = flagged). What share of the flagged parts is actually faulty?

1

Paths into "flagged"

faulty and flagged: 0.08 × 0.85 = 0.068; good and flagged: 0.92 × 0.10 = 0.092
2

P(flagged)

0.068 + 0.092 = 0.160
3

Reverse the condition

P(faulty | flagged) = 0.068/0.160 = 0.425
Answer

Only 42.5% of flagged parts are faulty, because good parts are so much more common. This needs nothing beyond the tree and the definition of conditional probability.

Key takeaways

  • Law of large numbers: long-run relative frequency approaches the probability.
  • Complement: P(not A) = 1 − P(A); use it for "at least one".
  • General addition: subtract P(A and B).
  • General multiplication: P(A and B) = P(A) P(B | A).
  • Independent: P(B | A) = P(B). Disjoint events are never independent (unless a probability is 0).
  • Trees: multiply along a path, add paths with the same end.

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

Multiple choice (10)

Question 1 · Chapter 5

P(A) = 0.4. P(not A) is...

Why: Complement rule.
Question 2 · Chapter 5

P(A) = 0.5, P(B) = 0.3, P(A and B) = 0.1. P(A or B) =

Why: 0.5 + 0.3 − 0.1.
Question 3 · Chapter 5

With the same numbers, P(B | A) =

Why: 0.1/0.5.
Question 4 · Chapter 5

With the same numbers, are A and B independent?

Why: Compare P(A)P(B) with P(A and B).
Question 5 · Chapter 5

Two independent machines each fail on a day with probability 0.05. P(both fail) =

Why: 0.05 × 0.05.
Question 6 · Chapter 5

Same machines: P(at least one fails) =

Why: 1 − 0.952.
Question 7 · Chapter 5

Two events with P(A) = 0.3 and P(B) = 0.4 are disjoint. Then...

Why: P(A and B) = 0, not 0.12.
Question 8 · Chapter 5

A test detects a condition in 90% of users; 12% of non-users also test positive; 8% use. P(positive) =

Why: 0.08 × 0.90 + 0.92 × 0.12.
Question 9 · Chapter 5

Continuing: P(user | positive) is about...

Why: 0.072/0.1824 ≈ 0.395.
Question 10 · Chapter 5

After eight reds in a row on a fair roulette wheel, the chance of black on the next spin...

Why: Spins are independent: no "law of averages" in the short run.

Exam-style open questions (2)

Open question · Chapter 5

Probabilities from a contingency table

Of 400 employees, 160 are in sales; 100 of the sales staff and 90 of the other staff have a company car. Find P(car), P(car | sales) and decide whether "car" and "sales" are independent.

Show the worked outline
  • Cars: 100 + 90 = 190; P(car) = 190/400 = 0.475.
  • P(car | sales) = 100/160 = 0.625.
  • 0.625 differs from 0.475, so having a car depends on working in sales.
Open question · Chapter 5

A probability tree

A firm buys 60% of a component from supplier X and 40% from supplier Y. 3% of X's parts and 6% of Y's parts are defective. Find P(defective) and P(Y | defective).

Show the worked outline
  • Paths: X and defective 0.6 × 0.03 = 0.018; Y and defective 0.4 × 0.06 = 0.024.
  • P(defective) = 0.042.
  • P(Y | defective) = 0.024/0.042 ≈ 0.571.

LabProbability rules lab

The default numbers are the newsletter example.

LabProbability tree lab

The default numbers are the quality check example.