Macaulay2 » Documentation
Packages » Probability :: binomialDistribution
next | previous | forward | backward | up | index | toc

binomialDistribution -- binomial distribution

Synopsis

Description

The binomial distribution, the distribution of the number of successes in a sequence of n Bernoulli trials, where the probability of success is p.

i1 : X = binomialDistribution(10, 0.1)

o1 = B(10,.1)

o1 : DiscreteProbabilityDistribution
i2 : density_X 2

o2 = .1937102445

o2 : RR (of precision 53)
i3 : probability_X 3

o3 = .9872048016

o3 : RR (of precision 53)
i4 : quantile_X 0.4

o4 = 1
i5 : random X

o5 = 2

A special case is the Bernoulli distribution, where n is 1.

i6 : Y = bernoulliDistribution 0.1

o6 = B(1,.1)

o6 : DiscreteProbabilityDistribution

Ways to use binomialDistribution :

For the programmer

The object binomialDistribution is a method function.