Combinatorics homework Here's a question from my homework. First 2 questions I solved (but would appreciate any input you can give on my solution) and the last question I'm just completely stumped. It's  quite complicated.
On the shelf there are 5 math books, 3 science fiction books and 2 thrillers (all of the books are different)
1) In how many different combinations can you organize the books on the shelf, without any limitation? **My answer: $10!$ since all the books are different, it's just organizing 10 books.
2) In how many different combinations can you organize the books so that books of the same kind are next to each other? **My answer: $3!*5!*3!*2!$ - first imagine all the math books are just 1 block, all the sci fi books are 1 block, and that the 2 thrillers are 1 block. I have $3!$ ways to organize these blocks on the shelf. The $5!*3!*2!$ is due to the order of the books inside the block.
3) How many different combinations are there to organize the books such that the sci fi books are together, and there is at least 1 book inbetween the thrillers?
**My answer: I don't know. It's too complex. I thought maybe simplying it by saying at least 1 book  in between = combinations with 1 book in between + combinations with 2 books etc but even that doesn't make it any simpler...
Help? :)
 A: If the sci-fi books are together, consider them a single element again that can be permuted ($3!$) times and thus the eight books (with three being considered one book) have 6! rearrangements. If there is at least one book in between the thrillers, then there are (2!9) permutations where the thrillers aren't separated by a book. Thus, we have $3!6!8 - 2!9$.
A: Well, first of all, let's see how many ways we can put other books around the thrillers, ignoring distinctions between books of the same type. To begin with, we are going to have two thrillers, with space between and to either side:
$$\text{_T_T_}$$
Now, we must put another book in between them. There are two cases to consider, here.

Case 1: There are no sci-fi books between the thrillers.
After placing the sci-fi-books, our arrangement is one of the following:
$$\text{_SSS_T_T_}$$
$$\text{_T_T_SSS_}$$
In either case, we must place a math book in between the thrillers, so our possible arrangements are:
$$\text{_SSS_T_M_T_}$$
$$\text{_T_M_T_SSS_}$$
Now we have $4$ more math books to place. Note that if we put a math book next to the math book we've already placed, then it doesn't really matter which side we put it on (as far as distinguishing between these arrangements), so these arrangements can be thought of as:
$$\text{_SSS_T_MT_}$$
$$\text{_T_MT_SSS_}$$
Any or all of the $4$ remaining math books can be placed in any of the remaining $4$ slots, so there are $2\cdot 4^4$ arrangements of $3$ $\text{S}$s, $5$ $\text{M}$s, and $2$ $\text{T}$s in which the $\text{T}$s are not consecutive, the $\text{S}$s are consecutive, and the $\text{S}$s are not between the $\text{T}$s.

Case 1: There are sci-fi books between the thrillers.
Since we must place the sci-fi books in a block, then our arrangement is:
$$\text{_T_SSS_T_}$$
Any or all of the $5$ math books can be placed in the remaining $4$ slots, so there are $4^5$ arrangements of $3$ $\text{S}$s, $5$ $\text{M}$s, and $2$ $\text{T}$s in which the $\text{T}$s are not consecutive, the $\text{S}$s are consecutive, and the $\text{S}$s are between the $\text{T}$s.

Between the two cases, we have $2\cdot 4^4+4^5=1536$ arrangements of $3$ $\text{S}$s, $5$ $\text{M}$s, and $2$ $\text{T}$s in which the $\text{T}$s are not consecutive, but the $\text{S}$s are consecutive. Now, all that remains is to order the books in each category. There are $5!3!2!$ ways to do this, and so we have $1536\cdot 5!3!2!$ arrangements of the given type.
