将k个不同的项分布在r个不同的组中,而不进行排序

时间:2022-11-16 23:40:15

Calculate the number of ways of distributing k distinct items among r distinct groups such that each group receives at least a and at most b items and internal arrangement of items within groups doesn't matter.

计算不同组间分配k个不同项的方法的数量,这样每个组至少会得到a,在大多数b项下,组内项的内部安排都不重要。

For example suppose there are 2 groups and 3 items A, B, C. The distributions (AB, C) and (BA, C) must not be counted twice.

例如,假设有两个组和3个项目A, B, C。分布(AB, C)和(BA, C)不能被计算两次。

Or in other words find the number of ways of distributing k distinct candies to r distinct kids. Each kid wants atleast a and atmost b candies. The order in which the kids receive candies doesn't matter.

或者换句话说找到将k个不同的糖果分配给r个不同的孩子的方法的数量。每个孩子至少要a和b糖果。孩子们收到糖果的顺序无关紧要。

I've read a similar question here. But the solution doesn't satisfy my second condition.

我在这里读到一个类似的问题。但解不满足第二个条件。

1 个解决方案

#1


0  

The solution is Stirling's Number of the Second Kind * r! So that's: 1/r! * (SUMMATION(j=0 --> r), (-1)^(r-j) * C(r,j) * j^k) * r! Which simplifies to: (SUMMATION(j=0 --> r), (-1)^(r-j) * C(r,j) * j^r)

解决办法是斯特灵的第二种数* r!这就是:1 / r !*(求和(j = 0 - - > r),(1)^(rj)* C(r,j)* j ^ k)* r !这简化了:(求和(j = 0 - - > r),(1)^(rj)* C(r,j)* j r ^)

#1


0  

The solution is Stirling's Number of the Second Kind * r! So that's: 1/r! * (SUMMATION(j=0 --> r), (-1)^(r-j) * C(r,j) * j^k) * r! Which simplifies to: (SUMMATION(j=0 --> r), (-1)^(r-j) * C(r,j) * j^r)

解决办法是斯特灵的第二种数* r!这就是:1 / r !*(求和(j = 0 - - > r),(1)^(rj)* C(r,j)* j ^ k)* r !这简化了:(求和(j = 0 - - > r),(1)^(rj)* C(r,j)* j r ^)