Check that p
is a valid probability (0 ≤ p ≤ 1), and that n
is an integer, strictly positive.
mctad.binomial(9, .7).generate(100)
will perform 100 sequences of nine Bernoulli trials
where the random variables have a success probability of .7.
Iterate over the domain, calculating the probability mass and cumulative distribution functions.
Mix in the convenience methods for p(x) and F(x).
Binomial Distribution
The Binomial Distribution is the discrete probability distribution of the number of successes in a sequence of
n
independent yes/no experiments, each of which yields success with probabilityp
. Such a success/failure experiment is also called a Bernoulli experiment or Bernoulli trial; when n = 1, the Binomial Distribution is a Bernoulli Distribution.Assumptions
n
is a strictly positive Integer andp
is a valid probability (0 ≤ p ≤ 1).Use
mctad.binomial(n, p)
Inline Comments