# Counting number of shipments that contain at least two defective machines

I'll start off by admitting that this is a homework problem. However, my main goal is to find out what kind of problem this is classified as and what concepts I need to learn to be able to solve similar ones. I'm not just looking for an answer (although I would be glad to get one); I need help by being pointed in the right direction. Links to relevant articles and readings would be appreciated.

Problem:

A shipment of 12 X-Ray machines includes 4 that are defective. In how many ways can a hospital purchase 5 of these machines and receive at least 2 of the defective machines?

I can only get as far as figuring out that there are 792 different ways to purchase 5 machines from the shipment of 12 (12 choose 5 is 792).

I realize this might be very easy for some people, but all I need is a little help (links and explanations is what I'm after, not just an answer). Thanks in advance!

-
I found two similar questions online but their answers are not too helpful 1st link 2nd link – Cashew Sep 15 '12 at 19:01

Suppose I want to pick $x$ bad machines, and $y$ good machines for a total of $x+y$ machines. First I pick the $x$ bad ones by choosing from the set of bad ones, so there's $\binom{4}{x}$ ways of picking the bad ones and $\binom{8}{y}$ ways to pick the good ones. Multiply the two to get the total number of ways. Since you want at least two defective ones, sum all the possible cases from 2 to 4.