Chance of getting a good grade

Lets says theres a question bank of 28 questions. On the exam, there will be 12 of these questions, and I will have to answer 5.

If the only way to get a question right is to study it, how many questions should I study to have a reasonable chance of knowing 5 answers?

More generally, how could I find out my expected score as a function of how many questions I study?

Obviously if I study 21, then I will get 100%, and if I study less than 5, I'm guaranteed to not get at least 5.

-
Are you actually going to apply what we tell you to a real test that you will take? If so, the answer is of course to study 28. :P –  apnorton Mar 5 '13 at 3:00
Its not a math exam, so its a minimization problem rather than a maximization problem –  rckrd Mar 5 '13 at 3:01
You only need to study 21 to get 100%, since in the worst case scenario the seven you studied for are among the 12 and you can pick the other 5. –  Lepidopterist Mar 5 '13 at 3:03

Total number of combinations: $\binom{28}{12}$ number of combinations that contain at least 5 of the n you know: is the sum of the combinations in which there are 5,6,7,8,9,10,11,12 you do know. In other words $\sum_{i=5}^{12}\binom{n}{i}*\binom{28-n}{12-i}$ so the probability is $$\frac{\sum_{i=5}^{12}\binom{n}{i}*\binom{28-n}{12-i}}{\binom{28}{12}}$$

-

Imagine that you are a little late in studying, and the $12$ questions on the test have already been chosen by the instructor. Call the $12$ chosen questions good, and the $16$ others bad.

You choose $n$ questions at random to study. There are $\binom{28}{n}$ equally likely choices.

The number of choices that have $k$ good and $n-k$ bad is $\binom{12}{k}\binom{16}{n-k}$. Thus the probability that you choose at least $5$ good is $$\frac{\sum_{k=5}^{12}\binom{12}{k}\binom{16}{n-k}}{\binom{28}{n}}.$$ One can save a little bit of effort by calculating the probability of the complement: for that we need the shorter sum from $k=0$ to $4$. Now perform the calculation for various $n$, until you get a probability that you consider adequate.

-

Andre and Jorge have already covered most of the question, but I thought I'd just like to add that your expected score can be expressed as a 12-th order polynomial in $n$, where $n$ is the number of questions you studied.

When you plot the polynomial, you can get a nice graph of your expected score as a function of number of questions studied:

-