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.
1 parent 07c7109 commit 8c63f2bCopy full SHA for 8c63f2b
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