# 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

## 4 Answers

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

-
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – homegrown Dec 31 '14 at 18:47

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.

-

You divide the Stirling number by the possible permutations of identical elements as this is just changing order within the stars and bars example.

-