In [39]:
import numpy as np
import matplotlib.pyplot as plt
In [40]:
N=100000 #počet simulovaných hodnot pro histogram
Nk=np.arange(1,10,1)  #kolik hodnot z rozdělení pro matematické kyvadlo sčítat
y=np.zeros(N)
for k in Nk:
    for i in range(N):
        for j in range(k):
            y[i]=y[i]+np.sin(np.pi*(np.random.random()-0.5))
    plt.hist(y,bins=100,density=True)
    plt.title('součet '+str(k)+' hodnot') 
    plt.show()
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
In [ ]: