I get 36.0.
#!/usr/bin/python from random import random trials=200 hits=0 for i in range(trials): x=random() y=random() if x<.7: if y<.5: hits+=1 print 100*(float(hits)/float(trials))
It’s samping variation. Set trials = 1e9 and see what you get.
I get 36.0.
It’s samping variation. Set trials = 1e9 and see what you get.