Lottery probability, 7 out of 34. Probability of 5 out of 7?

I would like to find the probability of guessing 5 out of 7 numbers. There is 34C7 possibles. The correct answer is 0.0014. For guessing 6 out 7 was easier. That was $\frac{28*6}{34C7}$. Since I don't get the other I don't understand the first one either. I think I just got that one by luck.

-

I solved it myself using Hypergeometric distribution:

$$\frac{{27 \choose 2} \times {7 \choose 5}}{34 \choose 7} = 0.0014$$

-
+1. Note that this is really just the multiplication principle for counting at work. Of the original 34 numbers, you want to guess 5 of a certain 7 numbers, and there are ${7 \choose 5}$ ways to do this, and for each of the ${7 \choose 5}$ ways to pick the numbers, there are ${27 \choose 2}$ ways to pick the remaining $2$ numbers. You then divide by the total number of choices which is ${34 \choose 7}$. The reason I made this comment is that referring to this as a hypergeometric situation seems to make this more complicated than it really is. –  JavaMan Nov 20 '12 at 9:45
We want to take 5 numbers out of our "success" pool. This gives us a total of $7\choose5$ ways. And since we draw 7 numbers, we still have to choose 2 from our "fail" pool. This gives us $27\choose2$. For probability of
$\displaystyle\frac{{27 \choose 2} \times {7 \choose 5}}{34 \choose 7}$