Probability of choose point in interval (0,1) Choose a point random uniformly in $(0,1)$. Then, this point divides the interval (0,1) into two sub-intervals.

*

*Compute the expected length of the interval containing a fixed point $s \in [0,1]$.


*Compute the expected distance of the randomly chosen point from $s$.
My approach: My intuition is that the expected length of the interval containing $s$ is 1/4, since on average the sub-intervals should be about length 1/2 each, and $s$ is in exactly one of them. I don't know how to mathematically prove this intuition if it's correct. I have no idea how to approach 2.

Let $X\sim \text{Unif}(0,1)$ and $L_X(s)$ be the length of the interval that contains $s$ and comes from the division by the point $X$. What we need to compute is $E(L_X(s))$, so having an expression for $L_X(s)$ as a function of $X$ should suffice to compute such expectation.
Observe that given the value of $X$, the length of the interval containing $s$ is $X\delta_{s<X}+(1-X)\delta_{s>X}$, so it follows that
$$E(L_X(s))=E(X\delta_{s<X}+(1-X)\delta_{s>X})=E(X\delta_{s<X})+E((1-X)\delta_{s>X}).$$
Finally note that
$$E(X\delta_{s<X})=\int_0^1 x\delta_{s<x}dx=\int_s^1 xdx=\frac{1}{2}-\frac{s^2}{2}$$
$$E((1-X)\delta_{s>X})=\int_0^1 (1-x)\delta_{s>x}dx=\int_0^s (1-x)dx=s-\frac{s^2}{2},$$
so by adding you get that
$$E(L_X(s))=\frac{1}{2}+s-s^2.$$
