summaryrefslogtreecommitdiff
path: root/python/uniform.py
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2017-07-04 21:09:53 +0200
committerPatrick Simianer <p@simianer.de>2017-07-04 21:09:53 +0200
commitc4bb22f922b409b989b76ecc1126f6f99f0b8170 (patch)
treefc46437bde3d2543f1c2a632ae42348b646d15d9 /python/uniform.py
parent740f82a87a6f5573e80b3263f540efa831e05100 (diff)
uniform
Diffstat (limited to 'python/uniform.py')
-rwxr-xr-xpython/uniform.py8
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]))
+