# What score-assigning function would maximize this desired shape?

Let's say I have a setup where an agent places blocks into bins in such a way as to maximize its "score". The score is a function of the number of bins filled and the number of blocks in each bin. The bins are automatically sorted largest to smallest. The arrangement I wish to have the highest score is this: A trivial function would be "Number of blocks in the largest bin" which would maximize this: Or "Number of bins filled" which would maximize this: You could take the product of "Size of largest bin" and "Number of bins", but that would have this maximize the score: So what scoring function could I give that would give me the roughly smoothly-decreasing arrangement of blocks that I desire? Preferably the least complicated, the better.

• Have you tried the classic "sum of number of blocks squared"? – cvanaret Sep 22 '20 at 21:39
• That function would be completely independent of the arrangement of blocks in the bins unfortunately. – Anthony Khodanian Sep 24 '20 at 2:12

## 1 Answer

Let $$x_b$$ be the number of blocks in bin $$b$$ and maximize $$\min\limits_{b\in \{1,\dots,n-1\}} (x_b-x_{b+1}).$$ This will make the decreases uniform.

If you prefer steeper decreases at the beginning, maximize $$\min\limits_{b\in \{1,\dots,n-1\}} b(x_b-x_{b+1}).$$