Practical 2
Practical 2
Department of Mathematics
[3 3 3 6 3 3 5 6 7 6]
r p(r)
0 0.0040960000000000015
1 0.03686400000000002
2 0.1382400000000001
3 0.2764800000000001
4 0.3110400000000001
5 0.1866240000000001
6 0.04665599999999999
mean = 3.5999999999999996
variance = 1.44
[4 2 1 0 2 2 2 1 4 1]
[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
[0.001 0.007 0.03 0.082 0.173 0.301 0.45 0.599 0.729 0.83 0.901 0.947
0.973 0.987 0.994 0.998 0.999 1. 1. 1. 1. ]
In [23]: k = np.arange(5)
N = 52 # population size
G = 4 # number of good elements in population
n = 5 # simple random sample size
stats.hypergeom.pmf(k, N, G, n)
In [27]: a
In [ ]: