Question 875356
a)


The last slot is for the math book. So you really have 7-1 = 6 books to place in 7-1 = 6 slots. 


This gives you 6! = 6*5*4*3*2*1 = 720 ways to do this (order matters).


-------------------------------------------------------------------------------

b)


Group the 4 books and think of them as one book. Maybe you can bind them up with plastic wrap or something. 


So you really have 7-4+1 = 4 "books" (3 individual books + the group of 4 books)


Arranging these "books" gives you 4! = 4*3*2*1 = 24 ways to do this.


Now since you can arrange the books in the plastic binding (ex: ABCD is one way, BACD is another), this means you have 4! = 24 ways to arrange them.


So you really have 4!*4! = 24*24 = 576 ways to arrange the 7 books where 4 particular books must be together.