In: Statistics and Probability
Must be calculated in R
In twenty prey visits on carnivorous plants, if the probability
of a capture in one visit is 0.2, what is the probability to have 3
to 6 captures ,
or P(3 less or equal than X less or equal than 6).
Solution:
Given ,
p = 0.2
n = 20
X follows Binomial(20 , 0.2)
Find P(3 less or equal than X less or equal than 6) i.e. P(3 X 6)
P(3 X 6) = P(X = 3) + P(X = 4) + P(X = 5) + P(X = 6)
Use R software.
> dbinom(3, size=20, prob=0.2) +
+ dbinom(4, size=20, prob=0.2) +
+ dbinom(5, size=20, prob=0.2) +
+ dbinom(6, size=20, prob=0.2)
[1] 0.6472
Or we can find this using cumulative probability function.
P(3 X 6) = P(X 6) - P(X 3) + P(X = 3)
> pbinom(6, size=20, prob=0.2) - pbinom(3, size=20, prob=0.2) + dbinom(3, size=20, prob=0.2)
[1] 0.64722