Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- ### converges to 1 as the number of families goes up
- families = 1000000
- import random
- m=1.0
- f=1.0
- for i in range(families):
- s=0
- while not s:
- if random.random()<0.5:
- m+=1
- s=1
- else:
- f+=1
- print 'm:', m,' f:',f,' prop:',m/f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement