Find probability and expectation 18 boys and 2 girls are made to stand in a line in a random order.Let $X$ be the number of boys standing in between the girls .Find $P[X=5]$ and $E[X]$. I proceed in this way:
Note that $$P[X=0]=\frac{19.18!.2!}{20!}=\frac{19-0}{20\choose2}$$
$$P[X=1]=\frac{18.18!.2!}{20!}=\frac{19-1}{20\choose2}$$$$P[X=2]=\frac{17.18!.2!}{20!}=\frac{19-2}{20\choose2}$$So, $$P[X=x]=\frac{19-x}{20\choose2}$$,$x=0(1)18.$
so.$$P[X=5]=\frac{19-5}{20\choose2}=0.0737$$ and $$E[X]=\sum_{x=0}^{18}x.\frac{19-x}{20\choose2}=6$$
 A: You're right.
There's a clever way of obtaining the expectation: add a third girl and arrange all $21$ people into a circle, then randomly break the circle at one of the girls to form a line.  This produces an identical distribution for $X$. But now there is an evident circular symmetry, which shows immediately that the expected number of boys between each of the three pairs of two adjacent girls (including the pair remaining in the line) is the same.  Because there are $18$ boys, that expectation must be $18/3 = 6$.
Edit
This argument can also be applied to find probabilities: the chance that $X\ge x$ must, by the same symmetry, be the chance that the first $x$ people in line are boys. Equivalently, the girls must be in the remaining $20-x$ positions, which can occur in $\binom{20-x}{2}$ distinct equiprobable ways out of all the $\binom{20}{2}$ possible pairs of positions.  Whence we find
$$\Pr[X=x] = \Pr[X\ge x] - \Pr[X\ge x+1] = \frac{\binom{20-x}{2}-\binom{20-(x+1)}{2}}{\binom{20}{2}} = \frac{19-x}{\binom{20}{2}}$$
for $x=0, 1, \ldots, 19$.  When $x=5$, this value is $14/190 \approx 0.0736842$.
