The correct option is B 2(n−r−1)n(n−1)
If there are r books between 'A' and 'B' then the block of books with books A and B at the ends has length r+2. Consequently the block must begin in one of the first
n−(r+2)+1=n−r−1 positions
There are 2 ways to choose whether book A or book B is at the left end of the block.
There are (n−2)! ways to arrange the remaining books in order.
Hence the probability that there are exactly r books between A and B is
2(n−r−1)(n−2)!n!
=2(n−r−1)(n−2)!n(n−1)(n−2)!
=2(n−r−1)n(n−1)
Ans:=2(n−r−1)n(n−1)