In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
In [2]:
M = 100
N = 10000
X = np.random.random((N,M))
plt.hist(X.mean(axis=1), normed=True, bins=17);
In [3]:
M = list(range(2,10))
X_ = []
X_dev = []
for m in M:
X = np.random.random((N,m))
X_m = X.mean(axis=1)
X_.append(X_m.mean())
X_dev.append(X_m.std())
In [4]:
plt.plot(1/np.sqrt(M), X_dev)
Out[4]: