There are two different Geography books, five different Natural Sciences books, three different History books and four different Mathematics books on a shelf. In how many different ways can they be arranged if all the books of the same subjects stand together?

Correct Answer: 829440
There are four groups of books which can be arranged in 4! different ways. Among those books, two are Geography books, five are Natural Sciences books, three are History books and four are Mathematics books. Therefore, there are 4! × 2! × 5! × 3! × 4! = 829440 ways to arrange the books.