### 20.1.7 Quantiles

Similar to quartiles, a quantile of a list is the number q such that a given fraction of the list numbers fall at or below q. The first quartile, for example, is the quantile with the fraction 0.25.

The quantile command finds quantiles.

- quantile takes two mandatory arguments and one optional argument:
  - L, a list of numbers.
  - Optionally, W, a list of weights.
  - p, a number between 0 and 1.
  quantile(L,p) returns the pth quantile of L.

#### Examples

A:=[0,1,2,3,4,5,6,7,8,9,10,11]:; quantile(A,0.1)

1.0 |  |  |  |  |  |  |  |  |  |

quantile(A,A,0.25)

6 |  |  |  |  |  |  |  |  |  |