# How should I implement the cumulative distribution function of a discrete r.v that follows binomial distribution in R?

Problem

Let there be a discrete random variable s.t. $$X \sim \text{Binom}(20,0.02)$$ and $$X(\Omega) = \{0,1,2,\ldots,20\}$$ Let there be also a constant $$C$$ s.t. $$\Pr(X\leq\frac{120}{C}) > 0.99$$ What is the maximum $$C$$ such that the above relation holds? And how should this problem be solved in R?

What has already been known

pbinom(4, size=20, prob=0.02)


gives the probability that $$X$$ is less than 4.

## 1 Answer

Do you know the function qbinom? This gives the quantile of the binomial distribution.

We have that qbinom(0.99, size = 20, prob = 0.02) = 2, so $$\mathbb{P}(X \leq 2) = 0.99.$$

So the maximum $$C$$ for which $$\mathbb{P}\mathopen{}\left(X \leq \frac{120}{C}\right) = 0.99$$ holds is $$C=60$$.