Ways to arrange books 
$2$ different History books, $3$ different Geography books and $2$ different Science books are placed on a book shelf. How many different ways can they be arranged? How many ways can they be arranged if books of the same subject must be placed together?

For the first part of the question I think the answer is 
$$(2+3+2)! = 5040 \text{ different ways}$$
For the second part of the question I think that I will need to multiply the different factorials of each subject. There are $2!$ arrangements for science, $3!$ for geography and $2!$ for history. Am I correct in saying that the number of different ways to place the books on the shelf together by subject would be 
$$2! \times 3! \times 2! = 24 \text{ different ways}$$ 

All the books can be arranged in $(2+3+2)!=7!$ ways
There are $3$ branches, three units of books: $\{$History$\}$,$\{$Geography$\}$,$\{$Science$\}$- Arranging branches $=3!$ ways.
Arranging the books within the branches:
History: $2!$
Geography: $3!$
Science:$2!$
Total $=3!(2!\times3!\times2!)=144$ ways
