Week10class1 Solution
Week10class1 Solution
Term 3, 2024
1 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
Outline
3 Extra notes
2 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
Definition
Let X1 , X2 , . . . , Xn be random variables. The sample mean of
these random variables is defined as
n
1X
X̄n := Xi .
n
i=1
When the context is clear, we may use the simpler notation X̄.
Definition
Let X1 , X2 , . . . , Xn be random variables. If these random variables
are independent and all have the same distribution, then they are
said to be independent and identically distributed (i.i.d.).
4 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
Activity 1 (5 minutes)
σ2
E(X̄n ) = µ, Var(X̄n ) = .
n
5 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
Activity 1 (solution)
6 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
Activity 1, interpretation
8 / 30
Law of large numbers Central limit theorem Extra notes Definitions LLN
In words, the LLN states that for any positive margin ϵ (no
matter how small), as n (the ‘sample size’) get arbitrarily large,
the probability that X̄n is within ϵ of µ approaches 1.
The law of large numbers is a very important result and has many
implications. One implication is that the empirical frequency of
any repeatable event converges to its theoretical probability.
The LLN does not make any assumptions about the variance σ 2 of
the Xi ’s. When σ 2 < ∞, the result in the next section (central
limit theorem) is more useful, in that it describes the distribution
of X̄n around µ, and makes it simple to sum the Xi ’s.
10 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Outline
3 Extra notes
11 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
12 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
X̄n − µ
√ ≈ N (0, 1) = Z, (1)
σ/ n
σ2
X̄n ≈ N µ, , (2)
n
Xn
Xi ≈ N (nµ, nσ 2 ). (3)
i=1
Visualization
CLT, continued
Recall from last class that the sum of any n independent normal
RV’s is exactly normal. The CLT can be thought of as extending
this result to other i.i.d. random variables, except now n needs to
be large and the resulting normality is only approximate.
Example
Example
An unloaded dice is rolled 100 times; find the probability that the
sum of all the dice rolls is less than or equal to 330.
Solution: Let Xi be the outcome of the ith dice roll, and let
100
X
Y = Xi be the sum of all the dice rolls. The Xi ’s are clearly
i=1
i.i.d., and n = 100 is large, so the CLT may be applied.
17 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Example, continued
Now, by formula (3) of the CLT, Y is approximately normal with
mean 100 × 27 and variance
100 × 35
12 , that is, Y ≈ X where
X ∼ N 350, 3500/12 .
Note that Y is discrete but X is continuous, so we should apply a
continuity correction when approximating Y by X. We get
This agrees with the exact probability to 3 decimal places, but is far
easier to compute. In fact, even finding the exact pmf for the sum
of (say) 4 dice rolls is hard, let alone 100 rolls. (So, paradoxically,
it is easier to find probabilities for 100 rolls than it is for 4 rolls.)
18 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
19 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Activity 2 (solution)
21 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Activity 3 (solution)
Let Xi be the round-off error for the ith number; it is reasonable to
assume independence, and so the Xi ’s are i.i.d. uniform(−0.5, 0.5)
random variables. Using formulas from Week 6 Class 1, we get
1
µ = E(Xi ) = 0, σ 2 = Var(Xi ) = .
12
R 0.5
(Alternately, just compute Var(Xi ) from E(Xi2 ) = −0.5 x2 1 dx.)
Let Y = 50
P
i=1 Xi be the total round-off error. We wish to find the
probability that Y is more than 3 or less than −3. By formula (3)
of the CLT, Y ≈ X where X ∼ N (0, 50/12). Hence, the required
probability is given by
P(|Y | > 3) ≈ P(|X| > 3) = 2 P(X > 3)
X −0 3−0
= 2P p >p ≈ 2 P(Z > 1.4697) ≈ 0.142.
50/12 50/12
(No continuity correction is needed here, as Y is continuous.)
22 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Estimate the number k, such that you can be 90% confident that
there will still be at least one working bulb after k months.
23 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Activity 4 (solution)
Let Xi be the life time of the ith bulb; it is reasonable to assume
independence here, and so the Xi ’s are i.i.d. exponential(2)
random variables. Recall from Week 6 Class 2 that
1 1
µ = E(Xi ) = , σ 2 = Var(Xi ) = .
2 4
P100
Let Y = i=1 Xi be the total life time of the 100 bulbs. By
formula (3) of the CLT, Y ≈ X where X ∼ N (50, 25). For there
to still be at least one working bulb after k months, we require the
total life time to be at least k. Hence,
k − 50
0.9 = P(Y ≥ k) ≈ P(X ≥ k) = P Z ≥ √ .
25
k − 50
It follows that ≈ −1.28, or k ≈ 43.6 months.
5
(Recall that in Week 9 Class 2, we did a difficult computation for 2
bulbs using integrals; yet here, for 100 bulbs, the computation is
relatively easy due to the CLT.) 24 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
25 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
Activity 5 (solution)
Let Xi be the number of candies P in the ith packet, n be the
number of packets, and Y = ni=1 Xi be the total number of
candies. It is reasonable to assume independence here, and so the
Xi ’s are i.i.d. random variables. We first compute their mean and
variance:
26 / 30
Law of large numbers Central limit theorem Extra notes Statement and examples Activities
27 / 30
Law of large numbers Central limit theorem Extra notes
Outline
3 Extra notes
28 / 30
Law of large numbers Central limit theorem Extra notes
LLN
The version of LLN presented on Slide 9 is technically called the
weak law of large numbers, because there is a stronger version
called the strong law. The difference between the two versions is
very subtle and beyond the scope of the course.
CLT
The CLT is a statement about the sum or average of the Xi ’s,
not about the Xi ’s themselves. So e. g. getting more data values
or measurements (hence increasing the sample size n) does not
magically make the data or measurements normally distributed.