Probabilities of the Form P(x)

To compute P(x), use

dbinom(x, n , p)

For example, suppose n = 15 and p = 0.65. Find P(10).

dbinom(10, 15, 0.65)
## [1] 0.2123387

So, P(10) = 0.2123

Probabilities of the Form P(X \(\leq\) x) or P(X < x)

To compute probabilities of the form P(X \(\leq\) x), use the command

pbinom(x, n , p)

For example, suppose n = 15 and p = 0.65, find P(X \(\leq\) 6).

pbinom(6,15,0.65)
## [1] 0.04219384

So, P(X \(\leq\) 6) = 0.0422.

To compute P(X < x), you must change the probability to one of the form P(X \(\leq\) x). For example, suppose n = 15 and p = 0.65. With n = 15, the possible values of the random variable X are x = 0, 1, 2, 3, 4, 5, …, 14, 15. So, P(X < 5) is equivalent to P(X \(\leq\) 4).

To compute

pbinom(4,15,0.65)
## [1] 0.002831425

So, P(X < 5) = P(X \(\leq\) 4) = 0.0028.

Probabilities of the Form P(X \(\geq\) x) or P(X > x)

Probabilities of the form P(X \(\geq\) x) or P(X > x) make use of the complement rule and the pbinom command.

For example, suppose n = 15 and p = 0.65. Let’s compute P(X \(\geq\) 7). To do this, we recognize that

P(X \(\geq\) 7) = 1 - P(X < 7)

And, P(X < 7) = P(X \(\leq\) 6).

1 - pbinom(6,15,0.65)
## [1] 0.9578062

So, P(X \(\geq\) 7) = 0.9578.

Probabilities of the Form P(\(x_1\) \(\leq\) X \(\leq\) \(x_2\))

To compute the binomial probability, P(\(x_1\) \(\leq\) X \(\leq\) \(x_2\)), in R, use the following command:

sum(dbinom(\(x_1\):\(x_2\), n, p))

For example, suppose n = 15 and p = 0.65. Let’s compute P(7 \(\leq\) X \(\leq\) 10).

sum(dbinom(8:10, 15, .65))
## [1] 0.5348254

So, P(8 \(\leq\) X \(\leq\) 10) = 0.5348.

Note: You will need to convert any probabilities not involving a \(\leq\) to one that does include \(\leq\). For example, P(7 < X < 12) = P(8 \(\leq\) X \(\leq\) 11 ).