I am following through the Hypergeometric distribution:
The probability that we select a sample of size $n$ containing $r$ defective items from a population of $N$ items known to contain $M$ defective items is
$P(X = r) = C(M,r) * C(N-M,n-r) / C(N,n)$
where C(P,Q) is the combination of P items taken Q at a time.
Explanation on the above equation:
(a) we may select $n$ items from a population of $N$ items in $C(N,n)$ ways - understood
(b) we may select $r$ defective items from $M$ defective items in $C(M,r)$ ways - understood
(c) we may select $n−r$ non-defective items from $N−M$ non-defective items in $C(N−M,n−r)$ ways -did not understand
(d) hence we may select $n$ items containing $r$ defectives in $C(M,r) * C(N−M,n-r)$ ways -did not understand
Why both (b) and (c) must be considered and those factors got multiplied in (d)
Can anybody explain the hypergeometric distribution derivation in simple terms.
The above material is taken from here : The Hypergeometric distribution