# A simple permutation question - discrete math

There are five distinct computer science books, three distinct mathematics books, and two distinct art books. In how many ways can these books be arranged on a shelf if one of the art books is on the left of all computer science book, and the other art book is on the right of all the computer science books?

For my answer I was thinking since there are $10$ books total and $5$ are computer science books, then I could place an art book on the first, second, third, fourth slot ... but I do not know how to finish it, I am sure it has something to do with rule of sum. Any advice appreciated. Thank you.

-
Seems to me $5! \times 2! \times ^{10}P_3$; what is the answer? – Quixotic Dec 2 '11 at 5:53
What does $\times^{10}P_3$ mean? – Fixee Dec 2 '11 at 5:57
I think same as P(10,3) = 10!/(10-3)! – Farshid Palad Dec 2 '11 at 5:59
@Fixee:$\quad ^nP_r =n\times (n-1) \times (n-2) \times (n-3) \times \cdots \times (n-r+1)$ – Quixotic Dec 2 '11 at 6:01
Wow, I've never seen that notation. I guess I need to get out more. – Fixee Dec 2 '11 at 6:03

You are going in the right direction, but don't think in terms of slots. Just organize the books on the floor, then put them on the shelf.

First, order the computer science books. There are $5!$ ways of putting them in. Then put the two art books on both ends; there are $2$ ways of doing it.

Now you have $7$ books, with eight spaces between and to the left and right of them. We just need to put in the three math books. Let's say they are a Calculus I, a Calculus II, and a Calculus III textbooks.

We put in the Calc I book first. There are 8 places where it can go, relative to the other 7 books. Next, put the Calc II book in; there are 9 places where it can go, relative to the other 8 books that have already been placed. Finally, put in the Calc III book.

-
By your great explanation I arrived the following , 5! * 2! * P(10,3) , and MaX seems to agree. Thank you. – Farshid Palad Dec 2 '11 at 5:57
@Capriano: I don't think $P(8,3)$ is correct according to Arturo's answer. $P(8,3) = 8\times 7\times 6$. – Fixee Dec 2 '11 at 6:01
Yeah that was a typo I edited, thanks for the heads up. I meant 10 x 9 x 8 :) – Farshid Palad Dec 2 '11 at 6:02
@Capriano & @Fixee :$^{8}P_3$ is not correct here as it does not take care of the arrangements where two or three distinct distinct mathematics books is together.In other words, there are $^{n}P_r$ ways to distribute $r$ distinct balls into $n$ distinct cells with at most one ball per cell. – Quixotic Dec 2 '11 at 6:15

It's unclear (to me) from your question if the first art book must always be on the left and the second art book must always be on the right? Let's assume that's the case.

Order the computer books first. There are $5!$ ways, since they are distinct. Next put the art books on the ends, and there is only one way to do this (because of my assumption above). Finally, there are $3$ math books left with 8 slots to choose from; there are no restrictions on these math books.

You have $8$ choices for the first math book, $9$ for the second, and 10 for the last. So in total,

$$5! \cdot 8 \cdot 9 \cdot 10 = 86400$$

You should double this if my first assumption is wrong.

-
Yes you are correct but the answer should be doubled because it doesn't matter which art book goes left or right, just as long as they are not in between computer science books. – Farshid Palad Dec 2 '11 at 6:01

There are five distinct computer science books, three distinct mathematics books, and two distinct art books. In how many ways can these books be arranged on a shelf if one of the art books is on the left of all computer science book, and the other art book is on the right of all the computer science books?

You want arrangements like _A_C_C_C_C_C_A_, where the 3 math books can be placed in any of these 8 spaces before before, between, and after the art and computer science books. So we count the ways to arrange the books of each type among themselves, then count the ways to place the math books

You also have to account for cases where two or three math books are placed into the one spot (while preserving their already selected order).

$$5!\;2!\;3!\;\bigg({^8\mathrm C_3}+2\;{^8\mathrm C_2}+{^8\mathrm C_1}\bigg)$$

-

answer is $2520$

Number of permutations of $n$ things, taken all at a time, in which $p$ are of one type, $q$ of them are of second-type, $r$ of them are of third-type, and rest are all different is given by $$\frac{n!}{p! q! r!}$$ so $$\frac{10!}{5! 3! 2!} = 2520$$

-
This is inaccurate. What you describe are called "distinguishable permutations", and would be accurate only if the books of the same type were identical. – Cameron Buie Nov 2 '12 at 20:24