# multinomial() Function & Examples

Use the multinomial() probability function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## multinomial

#### multinomial(A)

Try it yourself:

```calculio
multinomial([1, 2, 1])
```

[combinations](https://calcul.io/function/combinations/index.md)

[factorial](https://calcul.io/function/factorial/index.md)

---

## Count grouped arrangements with multinomial

**multinomial** counts arrangements of items divided into several labelled groups. It generalizes binomial coefficients: for group sizes n₁, n₂, and so on, the count is total factorial divided by each group factorial.

## Example

It counts distinct arrangements of repeated letters or ways to assign distinguishable items to fixed group sizes. Compare [combinations](https://calcul.io/function/combinations/index.md) for one selected group and [composition](https://calcul.io/function/composition/index.md) for distributions of identical items. [factorial](https://calcul.io/function/factorial/index.md) defines the underlying formula.

## Caveats

Group sizes should be non-negative integers. They must add to the stated total when a total is supplied. Results grow fast, so retain exact arithmetic where possible and use [lgamma](https://calcul.io/function/lgamma/index.md) for stable log-scale probability calculations.

[All functions](https://calcul.io/functions/index.md)
