1 of 174

Central Limit Theorem

Chris Gregg

CS109, Stanford University

Autumn 2026

2 of 174

Uncertainty Theory

2

Beta Distributions

Adding Random Vars

Central Limit Theorem

Sampling

Algorithmic Analysis

Thompson Sampling

Bootstrapping

​

Information Theory +

Divergence

As requested by AI faculty

Chris Piech, CS109

3 of 174

Independent Random Variables

3

Recall the comma means “and”

Chris Piech, CS109

4 of 174

Independent Random Variables

4

Recall the comma means “and”

Because they are independent, “and” becomes multiplication

Chris Piech, CS109

5 of 174

Four Prototypical Trajectories

New Definition

Chris Piech, CS109

6 of 174

  • Consider n random variables X1, X2, ... Xn
    • Xi are all independently and identically distributed (I.I.D.)
    • All have the same PMF (if discrete) or PDF (if continuous)
    • All have the same expectation
    • All have the same variance

6

IID Random Variables

IID

iid

7 of 174

Quick check

7

Chris Piech, CS109

8 of 174

Quick check

8

Chris Piech, CS109

9 of 174

Quick check

9

Chris Piech, CS109

10 of 174

Quick check

10

Chris Piech, CS109

11 of 174

Quick check

11

Chris Piech, CS109

12 of 174

Four Prototypical Trajectories

What happens when you add random variables?

13 of 174

Four Prototypical Trajectories

Why should you care?

14 of 174

Zero Sum Games

How do you model zero sum games?

What is the probability that the Warriors win?

15 of 174

15

Motivating Idea: Zero Sum Games

How it works:

  • Each team has an “ELO” score S, calculated based on their past performance.
  • Each game, the team has ability A ~ N(S, 2002)
  • The team with the higher sampled ability wins.

1797

1555

ability

p

Arpad Elo

16 of 174

16

Motivating Idea: Zero Sum Games

How do we do this???

17 of 174

Sum of Two Die?

17

17

Value dice 1

Value dice 2

Each outcome

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

Roll two 6-sided dice. What is P(sum = 7)?

Chris Piech, CS109

18 of 174

Sum of Two Die = 7?

18

18

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

E = in blue

Value dice 1

Value dice 2

Each outcome

Roll two 6-sided dice. What is P(sum = 7)?

Chris Piech, CS109

19 of 174

Sum of Two Die = 7?

19

19

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

E = in blue

Value dice 1

Value dice 2

Each outcome

Roll two 6-sided dice. What is P(sum = 7)?

Chris Piech, CS109

20 of 174

Sum of Two Die = 7?

20

20

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

E = in blue

Value dice 1

Value dice 2

Each outcome

Roll two 6-sided dice. What is P(sum = 7)?

Chris Piech, CS109

21 of 174

Sum of Two Die = 10?

21

21

Value dice 1

Value dice 2

Each outcome

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

Roll two 6-sided dice. What is P(sum = 10)?

E = in blue

Chris Piech, CS109

22 of 174

Sum of Two Die = 10?

22

22

Value dice 1

Value dice 2

Each outcome

[1,1]

[1,2]

[1,3]

[1,4]

[1,5]

[1,6]

[2,1]

[2,2]

[2,3]

[2,4]

[2,5]

[2,6]

[3,1]

[3,2]

[3,3]

[3,4]

[3,5]

[3,6]

[4,1]

[4,2]

[4,3]

[4,4]

[4,5]

[4,6]

[5,1]

[5,2]

[5,3]

[5,4]

[5,5]

[5,6]

[6,1]

[6,2]

[6,3]

[6,4]

[6,5]

[6,6]

S = {

}

Roll two 6-sided dice. What is P(sum = 10)?

E = in blue

Chris Piech, CS109

23 of 174

Four Prototypical Trajectories

End Review

24 of 174

24

Sum of Two Dice

Xi is the outcome of dice roll i

25 of 174

25

Sum of Two Dice

Xi is the outcome of dice roll i

Xi s are iid

26 of 174

26

Sum of Three Dice

Xi is the outcome of dice roll i

Xi s are iid

27 of 174

27

Sum of One Dice

This is the PMF of the sum of one dice

28 of 174

28

Sum of One Dice

This is the PMF of the sum of one dice

29 of 174

29

This is the PMF of the sum of two dice

Why is there more mass in the middle?

Sum of Two Dice

30 of 174

30

This is the PMF of the sum of two dice

Why is there more mass in the middle?

Sum of Two Dice

31 of 174

31

This is the PMF of the sum of three dice

Why is there more mass in the middle?

Sum of Three Dice

32 of 174

32

This is the PMF of the sum of three dice

Why is there more mass in the middle?

Sum of Three Dice

33 of 174

Four Prototypical Trajectories

Sum of 50 dice?

34 of 174

Insight to Convolution

34

Imagine a game

where each player independently scores between 0 and 100 points:

​

Let X be the amount of points you score.

Let Y be the amount of points your opponent scores.

Let’s say you know P(X = x) and P(Y = y).

​

What is the probability of a tie?

Note: these could be any distribution! As long as you know the PMFs

Chris Piech, CS109

35 of 174

Insight to Convolution

35

Imagine a game

where each player independently scores between 0 and 100 points:

​

Let X be the amount of points you score.

Let Y be the amount of points your opponent scores.

Let’s say you know P(X = x) and P(Y = y).

​

What is the probability of a tie?

Note: these could be any distribution! As long as you know the PMFs

Chris Piech, CS109

36 of 174

Insight to Convolution

36

Imagine a game

where each player independently scores between 0 and 100 points:

​

Let X be the amount of points you score.

Let Y be the amount of points your opponent scores.

Let’s say you know P(X = x) and P(Y = y).

​

What is the probability of a tie?

Note: these could be any distribution! As long as you know the PMFs

Chris Piech, CS109

37 of 174

Insight to Convolution

37

Imagine a game

where each player independently scores between 0 and 100 points:

​

Let X be the amount of points you score.

Let Y be the amount of points your opponent scores.

Let’s say you know P(X = x) and P(Y = y).

​

What is the probability sum = 10?

Chris Piech, CS109

38 of 174

38

In English: What is the probability that

X + Y = n?

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

39 of 174

39

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

40 of 174

40

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

41 of 174

41

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

42 of 174

42

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

43 of 174

43

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

44 of 174

44

In English: What is the probability that

X + Y = n?

X

Y

i

0

n

0

​

1

n - 1

1

​

2

n - 2

2

​

​

n

0

n

…

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

45 of 174

45

In English: What is the probability that

X + Y = n?

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

46 of 174

46

Since this is the OR of mutually exclusive events

In English: What is the probability that

X + Y = n?

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

47 of 174

47

If the random variables are independent

Since this is the OR of mutually exclusive events

In English: What is the probability that

X + Y = n?

What is the PMF for X + Y,

Consider the case where X and Y are discrete and non-negative

48 of 174

Wildlife Disease Outbreak

48

Researchers are tracking a contagious disease in two distinct animal populations.

​

Population A has Bin(n = 5, p = 0.1) infections

Population B has Bin(n = 8, p = 0.5) infections.

​

Find the exact probability distribution of total infections across A and B.

Sometimes the PMF is zero

k

P(A + B = k)

def main():

for k in range(0, 5+8+1):

pr_k = get_prob_sum(k)

print(f"{k},{pr_k}")

�def get_prob_sum(k):

A = stats.binom(5, 0.1)

B = stats.binom(8, 0.5)

pr = 0

for i in range(0, k+1):

pr += A.pmf(i) * B.pmf(k-i)

return pr

Chris Piech, CS109

49 of 174

49

Discrete Vs Continuous

Discrete

Continuous

Infinity is necessary when the values can be negative

50 of 174

Four Prototypical Trajectories

Convolution: The fanciest way to say “adding random variables”

​

51 of 174

Four Prototypical Trajectories

Side Quest

Sometimes Adding is Easy:

52 of 174

  • Let X and Y be independent binomials with the same value for p:
    • X ~ Bin(n1, p) and Y ~ Bin(n2, p)

52

Sum of Independent Binomials

53 of 174

  • Let X and Y be independent binomials with the same value for p:
    • X ~ Bin(n1, p) and Y ~ Bin(n2, p)
    • X + Y ~ Bin(n1 + n2, p)

​

53

Sum of Independent Binomials

54 of 174

  • Let X and Y be independent binomials with the same value for p:
    • X ~ Bin(n1, p) and Y ~ Bin(n2, p)
    • X + Y ~ Bin(n1 + n2, p)

​

  • Intuition:
    • X has n1 trials and Y has n2 trials
      • Each trial has same “success” probability p
    • Define Z to be n1 + n2 trials, each with success prob. p
    • Z ~ Bin(n1 + n2, p), and also Z = X + Y

54

Sum of Independent Binomials

55 of 174

  • Let X and Y be independent random variables
    • X ~ Poi(λ1) and Y ~ Poi(λ2)
    • X + Y ~ Poi(λ1 + λ2)

​

55

Sum of Independent Poissons

56 of 174

  • Let X and Y be independent random variables
    • X ~ N(μ1, σ12) and Y ~ N(μ2, σ22)
    • X + Y ~ N(μ1 + μ2, σ12 + σ22)

​

  • Generally, have n independent random variables Xi ~ N(μi, σi2) for i = 1, 2, ..., n:

​

​

56

Sum of Independent Normals

57 of 174

  • Let X and Y be independent random variables
    • X ~ N(μ1, σ12) and Y ~ N(μ2, σ22)
    • X + Y ~ N(μ1 + μ2, σ12 + σ22)

​

  • Generally, have n independent random variables Xi ~ N(μi, σi2) for i = 1, 2, ..., n:

​

​

57

Sum of Independent Normals

58 of 174

58

Linear Transform

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

59 of 174

59

Linear Transform

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

60 of 174

60

Linear Transform

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

61 of 174

61

Linear Transform

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

62 of 174

62

Linear Transform

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

63 of 174

63

Linear Transform

X is not independent of X

Thinking of Y as a linear transform

Thinking of Y as the sum of independent normals

64 of 174

64

Zero Sum Games

How do you model zero sum games?

What is the probability that the Warriors win?

65 of 174

Gaussian Sampling and ELO ratings

65

66 of 174

Gaussian Sampling and ELO ratings

66

What is the probability that the Warriors win?

How do you model zero-sum games?

67 of 174

Gaussian Sampling and ELO ratings

67

68 of 174

Gaussian Sampling and ELO ratings

  •  

68

69 of 174

Gaussian Sampling and ELO ratings

  •  

69

70 of 174

Gaussian Sampling and ELO ratings

  •  

70

71 of 174

Gaussian Sampling and ELO ratings

  •  

71

72 of 174

Gaussian Sampling and ELO ratings

  •  

72

Arpad Elo

73 of 174

Gaussian Sampling and ELO ratings

  •  

73

Arpad Elo

 

74 of 174

Gaussian Sampling and ELO ratings

  •  

74

Arpad Elo

 

 

75 of 174

Probability of Winning a Game

75

76 of 174

Probability of Winning a Game

76

77 of 174

Probability of Winning a Game

77

78 of 174

Probability of Winning a Game

78

79 of 174

79

Virus Infections Revisited

80 of 174

  • Say you are working with the WHO to plan a response to a the initial conditions of a virus:
    • Two exposed groups
    • P1: 50 people, each independently infected with p = 0.1
    • P2: 100 people, each independently infected with p = 0.4
    • Question: Probability of more than 40 infections?

80

Virus Infections Revisited

81 of 174

  • Say you are working with the WHO to plan a response to a the initial conditions of a virus:
    • Two exposed groups
    • P1: 50 people, each independently infected with p = 0.1
    • P2: 100 people, each independently infected with p = 0.4
    • A = # infected in P1 A ~ Bin(50, 0.1) ≈ X ~ N(5, 4.5)
    • B = # infected in P2 B ~ Bin(100, 0.4) ≈ Y ~ N(40, 24)
    • What is P(≥ 40 people infected)?
    • P(A + B ≥ 40) ≈ P(X + Y ≥ 39.5)
    • X + Y = W ~ N(5 + 40 = 45, 4.5 + 24 = 28.5)

81

Virus Infections Revisited

82 of 174

  • Say you are working with the WHO to plan a response to a the initial conditions of a virus:
    • Two exposed groups
    • P1: 50 people, each independently infected with p = 0.1
    • P2: 100 people, each independently infected with p = 0.4
    • A = # infected in P1 A ~ Bin(50, 0.1) ≈ X ~ N(5, 4.5)
    • B = # infected in P2 B ~ Bin(100, 0.4) ≈ Y ~ N(40, 24)
    • What is P(≥ 40 people infected)?
    • P(A + B ≥ 40) ≈ P(X + Y ≥ 39.5)
    • X + Y = W ~ N(5 + 40 = 45, 4.5 + 24 = 28.5)

82

Virus Infections Revisited

83 of 174

Four Prototypical Trajectories

End Side Quest

Sometimes Adding is Easy:

84 of 174

84

CON

85 of 174

We talked about sum of Binomial, Normal and Poisson…who’s missing from this party?

Uniform.

85

CON

86 of 174

  • Let X and Y be independent random variables
    • X ~ Uni(0, 1) and Y ~ Uni(0, 1) → f (x) = 1 for 0 ≤ x ≤ 1

86

Sum of Independent Uniforms

1

87 of 174

  • Let X and Y be independent random variables
    • X ~ Uni(0, 1) and Y ~ Uni(0, 1) → f (x) = 1 for 0 ≤ x ≤ 1

87

Sum of Independent Uniforms

1

1

88 of 174

  • Let X and Y be independent random variables
    • X ~ Uni(0, 1) and Y ~ Uni(0, 1) → f (x) = 1 for 0 ≤ x ≤ 1

88

Sum of Independent Uniforms

1

1

For both X and Y

89 of 174

89

Chris Piech, CS109

90 of 174

90

a

0

1

2

Chris Piech, CS109

91 of 174

91

0

a

1

2

What if a = 0?

Chris Piech, CS109

92 of 174

92

0

a

1

2

Chris Piech, CS109

93 of 174

93

0

a

1

2

What if a = 0.5?

Chris Piech, CS109

94 of 174

94

0

a

1

2

Chris Piech, CS109

95 of 174

95

0

a

1

2

What if a = 1.5?

Chris Piech, CS109

96 of 174

96

0

a

1

2

Chris Piech, CS109

97 of 174

​

​

​

97

98 of 174

98

Four Prototypical Trajectories

Gotta care about summing more than two things….

99 of 174

Four Prototypical Trajectories

Sum of 100 uniforms???

100 of 174

100

Were talking about the sum of uniforms

101 of 174

Four Prototypical Trajectories

Sum of 100 poissons???

102 of 174

Next up: a beautiful result of probability theory!

102

Chris Piech, CS109

103 of 174

Next up: a beautiful result of probability theory!

103

Chris Piech, CS109

104 of 174

Central Limit Theorem

104

Chris Piech, CS109

105 of 174

Central Limit Theorem

  •  

105

 

Chris Piech, CS109

106 of 174

Central Limit Theorem

  •  

106

 

Chris Piech, CS109

107 of 174

Central Limit Theorem

  •  

107

 

Chris Piech, CS109

108 of 174

True happiness

108

Chris Piech, CS109

109 of 174

Sum of dice rolls

  •  

109

Chris Piech, CS109

110 of 174

Sum of dice rolls

  •  

110

 

Sum of 1�die roll

Chris Piech, CS109

111 of 174

Sum of dice rolls

  •  

111

 

Sum of 1�die roll

Sum of 2�dice rolls

Chris Piech, CS109

112 of 174

Sum of dice rolls

  •  

112

 

 

Sum of 1�die roll

Sum of 2�dice rolls

Sum of 3�dice rolls

Chris Piech, CS109

113 of 174

Sum of dice rolls

  •  

113

 

 

Sum of 1�die roll

Sum of 2�dice rolls

Sum of 3�dice rolls

How many ways�can you roll a total�of 3 vs 11?

Chris Piech, CS109

114 of 174

CLT explains a lot

114

 

 

Chris Piech, CS109

115 of 174

CLT explains a lot

115

 

​

​

​

​

​

​

0

1

2

3

4

5

 

 

Chris Piech, CS109

116 of 174

CLT explains a lot

116

 

​

​

​

​

​

​

0

1

2

3

4

5

 

Galton Board, by Sir Francis Galton�(1822-1911)

 

Chris Piech, CS109

117 of 174

CLT explains a lot

117

 

 

Chris Piech, CS109

118 of 174

CLT explains a lot

118

 

 

 

Chris Piech, CS109

119 of 174

CLT explains a lot

119

 

 

Proof:

 

 

Chris Piech, CS109

120 of 174

CLT explains a lot

120

 

 

 

 

Proof:

 

 

Chris Piech, CS109

121 of 174

CLT explains a lot

121

 

 

 

 

Proof:

 

 

 

 

Chris Piech, CS109

122 of 174

CLT explains a lot

122

 

 

 

 

 

Proof:

 

 

(substitute mean,�variance of Bernoulli)

 

 

Chris Piech, CS109

123 of 174

CLT explains a lot

123

 

 

Chris Piech, CS109

124 of 174

CLT explains a lot

124

 

 

Chris Piech, CS109

125 of 174

CLT explains a lot

125

 

Sample of�size 15,�sum values

 

Chris Piech, CS109

126 of 174

CLT explains a lot

126

 

Sample of�size 15,�sum values

 

Chris Piech, CS109

127 of 174

CLT explains a lot

127

 

 

Chris Piech, CS109

128 of 174

CLT explains a lot

128

 

 

Chris Piech, CS109

129 of 174

CLT explains a lot

129

 

Sample of�size 15,�average values

(sample mean)

 

Chris Piech, CS109

130 of 174

CLT explains a lot

130

 

Sample of�size 15,�average values

(sample mean)

 

 

Chris Piech, CS109

131 of 174

Proof Outline of CLT

131

 

Proof:

(this proof is beyond the scope of CS109)

 

Chris Piech, CS109

132 of 174

Proof Outline of CLT

  •  

132

 

Proof:

(this proof is beyond the scope of CS109)

 

Chris Piech, CS109

133 of 174

Proof Outline of CLT

  •  

133

 

Proof:

(this proof is beyond the scope of CS109)

 

Chris Piech, CS109

134 of 174

Proof Outline of CLT

  •  

134

 

Proof:

 

(this proof is beyond the scope of CS109)

 

Chris Piech, CS109

135 of 174

For Proof, see one of the many videos on YouTube, e.g.,

135

Chris Piech, CS109

136 of 174

For Proof, See Video 2

136

http://youtube.com/watch?v=oPQ4mNcqY7k&t=33s

Chris Piech, CS109

137 of 174

CLT example

137

Chris Piech, CS109

138 of 174

 

138

Chris Piech, CS109

139 of 174

 

139

 

Chris Piech, CS109

140 of 174

 

140

 

 

PDF

Chris Piech, CS109

141 of 174

 

141

 

Exact

 

PDF

Chris Piech, CS109

142 of 174

 

142

 

Exact

 

PDF

CLT approximation

Chris Piech, CS109

143 of 174

 

143

 

Exact

 

PDF

CLT approximation

Chris Piech, CS109

144 of 174

 

144

 

Exact

 

PDF

CLT approximation

 

Chris Piech, CS109

145 of 174

 

145

 

Exact

 

PDF

CLT approximation

 

 

 

Chris Piech, CS109

146 of 174

 

146

 

Chris Piech, CS109

147 of 174

 

147

 

 

PDF

Chris Piech, CS109

148 of 174

 

148

 

 

Exact

 

PDF

Chris Piech, CS109

149 of 174

 

149

 

 

Exact

 

PDF

CLT approximation

Chris Piech, CS109

150 of 174

 

150

 

 

Exact

PDF

CLT approximation

Chris Piech, CS109

151 of 174

 

151

n=10:

Chris Piech, CS109

152 of 174

 

152

 

PDF

n=10:

Chris Piech, CS109

153 of 174

 

153

 

Exact

 

PDF

n=10:

Chris Piech, CS109

154 of 174

 

154

 

Exact

 

PDF

CLT approximation

n=10:

Chris Piech, CS109

155 of 174

 

155

 

Exact

 

PDF

CLT approximation

 

n=10:

Chris Piech, CS109

156 of 174

 

156

Chris Piech, CS109

157 of 174

 

157

 

PDF

 

 

PDF

 

 

PDF

Chris Piech, CS109

158 of 174

 

158

 

PDF

 

 

 

PDF

 

 

PDF

Chris Piech, CS109

159 of 174

159

The sum of independent, identically distributed variables:

where

Is normally distributed:

Piech, CS109, Stanford University

160 of 174

160

What about other functions?

Sum of iid? Normal

Average of iid?

Max of iid?

Piech, CS109, Stanford University

161 of 174

161

https://onlinestatbook.com/stat_sim/sampling_dist/

Average of iid?

Piech, CS109, Stanford University

162 of 174

​

�

It’s play time!

162

Piech, CS109, Stanford University

163 of 174

163

Sum of Dice

Piech, CS109, Stanford University

164 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45
    • Roll!

​

  • And now the truth (according to the CLT)…

164

Sum of Dice

Piech, CS109, Stanford University

165 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45
    • Roll!

​

  • And now the truth (according to the CLT)…

165

Sum of Dice

Piech, CS109, Stanford University

166 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

166

Sum of Dice

167 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

167

Sum of Dice

168 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

168

Sum of Dice

169 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

169

Sum of Dice

170 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

170

Sum of Dice

171 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

171

Sum of Dice

172 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

172

Sum of Dice

173 of 174

  • You will roll 10 6-sided dice (X1, X2, …, X10)
    • X = total value of all 10 dice = X1 + X2 + … + X10
    • Win if: X ≤ 25 or X ≥ 45

​

  • Recall CLT:

​

    • Determine P(X ≤ 25 or X ≥ 45) using CLT:

​

​

​

​

173

Sum of Dice

174 of 174

174

I know of scarcely anything so apt to impress the imagination as the wonderful form of cosmic order expressed by the ”[Central limit theorem]". The law would have been personified by the Greeks and deified, if they had known of it. It reigns with serenity and in complete self-effacement, amidst the wildest confusion. The huger the mob, and the greater the apparent anarchy, the more perfect is its sway. It is the supreme law of Unreason. Whenever a large sample of chaotic elements are taken in hand and marshalled in the order of their magnitude, an unsuspected and most beautiful form of regularity proves to have been latent all along.

- Sir Francis Galton

-

Wonderful Form of Cosmic Order

Piech, CS109, Stanford University