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

50 lines
1.3 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-bellnumbers">Function bellNumbers <a href="#function-bellnumbers" title="Permalink">#</a></h1>
The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.
bellNumbers only takes integer arguments.
The following condition must be enforced: n >= 0
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
```js
math.bellNumbers(n)
```
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
Parameter | Type | Description
--------- | ---- | -----------
`n` | Number &#124; BigNumber | Total number of objects in the set
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
Type | Description
---- | -----------
Number &#124; BigNumber | B(n)
<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.bellNumbers(3) // returns 5
math.bellNumbers(8) // returns 4140
```
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
[stirlingS2](stirlingS2.html)