2
$\begingroup$

Possible Duplicate:
How to distribute $k$ distinct items into $r$ distinct groups with each groups receiving $a (=k-n)$ prizes at most?

How many ways you can use to put N books on H shelves, but the shelf's must contain not more than X books? I would like to solve it by composition (number theory)..but nothing.. Please help me, thanks a lot.

  • 0
    The$n$ please update the question accordingly as they are different problems.2011-11-09

1 Answers 1

1

Let $a_i$ be the number of books place on shelf $i$, $i=1,2,\dots,H$. Then you want the number of solutions of $a_1+a_2+\cdots+a_H=N$ with each $a_i$ an integer satisfying $0\le a_i\le X$. That question has come up multiple times on this site. Let's both try searching the site to see if we can find one of those previous appearances.