# 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

How many ways can the books be arranged? As you said = $(2+3+2)! = 7!$

If the books of the same subject need to be arranged together you need to calculate de permutations for the groups and multiply them by the permutations within every category.

$3! (2! \times 3! \times 2!) = 144$ ways

Groups permutatios x (history permutations x geography permutations x science permutations)

• Welcome to MathSE. Please read this MathJax tutorial, which explains how to typeset mathematics on this site. – N. F. Taussig Aug 25 '18 at 18:24

If the books of the same subject must be placed together, there are in essence three "packs," and these can be ordered in just $3! = 6$ ways, where I assume that the order within a pack is irrelevant. If that order is not irrelevant, you then have $3!=6$ ways to arrange the packs, then within the associate packs you have $2!=2$, and $3!=6$ and $2!=2$ ways to order the books. Thus the total is $3! 2! 3! 2! = 144$ ways.

If the seven books are distinct, one can indeed order them in $7!$ ways.