mathjs/docs/reference/functions/multinomial.md
2022-03-01 13:04:09 +01:00

51 lines
1.4 KiB
Markdown

---
layout: default
---
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
<h1 id="function-multinomial">Function multinomial <a href="#function-multinomial" title="Permalink">#</a></h1>
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
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
```js
math.multinomial(a) // a is an array type
```
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
Parameter | Type | Description
--------- | ---- | -----------
`a` | number[] &#124; BigNumber[] | Integer numbers of objects in the subset
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
Type | Description
---- | -----------
Number &#124; BigNumber | Multinomial coefficient.
<h3 id="throws">Throws <a href="#throws" title="Permalink">#</a></h3>
Type | Description
---- | -----------
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
```js
math.multinomial([1,2,1]) // returns 12
```
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
[combinations](combinations.html),
[factorial](factorial.html)