Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

combinat::stirling2

Stirling numbers of the second kind

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

combinat::stirling2(n, k)

Description

combinat::stirling2(n,k) computes the number of ways of partitioning a set of n elements into k non-empty subsets.

combinat::stirling2(n,k) is calculated using the formula

.

Examples

Example 1

One can partition the set {1, 2, 3} into {1, 2, 3} = {1, 2} ∪ {3} = {1, 3} ∪ {2} = {2, 3} ∪ {1}

combinat::stirling2(3,2)

Example 2

combinat::stirling2(3)
Error: Two arguments expected. [combinat::stirling2]

Parameters

n, k

Nonnegative integers

Return Values

Nonnegative integer.

Was this topic helpful?