# 二项分布（Binomial distribution，binomial_distribution）

n 次独立试验中成功的次数，每次试验成功的概率为 p。

## 怎么写

### binomial_distribution(n, p)

**n**

试验次数，一个整数。接受一个表达式。

**p**

成功概率，介于 0 和 1 之间。接受一个表达式。

## 示例

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

  `binomial_distribution(10, 1/4)`[在求解器中打开](https://zh.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)))`

  在求解器中，`probability(x >= 2, distributed(x, binomial_distribution(5, 1/2)))` 的结果是 `13/16`。

  [在求解器中打开](https://zh.hilberon.com/?q=probability%28x%20%3E%3D%202%2C%20distributed%28x%2C%20binomial_distribution%285%2C%201%2F2%29%29%29)

## 示例中用到的函数

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

  带分布的变量满足某个条件的概率。
- [distributed](https://zh.hilberon.com/library/distributed)

  变量及其所服从的分布，供概率和期望读取。

## 相关函数

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

  一个单元存活到时间 x 的概率为 e^(-(x/scale)^shape) 时的寿命。
- [uniform_distribution](https://zh.hilberon.com/library/uniform_distribution)

  在 a 与 b 之间任何位置等可能的连续分布。
- [stationary_distribution](https://zh.hilberon.com/library/stationary_distribution)

  过程随时间趋于的分布，若存在的话。
- [exponential_distribution](https://zh.hilberon.com/library/exponential_distribution)

  以速率 lambda 发生的事件的等待时间。
- [poisson_distribution](https://zh.hilberon.com/library/poisson_distribution)

  在一段时间内以平均速率 lambda 发生的事件的次数。
- [normal_distribution](https://zh.hilberon.com/library/normal_distribution)

  均值为 mu、标准差为 sigma 的正态分布。

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