1

Let $a(n,m)$ denote the number of set possible partitions of $\{1,2, \dots ,n\}$  into subsets with max size $m$. Thus all subsets have number of elements $\leq m$.

I found a formulation for a similar problem in which the number of partitions was constrained by the variable $k$.

When $n=m$ the number of possible partitions is defined by the sequence of bell numbers, but how do I solve this in general when $m < n$?

I listed motivation in comments and the provided links show the research I have performed in an attempt to solve this.

i3rendn4v05
  • 113
  • 5
  • I'm trying to do this to figure out if it's feasible to write a binary linear programming objective function for a set of 25 choices with max partition sizes of 4. – i3rendn4v05 May 21 '20 at 18:25
  • My mathematics background is limited, so let me know if need to clarify anything. – i3rendn4v05 May 21 '20 at 18:28
  • My motivation is to determine if I can find an optimization for NPC happiness in Terraria. https://terraria.gamepedia.com/NPCs#Happiness. As there are 25 NPCs and there is a penalty for groups of more than 4 I am constraining the problem to a max partition size of 4. If the number of partitions is small enough under this constraint I may be able to solve the optimization using binary linear programming. Biomes could be added once complexity is determined. – i3rendn4v05 May 21 '20 at 18:36
  • Here's something to consider: the function $A(n,m)$ follows a recurrence relation, namely $A(n,m) = A(n, m-1) + A(n-m, m)$. This is because the number of ways you can partition $n$ items into subsets less $m$ are also ways you can partition it into subsets less than $m - 1$. However, this doesn't account for partitions with size $m$ involved. So we presuppose that we have at least one $m$-size partition (subtracting that from $n$) and partitioning the remaining items accordingly. This gives us the above recurrence relation. I know this isn't an answer, but I hope it helps! – dsillman2000 May 21 '20 at 19:25
  • @dsillman2000 that doesn't hold up... Consider a(3,2). Under your conjecture a(3,2) = a(3,1) + a(1,2) = 2. When in reality a(3,2) = 4 – i3rendn4v05 May 21 '20 at 20:18
  • Apologies, I stand corrected. Thanks for checking. – dsillman2000 May 21 '20 at 20:26

1 Answers1

3

This is called the restricted Bell numbers. They have been studied here and here

The link you put on the forum deals with exactly the Restricted Stirling numbers of the second kind, they are denoted by ${n\brace k}_{\leq m}$ and in general you are interested in $$B_{n,\leq m}=\sum _{k=1}^n{n\brace k}_{\leq m}.$$ In the second reference the recurrence are given in theorem 4.1,4.2.

Phicar
  • 14,722
  • 1
    Thanks! I think I managed to follow along and implement that as a recursive function in Matlab. Solving for n=25 and m=4 I got 1,523,643,044,367,439,360. This shows that it's almost certainly not feasible to solve as a binary linear programming problem. – i3rendn4v05 May 21 '20 at 21:34
  • In double precision... Close enough – i3rendn4v05 May 21 '20 at 22:11