The Library has just bought 3 identical Math Books, 3 identical Literature Books, 3 identical Science Books and 3 identical Novels.
The Librarian wants to arrange the books in the shelf so that, no 3 identical books stand in a row.
For example, he can arrange MMLLSSNNMLSN but he can't arrange SS MMM LLNNSLN.
In how many different ways can the Librarian arrange the books?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The total number of ways to arrange the books can be calculated by Permutations with Repetition : ( 3 ! ) 4 1 2 ! = 3 6 9 6 0 0 .
Now, we calculate how many ways there are to arrange the books such that there exists 3 identical books in a row . There are 4 ways to choose which kind of books to put them together, e.g. Math Books. Consider only 10 things: a group of Math Books and 9 other books. Again by Permutations with Repetition, there are 4 × ( 3 ! ) 3 1 0 ! = 6 7 2 0 0 ways . Now, we calculate how many ways there are to arrange the books such that there exists 2 groups of 3 identical books in a row . Similarily, there are ( 2 4 ) × ( 3 ! ) 2 8 ! = 6 7 2 0 ways.
The number of ways to arrange the books such that there exists 3 groups of 3 identical books in a row is ( 3 4 ) × 3 ! 6 ! = 4 8 0 . And for 4 groups, there are 4 ! = 2 4 ways.
Now using Principle of Inclusion and Exclusion , the number of ways which satisfies the problem's conditions is 3 6 9 6 0 0 − 6 7 2 0 0 + 6 7 2 0 − 4 8 0 + 2 4 = 3 0 8 6 6 4 .
I like this problem because it uses a lot of combinatorics functions.