The 7 books can be arranged in 5040 ways.
Explanation:
It is given that,
John has 7 books and he has not decided to arrange the books in order.
So, you need to find out how many ways he could arrange his 7 books.
The first place can be filled up by any one of the 7 books.
Having filled the first place with any one of the 7 books we are left with 6 books.
The second place now can be filled up by any on of 6 books and so on.
This process gets repeated until no books are left.
We can thus fill up all the 7 places in 7(6)(5)(4)(3)(2)(1) = 7!
⇒ 7! = 7×6×5×4×3×2×1
⇒ 5040 ways.
Hence, we can arrange 7 different books on a shelf in 5040 ways.