We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 07c7109 + 8c63f2b commit 98f4892Copy full SHA for 98f4892
resampling.py
@@ -34,7 +34,7 @@ def trial():
34
35
# Probability of the median of 5 samples being in the
36
# middle two quartiles of the population
37
-trial = lambda : 2500 <= sorted([randrange(10000) for i in range(5)])[2] < 7500
+trial = lambda : 2500 <= sorted(randrange(10000) for i in range(5))[2] < 7500
38
print(sum(trial() for i in range(10000)) / 10000.0) # compare with the beta distribution
39
40
# An exact permutation text
0 commit comments