Final answer:
a) The number of ways to arrange the books if books of the same language must be grouped together is 14,400. b) The number of ways to arrange the books if French and Spanish books must alternate is 28,800.
Step-by-step explanation:
a) If the books of the same language must be grouped together, first we need to consider the arrangement of the French books. There are 5 French books, so they can be arranged in 5! (5-factorial) ways. Similarly, the Spanish books can be arranged in 5! ways. Therefore, the total number of ways to arrange the books is 5! x 5! = 120 x 120 = 14,400 ways.
b) If the French and Spanish books must alternate in the grouping, we can start with a French book. There are 5 choices for the first French book. Then, there are 5 choices for the first Spanish book, followed by 4 choices for the second French book, and so on, until the last Spanish book (1 choice). Therefore, the total number of ways to arrange the books in this case is 5 x 5 x 4 x 4 x 3 x 3 x 2 x 2 x 1 = 28,800 ways.