Answer:
There 384 ways.
Step-by-step explanation:
We can calculate the number of ways using a rule of multiplication as:
3 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 384
1st Book 2nd 3rd 4th 5th 6th 7th 8th
Because we have space for 8 books. Additionally, the first book can be any of the three types of books: Maths, History or physics. it means that we have 3 options for the 1st book.
But the options of the following spaces are limited by the book that is beside. So, if, for example, the first book is a Math Book, the second book just has 2 options: History or physics and the same situation apply for the 3rd to 8th book on the shelf.
So, there are 384 ways to arrange 8 books on the shelf.