# `SComb.Math`
[🔗](https://github.com/tallakt/scomb/blob/v0.3.0/lib/scomb/math.ex#L1)

Some useful math functions. These are generally used internally by the
library.

# `binomial`

```elixir
@spec binomial(non_neg_integer(), non_neg_integer()) :: non_neg_integer()
```

Returns the binomial coefficient, the number of ways to choose `k` elements
from `n`

## Example

    iex> binomial 5, 2
    10

    iex> binomial 2, 5
    0

# `factorial`

```elixir
@spec factorial(non_neg_integer()) :: pos_integer()
```

Returns the factorial of a number. Highly optimized for n < 30

## Example

    iex> factorial 5
    120

# `multinomial`

```elixir
@spec multinomial([non_neg_integer()]) :: pos_integer()
```

Returns the multinomial coefficient, the number of ways to arrange groups of
`counts` interchangeable elements in a row

## Example

    iex> multinomial [2, 1]
    3

---

*Consult [api-reference.md](api-reference.md) for complete listing*
