# cdf function

The probability that a variable with a distribution is at most a value.

## How to write it

### cdf(distribution, x)

**distribution**

A distribution such as normal_distribution(0, 1). Takes an expression.

**x**

The value. Takes an expression.

## Examples

- $\displaystyle F_{X}(x),\ X \sim \mathcal{N}(0, 1) = \frac{\operatorname{erf}\left(\frac{\sqrt{2} x}{2}\right)+1}{2}$

  `cdf(normal_distribution(0, 1), x)`

  In the solver, `cdf(normal_distribution(0, 1), x)` gives `(erf(sqrt(2)*x/2) + 1)/2`.

  [Open in the solver](https://hilberon.com/?q=cdf%28normal_distribution%280%2C%201%29%2C%20x%29)
- $\displaystyle F_{X}(2),\ X \sim \mathrm{B}\left(5, \frac{1}{3}\right) = \frac{64}{81}$

  `cdf(binomial_distribution(5, 1/3), 2)`

  In the solver, `cdf(binomial_distribution(5, 1/3), 2)` gives `64/81`.

  [Open in the solver](https://hilberon.com/?q=cdf%28binomial_distribution%285%2C%201%2F3%29%2C%202%29)

## Functions its examples use

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

  The normal distribution with mean mu and standard deviation sigma.
- [binomial_distribution](https://hilberon.com/library/binomial_distribution)

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

## Related functions

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

  The correlation coefficient of two lists of the same length.
- [covariance](https://hilberon.com/library/covariance)

  The sample covariance of two lists of the same length.
- [affine_sde_moments](https://hilberon.com/library/affine_sde_moments)

  The mean and variance at time t of dX = (a + b X) dt + sigma dW, started at x0.
- [cvar](https://hilberon.com/library/cvar)

  The conditional value at risk of a loss: its expected value over the worst share 1 - level.
- [wiener_process](https://hilberon.com/library/wiener_process)

  Brownian motion with drift mu and noise sigma, started at 0.
- [distributed](https://hilberon.com/library/distributed)

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

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