Suppose a population of size $n =n_1 + n_2$ contains $ n_1$ individuals of type 1 and $n_2$ individuals of type 2. If a sample of size k is drawn with replacement from this population, what is the probability it contains k1 individuals of type 1 and $k_2 = k−k_1$ individuals of type 2.
I am struggling to show this is equal to $${k \choose k_1}\frac{n_1^{k_1}n_2^{k_2}}{n^k}$$
Method 1:
Sample space(S): No.of ways we can fill up 'k' spaces using 'n' elements with replacement is given by $(n)^k$, since every space has 'n' options available.
Event(A): Filling up 'k'spaces with exactly '$k_1$'spaces by '$n_1$' elements and '$k_2$'spaces by '$n_2$' elements
This can be done by choosing '$k_1$'spaces from 'k' and fill it up with '$n_1$' elements, the rest of the spaces can be filled by '$n_2$' automatically
= $\binom{k}{k_1}(n_1)^{k_1}(n_2)^{k_2}$
Probability = ${k \choose k_1}\frac{n_1^{k_1}n_2^{k_2}}{n^k}$
Method 2: Using Binomial distribution
Probability of selecting '$n_1$' = $\frac{n_1}{n}$
Probability of selecting '$n_2$' = $\frac{n_2}{n}$
Probability of getting '$n_1$' $k_1$ times out of $k$ = $\binom{k}{k_1} \left(\frac{n_1}{n}\right)^{k_1}\left(\frac{n_2}{n}\right)^{k_2}$ where $k=k_1+k_2$