Here is the question:

If Sam and Peter are amongnmen who are arranged at random in a line, what is the probability that exactlykmen stand between them?

My solution:

1. Group Sam and Peter and thekmen together and count them as one person.

2. So in effect, we have(n-k-2+1)number of people.

3. Simplify that and we getn-k-1

4. There are(n-k-1)!ways of arranging them.

5. There are then2more ways of arranging Sam and Peter by switching them around.

6. Finally, there arek!ways of arranging the k people between Sam and Peter

7. There aren!ways of arranging everyone without any restrictions.

8. Therefore the solution is:

(n-k-1)! * 2 * k! / n!

However, the book solution is2*(n-k-1)/n*(n-1)

I checked by plugging some numbers and my answer is different from the book. Can someone explain what I'm missing?

Thanks