Struggling with writing the diagram mathematically

22 Views Asked by At

There are $5$ chemistry and $4$ physics books. How many ways can these books be arranged in a manner that physics and chemistry books will be among themselves?

By visualizing what question wants me to do, I drew a diagram as illustrated below. Recall $C$ chemistry book, $P$ physics book.

$$C_{1}C_{2}C_{3}C_{4}C_{5}P_{1}P_{2}P_{3}P_{4}$$

It seems to be enough to solve the question. However, how do I rewrite it mathematically now?