# Stirling numbers of the second kind on Multiset

Stirling numbers of the second kind S(n, k) count the number of ways to partition a set of n elements into k nonempty subsets.What if there were duplicate elements in the set?That is,the set is a multiset?

-

## migrated from stackoverflow.comJan 9 '11 at 15:40

This question came from our site for professional and enthusiast programmers.

It would be good to add the link to the definition of Stirling numbers: en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind –  David Jan 9 '11 at 3:37
The answer is likely to be somewhat complicated to express. For example, if the set consists of a single type of element, you get the partition numbers p_{n,k} : en.wikipedia.org/wiki/Partition_(number_theory) –  Qiaochu Yuan Jan 9 '11 at 15:54
I think [math] is a pretty useless tag in this site; I've deleted it and added [counting] –  Arturo Magidin Jan 10 '11 at 21:54

By definition, a set only has distinct elements. If elements are duplicated, then yes, the set in question would be a multiset.

-

Here are two links to get you started:

1. Eulerian numbers of the second kind may be helpful (for counting ascents, descents, etc., though i think)

2. Additionally some more useful information may be found in Stanley's book

-

There is no known formulation for a general multiset. However, a paper at JIS tackles the case where the element 1 occurs multiple times.

-