Each letter has a $40\%$ chance of being replied to; how many letters to send to be $99\%$ sure that you get 200 replies? A researcher knows that the probability that a questionnaire will be reponded by mail is 40%.
He wants to be 99% sure he will get at least 200 responded questionnaires back.
How many questionnaires must he send by mail to be 99% sure he will get at least 200 answers?
 A: Using R and the function pbinom(k, ..., lower.tail=FALSE) which gives the probability that the observed number of success is larger than $k$ (the complement of the cumulative probability of $k$), you can do it this way:
# The size has to be at least 200.
size <- 200
# Increase size until threshold is hit.
while(pbinom(200, size, prob=.4, lower.tail=F) < .99) {
   size = size+1
}

The above solution should do, if you are genuinely interested in the solution and how to get a practical answer. If this is homework though, I cannot guarantee that this will be sufficient ;-)
A: The exact binomial confidence intervals are obtained by a method involving an integral that was described in a paper by Clopper and Pearson around 1934.  That is why it is often called the Clopper-Pearson method.  For any $n >200$ in your case you can use that method to compute a one-sided 99% confidence interval for the number of responses.  Keep increasing $n$ until this upper bound exceeds $200$. Now since $n$ is going to be large the normal approximate confidence interval can be used as a good approximation.  That is what you would do if you didn't know that $p=0.40$ and estimated it from data.  So instead of a confidence interval you can compute the exact point at which $99\%$ of the binomial distribution falls below.  Using the normal approximate distribution approximates this probability interval.  That is what gui11aume did using R.
A: How many trials before getting 200 successes, that's actually the definition of the negative binomial. In R you calculate this with:
200 + qnbinom(0.99, 200, 0.4)
[1] 567

A negative binomial density (R: dnbinom) gives you the prob that a certain number x of failures will be necessary to obtain 200 successes. Sum that up to get the CDF (R: pnbinom), i.e., the probability that at most x failures will get you the 200 successes. Conversely, the quantile function tells you that with probability 99%, 367 failures will suffice to get you the 200 successes. Said otherwise, there's (roughly) 1% chance that more than 367 failures (i.e., 567 trials) will be necessary to get your 200 successes.
Chap
A: Let $X$ denote the number of letters replied to and $n$ the number of letters sent. This problem is mathematically equivalent to solving for the minimal $n$ such that $$P(X \leq 200) \leq .01$$
To get a closed form (approximation) solution, we can use the normal approximation to the binomial, which says that $X$ is approximately $N(\mu, \sigma^2)$ distributed where $\mu = np = .4n$ and $\sigma^2 = np(1-p) = .24n$. As Michael Chernick pointed out in his answer, this sample size is large enough for this approximation to be reasonable.
Using this approximation, we can reduce the problem to solving for the minimal $n$ such that
$$ P(X \leq 200) = \Phi \left( \frac{ 200 - .4n }{\sqrt{.24n}} \right) \leq .01 $$
where $\Phi(\cdot)$ is the normal CDF. This is equivalent to finding the minimal $n$ such that 
$$ 200 \leq \sqrt{.24n} \cdot \Phi^{-1}(.01) + .4n $$
Since this is a monotonic function, to find the minimal $n$ it suffices to check where exact equality occurs; if we substitute $ x= \sqrt{n} $ we have a simple quadratic equation on this transformed scale:  
$$ .4x^2 + .24 \cdot \Phi^{-1}(.01) x - 200 = 0 $$
which can be readily solved using the quadratic formula with 
$$ a = .4 $$ 
$$ b = \sqrt{.24} \Phi^{-1}(.01) $$ 
$$ c = -200 $$ 
which yield the solutions 
$$ x = \frac{ -b \pm \sqrt{b^2 -4ac} }{2a} = \{-20.98142, 23.83061 \}$$
We must take the positive solution, since $\sqrt{n}$ clearly must be positive. Also we must round up, since the result must be an integer. Squaring this and rounding up gives the minimal sample size: $$ n = \lceil 23.83061^2 \rceil = \lceil 567.898 \rceil = 568 $$.
Note that this closely agrees with the exact calculation using the Binomial distribution (I got $n = 567$). 
