[Math] the expected distance between these two points

probability

Suppose you have a straight line of length L, and a point is chosen at random along the line.

Now suppose a second point is chosen at random to the left of the first point.

What is the expected distance between these points?

Note: I am aware that if two points are independently chosen at random, the expected distance is L/3, but is it the case in this scenario where the second point is dependent upon the first? Please justify answers with mathematics.

Best Answer

We have the density function for uniform $x\in[0,L]$ and uniform $y\in[0,x]$ $$ f(x,y)=\frac 1L\cdot\frac 1x $$ so it is $$ \int_0^L\int_0^x (x-y)\frac 1L\cdot\frac 1x\ dy\ dx=\frac L4 $$ which can be confirmed by this Wolfram|Alpha-computation.