I've just managed to stump myself. Lets say you have(adsbygoogle = window.adsbygoogle || []).push({});

M (identical) marbles and N boxes. How many ways

can you put the marbles in the boxes if each box

can have at most k (k <= M) marbles?

for k=M we can take M .'s to be the marbles

and N-1 |'s to be the boxes so a valid configuration

is a sequence like ..|.|...||.. so we end up with

(M+N-1) choose M.

for k=1, we must have M<N, and

we have N choices for the first marble,

N-1 choices for the second, ...

which is just N choose M possibilities.

is there a formula for arbitrary k?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Tough combinatorics problem

**Physics Forums | Science Articles, Homework Help, Discussion**