Curriculum
Login

Curriculum

Mathematics

Text lesson

Statistics, Conditional Probability and Random Variables

Mathematics

Statistics, Conditional Probability and Random Variables

Basic probability and events

Basic probability and events

  • An experiment is an action with a set of possible results.
  • The set of all possible results is the sample space, written S.
  • An event is any subset of S.
  • If all results are equally likely, the probability of an event E is the number of favourable outcomes divided by the total number of outcomes:

P(E) = n(E) ÷ n(S)

  1. Every probability lies between 0 and 1. The probability of the complement of an event A
  2. written A′
  3. is:

P(A′) = 1 − P(A)

  1. For two events A and B
  2. the addition rule is:

P(A ∪ B) = P(A) + P(B) − P(A ∩ B)

  • The term P(A ∩ B) is subtracted because outcomes in both events were counted twice.
  • If A and B cannot happen together (mutually exclusive events), then P(A ∩ B) = 0 and the rule becomes P(A ∪ B) = P(A) + P(B).

Reading a statistics table

  • Data about a class or a survey is often given in a two-way table.
  • Before finding a probability, decide which total is the sample space.
  • For example, if 40 students are asked about sports, the total 40 is the denominator for any probability about a random student, but a smaller total is needed when the question starts with a condition.
Statistics, Conditional Probability and Random Variables · 1 / 7
Conditional probability and independence

Conditional probability and independence

  • Conditional probability is the probability of an event A when we already know that another event B has happened.
  • It is written P(A | B), read as “the probability of A given B”.
  • The formula is:
Statistics, Conditional Probability and Random: a bag of 3 red and 2 blue balls shows conditional probability: the chance of a second red after a first red is 2/4.
Statistics, Conditional Probability and Random: a bag of 3 red and 2 blue balls shows conditional probability: the chance of a second red after a first red is 2/4.

P(A | B) = P(A ∩ B) ÷ P(B), where P(B) > 0

  • The idea is that once B has happened, the sample space shrinks from S to B. Only the part of A that lies inside B still matters.
  • The multiplication rule follows from the same formula:

P(A ∩ B) = P(B) × P(A | B)

  • Two events A and B are independent when knowing that one has happened does not change the probability of the other.
  • This is tested by:

P(A ∩ B) = P(A) × P(B), or equivalently,

  • P(A | B) = P(A), when P(B) > 0.
  • Tree diagrams help when the events happen in stages.
  • Multiply along each branch, then add the branches that give the event you want.
  • When the first draw is not replaced, the probabilities of the second stage depend on the first result, so they must be updated.
Statistics, Conditional Probability and Random Variables · 2 / 7
Discrete random variables

Discrete random variables

  • A random variable is a rule that gives a number to each outcome of a random experiment.
  • It is discrete when its possible values can be listed, such as 0, 1, 2, 3.
  • A probability distribution lists each value x with its probability P(X = x).
  • Two checks are always needed:
  • Each probability satisfies 0 ≤ P(X = x) ≤ 1.
  • The probabilities add to 1, so the sum of all P(X = x) equals 1.

Expected value (mean)

  1. The expected value of X
  2. written E(X) or μ
  3. is a weighted average of the values:

E(X) = Σ x × P(X = x)

  • E(X) is the long-run average of X over many repetitions.
  • It is not always a value that X can actually take.
  • For example, the expected number of heads in two coin tosses is 1, although 1 is one of the possible values.

Variance and standard deviation

  • The variance measures how far the values spread around the mean. It can be found in two equal ways:
  • Var(X) = Σ (x − μ)2 × P(X = x) = E(X2) − μ2
  1. Here E(X2) = Σ x2 × P(X = x). The standard deviation is σ = √Var(X)
  2. and it has the same unit as X.
Statistics, Conditional Probability and Random Variables · 3 / 7
Binomial and normal-type distributions

Binomial and normal-type distributions

The binomial distribution

  • A binomial experiment has a fixed number of trials n, each trial has only two outcomes (success or failure), the trials are independent, and the probability of success p is the same in every trial.
  • If X is the number of successes, then for k = 0, 1, …, n:

P(X = k) = C(n, k) × pᵏ × (1 − p)n−ᵏ

  1. The mean of a binomial distribution is μ = np
  2. and its variance is np(1 − p).

Normal-type (bell-shaped) distributions

  • Many measured quantities, such as heights or test scores, form a symmetric bell-shaped curve.
  • Such a distribution is described by its mean μ and standard deviation σ.
  • For a normal distribution, about 68% of the values lie within one standard deviation of the mean, about 95% within two, and about 99.7% within three.
  • The z-score of a value x is:

z = (x − μ) ÷ σ

  • A z-score tells how many standard deviations x is above or below the mean.
  • Positive z means above the mean, and negative z means below it.
Statistics, Conditional Probability and Random Variables · 4 / 7
Worked examples

Worked examples

Comparison aspectMain ideaKeywords
Example 1 (basic probability).A bag has 4 red and 6 blue balls. One ball is picked at random. Find P(red)blueballsballpicked
Solution
  • n(S) = 4 + 6 = 10 and n(red) = 4. So P(red) = 4 ÷ 10 = 2/5. Check: P(blue) = 6/10 = 3/5
  • and 2/5 + 3/5 = 1
Checkblue
Example 2 (complement and addition).
  • In a group
  • P(A) = 0.6
  • P(B) = 0.5 and P(A ∩ B) = 0.2. Find P(A ∪ B) and P(A′)
groupFind
SolutionP(A ∪ B) = 0.6 + 0.5 − 0.2 = 0.9. Also P(A′) = 1 − 0.6 = 0.4
Example 3 (conditional probability).
  • Among 40 students
  • 25 play football
  • 18 play basketball and 10 play both. Find P(basketball | football)
Amongstudentsplayfootball
Solution
  • The condition is football
  • so only the 25 football players form the new sample space. Those who also play basketball are 10. So P(basketball | football) = 10 ÷ 25 = 2/5. Note that P(football | basketball) = 10 ÷ 18 = 5/9 is a different number
conditionfootballplayersform
Comparison aspectMain ideaKeywords
Example 4 (independence).
  • P(A) = 0.3
  • P(B) = 0.5 and P(A ∩ B) = 0.15. Are A and B independent?
independent
SolutionP(A) × P(B) = 0.3 × 0.5 = 0.15 = P(A ∩ B). So A and B are independentindependent
Example 5 (two draws without replacement).A box has 3 red and 2 blue balls. Two balls are drawn one after the other without replacement. Find the probability that both are redblueballsdrawnafter
Solution
  • The first draw gives P(red) = 3/5. After one red ball is removed
  • 2 red balls remain out of 4. So P(second red | first red) = 2/4. The multiplication rule gives 3/5 × 2/4 = 3/10
firstdrawgivesAfter
Example 6 (expected value and variance).
  • Two fair coins are tossed and X is the number of heads. The probabilities are P(0) = 1/4
  • P(1) = 1/2 and P(2) = 1/4. Find E(X) and Var(X)
faircoinstossednumber
Comparison aspectMain ideaKeywords
SolutionE(X) = 0 × 1/4 + 1 × 1/2 + 2 × 1/4 = 1. Then E(X2) = 0 × 1/4 + 1 × 1/2 + 4 × 1/4 = 3/2. So Var(X) = 3/2 − 12 = 1/2Then
Example 7 (binomial probability).
  • A fair coin is tossed 4 times. Find the probability of exactly 2 heads
  • and the mean and variance of the number of heads
faircointossedtimes
Solution
  • n = 4
  • p = 1/2. P(X = 2) = C(4
  • 2) × (1/2)2 × (1/2)2 = 6 × 1/16 = 3/8. The mean is np = 4 × 1/2 = 2
  • and the variance is np(1 − p) = 4 × 1/2 × 1/2 = 1
meanvariance
Example 8 (harder discrete distribution).
  • A random variable X takes the values 0
  • 3 with probabilities k
  • 3k and 4k. Find k
  • E(X) and Var(X)
randomvariabletakesvalues
Solution
  • The probabilities add to 1
  • so 10k = 1 and k = 0.1. Then E(X) = 0 × 0.1 + 1 × 0.2 + 2 × 0.3 + 3 × 0.4 = 2. Next
  • E(X2) = 0 + 0.2 + 4 × 0.3 + 9 × 0.4 = 5. So Var(X) = 5 − 22 = 1
probabilitiesThenNext
Comparison aspectMain ideaKeywords
Example 9 (normal-type data).
  • The heights of students are approximately normal with mean 150 cm and standard deviation 6 cm. Find the z-score of a student who is 162 cm tall
  • and say roughly what percentage of students are between 144 cm and 156 cm
heightsstudentsapproximatelymean
Solution
  • z = (162 − 150) ÷ 6 = 2. A student 2 standard deviations above the mean is at the upper edge of the usual range. The interval 144 to 156 is within one standard deviation of the mean
  • so about 68% of students are in that range
studentstandarddeviationsabove
Statistics, Conditional Probability and Random Variables · 5 / 7
Common mistakes

Common mistakes

  • Reversing the condition. P(A | B) is not the same as P(B | A). In Example 3 the two values are 2/5 and 5/9.
  • Multiplying probabilities for events that are not independent. Without replacement, the second probability changes after the first draw.
  • Forgetting that the probabilities of a distribution must add to 1. Always check this before finding E(X).
  • Using E(X2) as the variance, or forgetting to subtract μ2. The variance is E(X2) − μ2, not E(X2).
  • Using p in the binomial formula where 1 − p is needed for failures. The exponent of (1 − p) is n − k, not k.
Statistics, Conditional Probability and Random Variables · 6 / 7
Lesson summary

Lesson summary

  • Probability of an event is favourable outcomes divided by all outcomes, when outcomes are equally likely.
  • P(A ∪ B) = P(A) + P(B) − P(A ∩ B), and P(A′) = 1 − P(A).
  • Conditional probability P(A | B) = P(A ∩ B) ÷ P(B). Events are independent when P(A ∩ B) = P(A) × P(B).
  • For a discrete random variable, E(X) = Σ x P(X = x) and Var(X) = E(X2) − [E(X)]2.
  • A binomial distribution with n trials and success probability p has mean np and P(X = k) = C(n, k) pᵏ (1 − p)n−ᵏ.
  • A z-score z = (x − μ) ÷ σ measures how far a value is from the mean in standard deviations.
Statistics, Conditional Probability and Random Variables · 7 / 7