From c4bb22f922b409b989b76ecc1126f6f99f0b8170 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 4 Jul 2017 21:09:53 +0200 Subject: uniform --- python/uniform.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 python/uniform.py 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])) + -- cgit v1.2.3