Skip to content

Adding Random Variables and the Central Limit Theorem | Stanford CS109 Lecture 15

Aug 22, 20261 min
TL;DRA few independent sums have closed forms; general IID sums become approximately Normal under the CLT, with continuity correction for discrete sums.

🌏 中文版

Video status: Related supplementary video included; the original lecture recording has not been verified. Source details

This is article 16 in Reading Stanford CS109, covering Summer 2026 Lecture 15: Central Limit Theorem on July 16 with Chris Gregg. It follows the current worksheet, answer key, LLM Learning Guide, and reader chapters on sums of random variables and the CLT. The current slides are unavailable and Canvas video is gated, so missing material is not reconstructed.

The worksheet and key contain complete two-page P1–P7 plus challenge material. The guide's six concepts occupy two substantive pages; page three only continues the wrap-up. This is the first L2 unit: the public problem set and reader support a complete artifact guide, but not a claim to reproduce the full slides or lecture.

P1: Open with a Beta-belief review

A Subscribe button receives nine clicks from 12 visitors. Starting from Beta(1,1),

X|data ~ Beta(10,4)
E[X] = 10/14 = 5/7 ≈ 0.714

This closes belief over a probability before moving to distributions of sums.

P2: Three closed-form sum families

Independent Bin(12,0.25) and Bin(28,0.25) variables pool into 40 Bernoulli trials with a shared probability:

X+Y ~ Bin(40,0.25)

Different p values would make pooled trials non-identically distributed, so the sum would not be an ordinary Binomial. Independent Poisson rates add:

Poi(2.2)+Poi(3.8)=Poi(6)
P(total=5)=e^-6 6^5/5!≈0.161

Independent Normal means and variances add:

N(10,9)+N(20,16)=N(30,25)
P(X+Y>40)=1-Φ((40-30)/5)=1-Φ(2)≈0.0228

Most families are not closed under addition; for example, two Uniforms sum to a triangular distribution.

P3: Why convolution is a sum of products

For independent nonnegative discrete X,Y,

P(X+Y=n)=Σ(k=0..n)P(X=k)P(Y=n-k)

In the supplied PMFs, only (1,1) and (2,0) contribute to sum two:

P(X+Y=2)=0.3×0.6+0.2×0.4=0.26

The split events are mutually exclusive, so probabilities add; independence factors each joint term into a product. Continuous convolution replaces the sum with an integral while preserving the same “all possible splits” logic.

P4: A Normal difference and ELO

Independent performances satisfy A~N(1650,200²) and B~N(1500,200²). For D=A-B,

D ~ N(150, 200²+(-1)²200²)
  = N(150,80000)
SD(D)≈282.8

Variance adds even for a difference because coefficient -1 is squared. Team A's win probability is

P(D>0)=Φ(150/282.8)=Φ(0.53)≈0.70

If both variances grow, the mean gap remains 150 while its z-score shrinks toward zero. A's win probability moves toward 0.5, reflecting more upsets.

P5: A CLT for truncation error

Each Xi~Uniform(0,1) is truncated to three decimals. One loss Xi-Yi~Uniform(0,0.001). The sum of 1,000 IID errors is approximately Normal:

μ = 1000×0.001/2 = 0.5
σ² = 1000×(0.001)²/12 = 8.33×10^-5
σ ≈ 0.00913

Hence

P(X-Y>0.51)
≈1-Φ((0.51-0.5)/0.00913)
≈1-Φ(1.10)≈0.137

The errors are continuous, so no continuity correction applies. Since truncation losses are nonnegative, the negative tail in a two-sided reading is essentially zero.

P6: The CLT needs more than a sum

The problem adds one Bernoulli, Binomial, Geometric, Uniform, Beta, and Exponential variable. They are independent but not identically distributed, and there are only six terms. The standard IID CLT taught here therefore makes no claim that their sum is Normal.

The guide requires IID variables, finite variance, and reasonably large n. More general CLTs have different assumptions, but those are outside this public unit and do not change the intended answer.

P7: Rolling Until 300

“At least 80 rolls are needed to exceed 300” means the first 79 rolls sum to S79≤300. One die has mean 3.5 and variance 35/12, so

S79 ≈ N(79×3.5,79×35/12)
    = N(276.5,230.417)
SD≈15.179

Because the sum is integer-valued, ≤300 uses boundary 300.5:

P(S79≤300)
≈Φ((300.5-276.5)/15.179)
=Φ(1.581)≈0.943

P7 is a pset5 item omitted from the public key; the event translation, CLT parameters, and continuity correction come directly from the prompt.

Challenge: A sum of 30 Betas

IID Xi~Beta(4,2) have

E[Xi]=2/3
Var(Xi)=4×2/(6²×7)=2/63

For X=Σ(i=1..30)Xi, the CLT gives

X≈N(20,20/21),  SD≈0.9759
P(19<X<20)
≈Φ(0)-Φ((19-20)/0.9759)
≈0.347

This sum is continuous, so no continuity correction is used. The challenge is another pset5 item omitted from the public key; the derivation uses only the prompt.

How to use the LLM Learning Guide

The six concepts are IID variables, convolution, closed-form sums, Normal differences/ELO, the CLT, and continuity correction. First ask whether a sum already has an exact closed form; only then check CLT conditions. After choosing a Normal approximation, determine whether the original sum is integer-valued—only discrete bars need a half-unit correction.

Material boundaries

  • This guide covers P1–P7, the optional challenge, and all six guide concepts; numbering is complete.
  • P7 and the challenge are pset5 items omitted from the public answer key and are derived only from public prompts.
  • Current slides are unavailable and video is gated; L2 does not mean a full lecture reconstruction.
  • The worksheet/key are two pages each, and guide page three only continues closing text. The short-material exception applies; the article remains draft: true pending independent review.

Course video sources

Verified the official Summer 2026 archive: the course is recorded and its syllabus says recordings are available through Canvas. The archived homepage's Videos link redirects to Stanford Canvas login and requires course access, so there is no public Summer 2026 player. The 2022 Stanford Online public recording(s) below cover the same topic but come from a different offering with different lecture numbering; they are supplementary material, not Summer 2026 lecture recordings.

YouTube:Stanford CS109 I Central Limit Theorem I 2022 I Lecture 18

Original videos: Stanford CS109 I Central Limit Theorem I 2022 I Lecture 18

Official sources:

Checked: 2026-10-10.

Content check: verified against the video transcript (2026-10-10): Read the transcript of 2022 Lecture 18, "Central Limit Theorem" (about 49 minutes): it starts with a convolution review, then covers sums of IID variables, the sample mean, variance and sample-size estimation with the CLT, matching this lecture. Worksheet problems in this post such as the ELO and truncation-error items are not video content.

Update Log

  • 2026-10-10: Added explicit video status and checked recording sources and access notes.
  • 2026-10-10: Rechecked video status. Switched to related supplementary video: embedded the 2022 Stanford Online public recording on the same topic; the Summer 2026 original is behind Canvas sign-in and could not be verified.
  • 2026-10-10: Checked the video content against its transcript. The video topic matches; no claims needed changing.

References