# The Central Limit Theorem

The Central Limit Theorem

Stephen Wolfram

The Central Limit Theorem is an important result in statistics that states that subject to certain conditions, averages of multiple random variables tend to follow a normal distribution.

## Discovering the Central Limit Theorem

Discovering the Central Limit Theorem

Let’s “discover” the Central Limit Theorem empirically, by looking at collections of random numbers.

Make a list of 10 random real numbers between -1 and 1:

RandomReal[{-1,1},10]

In[]:=

{-0.0771015,-0.366985,-0.339309,0.828772,-0.0314546,0.258496,-0.626615,0.903993,0.337799,-0.719367}

Out[]=

These random numbers are uniformly distributed, so if we make a histogram of them, it’ll be flat.

Make a histogram of 1000 random numbers between -1 and 1:

Histogram[RandomReal[{-1,1},1000]]

In[]:=

Out[]=

With 100,000 numbers the histogram is almost exactly flat:

Histogram[RandomReal[{-1,1},100000]]

In[]:=

Out[]=

Now let’s start finding means of collections of numbers.

This finds the mean of 10 random real numbers:

Mean[RandomReal[{-1,1},10]]

In[]:=

-0.112097

Out[]=

Here is a list of 10 such means:

Table[Mean[RandomReal[{-1,1},10]],10]

In[]:=

{-0.112467,0.0172069,0.0826008,0.134617,-0.220979,-0.0600067,-0.14143,0.171051,-0.13263,0.0301039}

Out[]=

Here is the distribution of 1000 such means:

Histogram[Table[Mean[RandomReal[{-1,1},10]],1000]]

In[]:=

Out[]=

Here is the distribution for 100,000 means:

Histogram[Table[Mean[RandomReal[{-1,1},10]],100000]]

In[]:=

Out[]=

The distribution for the means is not flat; instead it’s a bell-shaped curve.

It’s easier to see the shape of the curve if we use smaller bins; here width 0.01:

Histogram[Table[Mean[RandomReal[{-1,1},10]],100000],{.01}]

In[]:=

Out[]=

If we only put 5 numbers into the mean, we still get a very similar result:

Histogram[Table[Mean[RandomReal[{-1,1},5]],100000],{.01}]

In[]:=

Out[]=

The crucial thing about the Central Limit Theorem is that it holds for a wide range of different underlying random distributions.

If we cube each random number, the distribution of the results isn’t flat:

Histogram[Table[RandomReal[{-1,1}]^3,1000]]

In[]:=

Out[]=

The distribution of the means is still the same shape:

Histogram[Table[Mean[Table[RandomReal[{-1,1}]^3,10]],100000],{.01}]

In[]:=

Out[]=

If we square each number, we’ll always get results that are positive:

Histogram[Table[RandomReal[{-1,1}]^2,1000]]

In[]:=

Out[]=

The distribution of the means is still the same shape, though its center (mean) is shifted:

Histogram[Table[Mean[Table[RandomReal[{-1,1}]^3,10]],100000],{.01}]

In[]:=

Out[]=

## The Normal Distribution

The Normal Distribution

## Towards the Normal Distribution

Towards the Normal Distribution

## The Normal Distribution in 2D and Beyond

The Normal Distribution in 2D and Beyond

## Random Walks

Random Walks

## What Isn’t a Normal Distribution

What Isn’t a Normal Distribution