combinat::stirling2 --
Stirling numbers of the second kind
Introductioncombinat::stirling2(n,k) computes the Stirling numbers of the second kind.
Call(s)
combinat::stirling2(n,k)
Parametersn,k | - | nonnegative integers |
Returnsa nonnegative integer.
Detailscombinat::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
stirling2(n,k) = 1/k! * sum((-1)^(k-j)*binomial(k,j)*j^n,j=0...k) .
Example 1One can partition the set 1,2,3 into 1,2,3 = 1,2 union 3 = 1,3 union 2 = 2,3 union 1
>> combinat::stirling2(3,2)
3
Example 2>> combinat::stirling2(3)
Error: Two arguments expected. [combinat::stirling2]
MuPAD Combinat, an open source algebraic combinatorics package