mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
848 B
848 B
Function multinomial
Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from n possibilities.
multinomial takes one array of integers as an argument. The following condition must be enforced: every ai <= 0
Syntax
math.multinomial(a) // a is an array type
Parameters
| Parameter | Type | Description |
|---|---|---|
a |
number[] | BigNumber[] | Integer numbers of objects in the subset |
Returns
| Type | Description |
|---|---|
| Number | BigNumber | Multinomial coefficient. |
Examples
math.multinomial([1,2,1]) // returns 12