summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-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]))
+