diff options
author | Patrick Simianer <p@simianer.de> | 2017-07-04 21:09:53 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-07-04 21:09:53 +0200 |
commit | c4bb22f922b409b989b76ecc1126f6f99f0b8170 (patch) | |
tree | fc46437bde3d2543f1c2a632ae42348b646d15d9 | |
parent | 740f82a87a6f5573e80b3263f540efa831e05100 (diff) |
uniform
-rwxr-xr-x | python/uniform.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/uniform.py b/python/uniform.py new file mode 100755 index 0000000..e2e3af1 --- /dev/null +++ b/python/uniform.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python2 + +import numpy as np + +n=10000.0 +s=100.0 +print "should be ~ %d: %d"%(int(s),len([x for x in (np.random.uniform(0,1,int(n)) >= (1-(s/n))) if x])) + |