[Math] How many ways to order $14$ books

combinatoricsprobability

There are $5$ different history books, $7$ different physics books and $2$ different biology books means $14$ books in total.

How many different arrangements are possible if the books in each particular subject must all stand together? And only the physics books must stand together?

What I tried myself:

When all subjects must stand together, there are:

  • $5!$ possibilities ($= 120$) to order the history books.
  • $7!$ possibilities ($= 5040$) to order the physics books.
  • $2$ possibilities to order the biology books.

Which means there are $5162$ possibilities to order the books.

And for only the physics books must stand together:

  • $7!$ possibilities ($= 5040$) to order the physics books.
  • $7!$ possibilities ($= 5040$) to order the other books.

Best Answer

But you can also vary the order in which the groups of books stand together, so in the first case, you can permute the groups of books in $3!$ ways, so you need to multiply (rule of the product) $$(5!\times 7! \times 2 )\times 3! = 7257600$$ possibilities to order the books (say, on a shelf).

And in the second case, you can choose any one of eight spots to place the 7 physics book. That is we can take the 7 physics books and bundle them together as "one" with the seven remaining books as single books, and they can be arranged on the shelf in $X-X-X-X-X-X-X-X$ ways, the bundle occupying any one of $8$ spots.. So we need to multiply your total by $8$: $$7! \times 7! \times 8 = 7!\times 8!$$