Restricted Permutations I have a problem in which 4 music books, 5 education books and 2 medicine books need to be arranged on a shelf. In how many ways can this be done if only the music books must be kept together and all 11 books are different?
I strongly suspect that the suggested solution is wrong:
ANS: 8!4! - (3!4!5! + 7!4!2! + 3!4!5!2!)
What I believe to be the corrected solution is:
8!4! -(4!4!5! + 7!4!2! + 3!4!5!2!)
(music books together with any arrangement of the other books) -((only music and education books together) + ( only music and medicine books together) + (all books grouped together by subject))
I could be wrong, but I certainly do not think that the suggested solution is correct.
 A: The answer below is essentially the same as that of Michael Biro.
Let us interpret the somewhat wonky wording as meaning that the music books must be together, and neither the education nor medicine books are allowed to be all together. At the end we will be multiplying by $4!$ to allow for permutations of the music books. But right now think of the music books as a single book. There are $8!$ arrangements of the "books." We want to subtract the bad arrangements, which have the medicines or the educations or both all together.  The counting of the bads can be done by standard Inclusion/Exclusion.
For the educations all together, we get $5!4!$, since there are effectively $4$ "books." For the medicines all together, we get $2!7!$, since there are effectively $7$ "books." But as is typical in Inclusion/Exclusion arguments, we have double-counted the educations and medicines both being together. The count there is $5!2!3!$. So the number of bads with musics counting as one book is $5!4!+2!7!-5!2!3!$. 
A: Neither answer is correct, but yours is closer.
The way you are counting $4!4!5!$ is not "only music and education together", but "at least music and education together". The same thing holds for $7!4!2!$.
That means you overcount the number of arrangements with all groups together (once in $4!4!5!$, once in $7!4!2!$ and once with $3!4!5!2!$. You missed a change of sign to make that issue cancel out. Do you see how to fix it?
A: With respect, I read the question as imposing only one restriction:  the music books must come in a block. "Only the music books must...";  the others may or may not... ( The question is poorly worded!)
With this minority opinion, there are $4!$ ways to create a music book block.  This block, along with the seven other books, make a set of 8 items to be arranged in $8!$ ways, for a total of $4!\times8!$
