You have 9 books total right? And presumably 9 spots on the book shelf. If all of the books were different, we'd just do 9 factorial. But since we have replicas of the same books, we're going to get duplicate combinations. To account for duplicates items in a set, we divide by the factorial of the number of duplicates. For example, 4 duplicate physics books means we divide by 4 factorial, and 3 duplicate algebra books means we divide by 3 factorial. When all is said and done, you'll have 9! / (4!*3!*2!). 9 for the original amOunt of books, and divide by the factorials of the duplicates to account for the duplicate sets from ordering them on the book shelf.