## BINOMIAL

The BINOMIAL function computes the probability that in a cumulative binomial ( Bernoulli) distribution, a random variable X is greater than or equal to a user-specified value V , given N independent performances and a probability of occurrence or success P in a single performance.

This routine is written in the IDL language. Its source code can be found in the file ``` binomial.pro``` in the ``` lib``` subdirectory of the IDL distribution.

### Calling Sequence

Result = BINOMIAL( V, N, P )

### Arguments

#### V

A non-negative integer specifying the minimum number of times the event occurs in N independent performances.

#### N

A non-negative integer specifying the number of performances. If the number of performances exceeds 25, the Gaussian distribution is used to approximate the cumulative binomial distribution.

#### P

A non-negative single- or double-precision floating-point scalar, in the interval [0.0, 1.0], that specifies the probability of occurrence or success of a single independent performance.

### Examples

Compute the probability of obtaining at least two 6s in rolling a die four times. The result should be 0.131944.

result = binomial(2, 4, 1.0/6.0)

Compute the probability of obtaining exactly two 6s in rolling a die four times. The result should be 0.115741.

result = binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.)

Compute the probability of obtaining three or fewer 6s in rolling a die four times. The result should be 0.999228.

result = (binomial(0, 4, 1./6.) - binomial(1, 4, 1./6.)) + \$

(binomial(1, 4, 1./6.) - binomial(2, 4, 1./6.)) + \$

(binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.)) + \$

(binomial(3, 4, 1./6.) - binomial(4, 4, 1./6.))