TheAceHome

Untitled

Sep 23rd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #2.11
  2. import random
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. omegaLUL = ['1']*2+['0']*6+["2"]*4
  6. n,m = 0,0
  7. N = 10000
  8. rept=[i for i in range(0,N,100)] #y
  9. x=[] #x
  10. rept.remove(0)
  11. for i in range(N):
  12.     for j in range(12):
  13.         random.shuffle(omegaLUL)
  14.     for k in range(11):
  15.         if omegaLUL[k] == '1':
  16.             if omegaLUL[k+1] == '1' :
  17.                 n+=1
  18.     if i in rept:
  19.         x.append(n/i)
  20. print(n/N)
  21. print(x)
  22. print(rept)
  23.  
  24.  
  25. fig = plt.figure()
  26. plt.plot(rept, x)
  27. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment