Quantcast

Documentation Center

  • Trial Software
  • Product Updates

combinat::stirling2

Stirling numbers of the second kind

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

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 are expected. [combinat::stirling2]

Parameters

n, k

Nonnegative integers

Return Values

Nonnegative integer.

Was this topic helpful?