In how many ways can five distinct books be arranged in two bookshelves

combinatorics

From the problem statement $n = 5$ and $r=2$

When I apply the values in the formula $^nP_r=\frac{n!}{(n-r)!}$

I get the value $\frac{5!}{(5-2)!} = \frac{5*4*3*2*1}{3*2*1} = 20$

And it is a wrong answer. How to solve this problem correctly?
enter image description here

Best Answer

For each of the $120$ permutations of the five books, we can split the permutation of books in six ways. Imagine the division to be a bar, and the stars to be the books:

$$|*****$$ $$*|****$$ $$**|***$$ $$***|**$$ $$****|*$$ $$*****|$$

This is assuming the bookshelves are distinct. 120*6 = 720.