Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import random
  2.  
  3. SAMPLES = 1000000
  4. N = 2
  5.  
  6. correct = 0.
  7. for i in range(SAMPLES):
  8. labels = range(N)
  9. random.shuffle(labels)
  10. c = len([i for i, n in enumerate(labels) if i == n])
  11. correct += c
  12.  
  13. print(correct / SAMPLES)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement