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

# binomialDistribution -- binomial distribution

- Usage:
    `binomialDistribution(n, p)`
    `bernoulliDistribution p`
- Inputs:
  - n, an integer,
  - p, a number, between 0 and 1;
- Outputs:
  - a discrete probability distribution,

## 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 = .1937102445000001

    o2 : RR (of precision 53)

    i3 : probability_X 3

    o3 = .9872048016000059

    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:

- `binomialDistribution(ZZ,Number)`

## For the programmer

The object binomialDistribution is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Probability.m2:943:0.