# Math Help - counting problem

1. ## counting problem

In how many ways can you put the 30 books in a row on a shelf if the novels are on the left,the math books are in the middle and the history books are on the right?
(The numbers of books of each subject are not known)

2. Originally Posted by problem
In how many ways can you put the 30 books in a row on a shelf if the novels are on the left,the math books are in the middle and the history books are on the right?
(The numbers of books of each subject are not known)
The answer depends on how many there are of each.

In the limit, i.e. if all 30 are e.g. novels, there are 30! ways.

If there are 10 of each, then it's 3 x 10!.

So suppose there are x novels, y math books and z history books.

Then there are $x!y!z!$ arrangements.

It can be simplified by letting $z = 30-x-y$: there are $x!y!(30-x-y)!$ arrangements.

OTOH the answer could well be "Only one." If you're a manic arranger so your books are arranged neatly like that, you're going to arrange them in a rigid order within the categories.