Hypergeometric variables and probability

29 Views Asked by At

I previously posted the questions, now I am posting my worked solutions. Any thoughts where I am going wrong?

1. A primary school class consists of 12 boys and 8 girls. If a group of 4 kids are selected at random, what is the probability that the group consists of the same number of boys and girls?

My solution : Symbols

Population Size (N): (Class Strength: $12 + 8 = 20$)

Selection (n): 4 (4 Are selected)

Choice (k): 2 (To get the same number of both gender we need to have 2(boys) + 2 (Girls))

Possible picks (K): 8 (8 Boys can be picked & 8 girls can be picked)

Formula for Hypergeometric

p = $$\frac{{8 \choose 2} * {20 - 8 \choose 4 - 2}}{{20 \choose 4}}$$

Calculation in R

y = (choose(8,2) * (choose(20 - 8, 4 - 2)))/(choose(20,4))
y

The probability that the group consists of the same number of boys and girls would be 0.3814241.

2. Five cards are selected at random from a standard deck of playing cards. What is the probability that you get three kings (a standard deck consists of 52 cards, 4 of which are kings).

My Solution: Symbols

Population Size (N): 52 (Size of the deck)

Selection (n): 5 (Cards drawn)

Choice (k): 3 (Expected)

Possible picks (K): 4 (Available for selections)

Formula for Hypergeometric

$$p = \frac{{4 \choose 3} * {52 - 4 \choose 5 - 3}}{{52 \choose 5}}$$

Calculation in R

y = (choose(4, 3) * (choose(52 - 4, 5 - 3)))/(choose(52, 5))
y

The probability that we get three kings is extremely low as 0.001736079

Q3. If you pick five cards at random, with replacement, what is the probability of getting 3 kings?

My solutions : Symbols

Population Size (N): 52 (Size of the deck)

Selection (n): 5 (Cards drawn)

Choice (k): 3 (Expected)

Formula for Binomial

$$y = {n \choose k} * p^{k} * (1 - p)^{n - k}$$ $$y = {5 \choose 3} * (\frac{3}{5})^{3} * (1 - \frac{3}{5})^{5 - 3}$$ Calculation in R

y = choose(5, 3) * (3/5)^3 * (1 - (3/5))^(5-3)
y

The probability of getting 3 kings with replacement is 0.3456