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 at the ends?
There are 4 slots for math books 12 ways to place them (4 P 2)
for each of those 12 placements the other books can be arranged 4 * 3 * 2 * 1 = 24 ways
24 * 12 = 288 ways