Each number being multiplied represents the number of choices of books for each slot on the shelf.
8 x 7 x 6 x 5 x 4 = 6720 ways
first 3 slots 8, 7,6 choices of math.. number goes down by one because the previous slot was filled. last 2 slots 5, 4 choices of science books