Binomial cumulative distribution function

`y = binocdf(x,N,p)`

y = binocdf(x,N,p,'upper')

`y = binocdf(x,N,p)`

computes
a binomial cdf at each of the values in `x`

using
the corresponding number of trials in `N`

and probability
of success for each trial in `p`

. `x`

, `N`

,
and `p`

can be vectors, matrices, or multidimensional
arrays that are all the same size. A scalar input is expanded to a
constant array with the same dimensions of the other inputs. The values
in `N`

must all be positive integers, the values
in `x`

must lie on the interval `[0,N]`

,
and the values in `p`

must lie on the interval [0,
1].

`y = binocdf(x,N,p,'upper')`

returns
the complement of the binomial cdf at each value in `x`

,
using an algorithm that more accurately computes the extreme upper
tail probabilities.

The binomial cdf for a given value *x* and
a given pair of parameters *n* and *p* is

$$y=F(x|n,p)={\displaystyle \sum _{i=0}^{x}\left(\begin{array}{c}n\\ i\end{array}\right)}{p}^{i}{(1-p)}^{(n-i)}{I}_{(0,1,\mathrm{...},n)}(i).$$

The result, *y*, is the probability of observing
up to *x* successes in *n* independent
trials, where the probability of success in any given trial is *p*.
The indicator function $${I}_{(0,1,\mathrm{...},n)}(i)$$ ensures that *x* only
adopts values of 0,1,...,*n*.

Was this topic helpful?