R - Binomial Distribution

1 - About

3 - Function

3.1 - Density

The binomial distribution with size = n and prob = p has density


p(x) = choose(n, x) p^x (1-p)^(n-x)

for x = 0, …, n

where:

  • R - Choose (binomial coefficient)

3.2 - Cumulative

To find the probability of having k or less correct answers, we can plot a cumulative distribution.


plot(pbinom(0:40, size=20, prob=0.5) )
plot(pbinom(0:40, size=20, prob=0.7) )
plot(pbinom(0:40, size=40, prob=0.5) )

4 - Example

4.1 - Biased coin

The (Probability|Statistics) - Binomial Distribution example of the Binomial Distribution in R


require(graphics)
dbinom(0:5, size=6, prob=0.3)


[1] 0.117649 0.302526 0.324135 0.185220 0.059535 0.010206

where:

  • 0:5 is a vector representing k (the trial index)
  • size is n, the number of trial
  • prob is the probability of a success trial

5 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap