Suppose that I have 6 different books, 2 of which are math books. In how many ways can I stack my 6 books on a shelf if I do not want the math books to be next to each other?
Another way to see this = total arrangements possible less the arrangements where the math books are together
Total arrangements = 6! = 720
Total arrangemens where the math books are together = they can occupy any of 5 positions....and for each of these positions, they can be arranged in two ways......and for each of these, the other books can be arranged in 4! ways ......so we have 5 * 2! * 4! = 10 * 24 = 240
So........720 − 240 = 480 ways
As NinjaAnswer found !!!!
We first place the non-math books. There are 4 choices for the first book, 3 choices for the second book, 2 choices for the third book, and 1 choice for the last book. Then we have to put the two math books between the four non-math books such that there is at least one non-math book between the two math books. We see there is a total of 5 openings created by the four non-math books. So the first math book has 5 choices, and the second math book has 4 choices.
So the total number of ways the books can be placed is 4*3*2*1*5*4 = 480
Another way to see this = total arrangements possible less the arrangements where the math books are together
Total arrangements = 6! = 720
Total arrangemens where the math books are together = they can occupy any of 5 positions....and for each of these positions, they can be arranged in two ways......and for each of these, the other books can be arranged in 4! ways ......so we have 5 * 2! * 4! = 10 * 24 = 240
So........720 − 240 = 480 ways
As NinjaAnswer found !!!!