Limited combination problem

71 Views Asked by At

Problem:

Imagine you have N balls, that you want to put into M boxes. How many ways are there to put N balls into M boxes, if every box can store no more than K balls.
For convinience, I named the number of ways to put N balls into M boxes as "W"

You can't leave any box empty.
Boxes are labeled, balls are not.
There is no difference in which order you put balls.

What I found:

I started by simply counting the number of these ways for boxes with K=2.
K=2 results diagram
W-s seem to form a Pascal's triangle, so I continued for K=3
K=3 results diagram
With K=3 it seems that W-s form a variation of Pascal's triangle, but instead of summing up 2 numbers above, you sum up 3.This is how it works
The same goes for K=4
K=4 results diagram

Question:

I can't find a rigorous proof, that algorithm with these Pascal triangles is true. Please help(