# Binomial distribution (binomial_distribution)

The number of successes in n independent trials that each succeed with chance p.

## How to write it

### binomial_distribution(n, p)

**n**

The number of trials, a whole number. Takes an expression.

**p**

The chance of success, between 0 and 1. Takes an expression.

## Examples

- $\displaystyle \operatorname{binomial\_distribution}\left(10, \frac{1}{4}\right)$

  `binomial_distribution(10, 1/4)`[Open in the solver](https://hilberon.com/?q=binomial_distribution%2810%2C%201%2F4%29)
- $\displaystyle P(x \ge 2),\ x \sim \mathrm{B}\left(5, \frac{1}{2}\right) = \frac{13}{16}$

  `probability(x >= 2, distributed(x, binomial_distribution(5, 1/2)))`

  In the solver, `probability(x >= 2, distributed(x, binomial_distribution(5, 1/2)))` gives `13/16`.

  [Open in the solver](https://hilberon.com/?q=probability%28x%20%3E%3D%202%2C%20distributed%28x%2C%20binomial_distribution%285%2C%201%2F2%29%29%29)

## Functions its examples use

- [probability](https://hilberon.com/library/probability)

  The probability that a condition holds for a variable with a distribution.
- [distributed](https://hilberon.com/library/distributed)

  A variable and the distribution it follows, as probability and expectation read it.

## Related functions

- [weibull_distribution](https://hilberon.com/library/weibull_distribution)

  The lifetime of a unit whose chance of surviving to time x is e^(-(x/scale)^shape).
- [uniform_distribution](https://hilberon.com/library/uniform_distribution)

  The continuous distribution that is equally likely anywhere between a and b.
- [stationary_distribution](https://hilberon.com/library/stationary_distribution)

  The law a process settles into over time, when it has one.
- [exponential_distribution](https://hilberon.com/library/exponential_distribution)

  The waiting time for events that come at rate lambda.
- [poisson_distribution](https://hilberon.com/library/poisson_distribution)

  The number of events in a period when they come at an average rate lambda.
- [normal_distribution](https://hilberon.com/library/normal_distribution)

  The normal distribution with mean mu and standard deviation sigma.

---
Source: https://hilberon.com/library/binomial_distribution
