If $n$ people, among whom are $A$ and $B$, stand in a row, what is the probablity that there will be exactly $r$ people between $A$ and $B$ Question 17 from chapter 2, an introduction to probability theory and its applications by William Feller.
I reached the answer by realising that there $(n-r-1)$ ways to arrange $A$ and $B$ such that there are $r$ people in between. Then multiplying by $2$ as there are two ways $A$ and $B$ can be arranged, finally multiplying by $(n-2)!$, which is the number of ways to rearrange the remaining people. Then dividing by total number of ways to arrange the people, $n!$
So my answer is $\frac{2.(n-r-1).(n-2)!}{n!}$. The book's answer is $\frac{2.\frac{(n-2)!}{(n-2-r)!}(n-r-1)!}{n!}$.
So my answer is correct. However, I have the feeling that perhaps I'm not taking the simplest route to answers. So I tried to reverse-engineer the books answer. In paticular the terms in the numerator.
The $2$ I assume comes from same as mine, ways to arrange $A$ and $B$. The second term, $\frac{(n-2)!}{(n-2-r)!}$ I assume is the number of ways to arrange the $r$ people between $A$ and $B$.
The third term is the one of interest. I've tried to figure out where it comes from and the best I've come up with is that it is really $(n-r-1)$ multiplied by $(n-r-2)!$, the former being the number of ways to arrange $A$ and $B$ with $r$ people in between, and the latter being the number of ways to arrange the remaining people outside of $A$ and $B$ which when multiplied together become the third term $(n-r-1)!$.
Since I'm self-studying, I'm not sure if I'm missing a trick? or do you think this is how the book derived their answer?
 A: For the record, I think your approach is perfectly fine and no less straightforward than the book's answer.

The "quick" way to interpret $(n-r-1)!$ is to realize that the segment of $r+2$ people between $A$ and $B$ inclusive can be moved together as one "big person," so that you just need to permute $n-r-2$ normal people and one "big" person: $(n-r-1)!$.
A: If there are exactly $r$ people between $A$ and $B$, then there are $n - (r + 2) = n - r - 2$ other objects to arrange in addition to the block.  Therefore, there are a total of $n - r - 2 + 1 = n - r - 1$ objects to arrange, the block and the other $n - r - 2$ objects.  The $n - r - 1$ objects can be arranged in $(n - r - 1)!$ ways.  There are $\binom{n - 2}{r}$ ways to select the people between $A$ and $B$, $r!$ ways to arrange them within the block, and $2!$ ways to arrange $A$ and $B$ at the ends of the block, giving
$$\binom{n - 2}{r}r!2!(n - r - 1)! = \frac{(n - 2)!}{r!(n - 2 - r)!} \cdot r!2!(n - r - 1)! = 2 \cdot \frac{(n - 2)!}{(n - 2 - r)!} \cdot r!$$
favorable cases.
The authors thought of selecting and arranging the $r$ people between $A$ and $B$ in one step, giving the term
$$\binom{n - 2}{r}r! = \frac{(n - 2)!}{r!(n - 2 - r)!} \cdot r! = \frac{(n - 2)!}{(n - 2 - r)!}$$
