Advertisement
575

normal distribution

575
Nov 6th, 2022 (edited)
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # N(0, 1), N - количество элементов
  2. def NStandart(N):
  3.     xk = np.array([])
  4.     # R(0, 1)
  5.     a1 = RStandart(N)
  6.     time.sleep(3) # pause
  7.     a2 = RStandart(N)
  8.  
  9.     for i in range(N):
  10.         xk = np.append(xk, np.sqrt(-2 * np.log(a1[i])) * np.cos(2 * np.pi * a2[i]))
  11.     return xk
  12.  
  13. N = NStandart(5000)
  14. DrawHistogram(-5, 5, 0, 0.05, N)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement