If I select two numbers $x_1,x_2$ from the interval $(0, 1)$, what is the probability $x_1 <x_2$?

The question is in the description. One of the answers I am getting is $\int_0^1 {x (1-x) }=1/6$.

The other answer I am getting is there are only two possibilities: $x_1>x_2$ and $x_1<x_2$. Hence probability is 1/2

Any help would be great.

• There's actually a third possibility, $x_1=x_2$, but that occurs with probability 0 so can be discarded. It should be $\frac 1 2$ in my book – Alan Jun 17 '15 at 2:25

If $X_1, X_2 \sim U(0,1)$ are uniformly distributed and independent, then the joint density is $f_{X_1X_2}(x_1,x_2) = 1$ and
$$P(X_1 < X_2) = \int_0^1 \int_0^{x_2} \, dx_1 \, dx_2 = 1/2.$$
• Nice answer! But what if there would have been a third possibility as $x_1=x_2$ such as $x_1=x_2=0.3$? That is repetition is allowed? What will be $P(X_1 < X2) =$ – NeilRoy Jun 17 '15 at 2:44
If $X_1,X_2 \sim U(0,1)$ are uniformly distributed and independent, we have by the elementary law of total probability
$$\mathbb{P}(X_1 < X_2) = \int_{-\infty}^{\infty}\mathbb{P}(X_1 < X_2 | X_2 = s)f_{X_2}(s)ds = \int_{0}^{1}\mathbb{P}(X_1 < s)ds = \int_{0}^{1}sds = \left[\frac{1}{2}s^2 \right]_{0}^{1} = \frac{1}{2}$$
Where we have used the result that for $s \in [0,1]$ we have $f_{X_2}(s)$ is $1$ (and $0$ otherwise), and that $\mathbb{P}(X_1 < s) = s$.