# Median (median)

The middle value of a list of numbers, or the mean of the two middle ones.

## How to write it

### median(data)

**data**

The numbers. They are put in order, so symbols are not allowed. Takes a list.

## Examples

- $\displaystyle 3, 1, 4, 1, 5 = 3$

  `median([3, 1, 4, 1, 5])`

  In the solver, `median([3, 1, 4, 1, 5])` gives `3`.

  [Open in the solver](https://hilberon.com/?q=median%28%5B3%2C%201%2C%204%2C%201%2C%205%5D%29)
- $\displaystyle 2, 4, 4, 4, 5, 5, 7, 9 = \frac{9}{2}$

  `median([2, 4, 4, 4, 5, 5, 7, 9])`

  In the solver, `median([2, 4, 4, 4, 5, 5, 7, 9])` gives `9/2`.

  [Open in the solver](https://hilberon.com/?q=median%28%5B2%2C%204%2C%204%2C%204%2C%205%2C%205%2C%207%2C%209%5D%29)

## Related functions

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

  The most frequent value of a list, or a list of them when several are equally frequent.
- [mean](https://hilberon.com/library/mean)

  The average of a list of numbers, or the expected value of a distribution.
- [normal_distribution](https://hilberon.com/library/normal_distribution)

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

  A process given by its drift and diffusion: dX = drift dt + diffusion dW.
- [ornstein_uhlenbeck_process](https://hilberon.com/library/ornstein_uhlenbeck_process)

  A process pulled toward mu at rate theta, with noise sigma, started at x0.
- [ito_integral](https://hilberon.com/library/ito_integral)

  The Itô integral of an expression of the Wiener value w and the time s, from 0 to t.

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