[Math] Probability and Counting

discrete mathematicsprobability

I have just picked up a text on discrete math and its been ages since I have done this so if anyone can show me with steps to correct my fault, that would be so great.
Repair facility has 25 failed keyboards, 6 of which have electrical defects and 19 which have mechanical defects.
(1) How many ways are there to randomly select 5 of these keyboards for a thorough inspection (order does not matter)? 25 choose 5
(2) IN how many ways can a sample of 5 keyboards be selected so that exactly tow have an electrical defect? (25 choose 5)/(6 choose 5)
(3) If a sample of 5 keyboards is randomly selected, what is the probability that at least 4 of these will have a mechanical defect? (5 choose 4)….?

Am I correct in my thinking logic or way off?

Best Answer

For part 2, you need exactly two out of five so there are ${6 \choose 2}$ ways to do that leaving ${19\choose 3}$ for the remaining mechanically failed devices. So in total there are ${6\choose 2}{19\choose 3}$ total ways. Now for part three, think of what it means to say "at least" and use the same process. So you need a sample with exactly 4 plus a sample with 5....
For cases where we are sampling without replacement, a hyper geometric distribution is used. Say you want the probability of $K$ out $N$ successes with a sample size $n$. Then the mass function looks like $$P(X<k)=\sum_{i=0}^k{\frac{{K\choose i}{N-K \choose n-i}}{N \choose n}}$$