# Function composition Calculate the number of ways to split `n` into `k` nonempty parts. ## Syntax ```js math.composition(n, k) ``` ### Parameters Parameter | Type | Description --------- | ---- | ----------- `n` | Number | BigNumber | Total number of objects `k` | Number | BigNumber | Number of objects in the subset ### Returns Type | Description ---- | ----------- Number | BigNumber | The number of ways to split a set of n elements into k nonempty sets. ## Examples ```js math.composition(8, 3); // returns Number 21 math.composition(math.bignumber(70), math.bignumber(3)); // returns Number 2346 ``` ## See also [combinations.js](combinations.md), [stirlingS2.js](stirlingS2.md), [bellNumbers.js](bellNumbers.md)