Probability and uniform distribution How to calculate the probability that one random sample say $X_1$ will be greater than the other random sample say $X_2$ if they are from a uniform distribution with $[0,1]$ ? This is not a homework. I'm trying to solve some exercise problem and this is a part of the problem.
 A: You could do it by integration or argue out directly. 
To argue out directly, all you need to recognize is that since the two samples are independent, $P(X_1>X_2) = P(X_1<X_2)$. And we have $P(X_1>X_2)+P(X_1=X_2)+P(X_1<X_2) = 1$ since all three are mutually exclusive. $P(X_1=X_2) = 0$ and hence we get $P(X_1>X_2) = P(X_1<X_2) = \frac{1}{2}$.
To do it by integration, first find the $P(X_1>X_2 | X_2=x)$. Since the distribution is uniform, $P(X_1>X_2 | X_2=x) = 1-x$. Now $P(X_1>X_2) = \displaystyle \int_{0}^1 P(X_1>X_2 | X_2=x) f_{X_2}(x) dx = \int_{0}^1 (1-x) \times 1 dx = \frac{1}{2}$
EDIT:
As Yuval points out this is true irrespective of the distribution.
The direct argument holds good irrespective of the distribution.
Also, leonbloy's argument  based on areas still work out fine irrespective of the distribution.
As for the argument based on integration,
$P(X_1>X_2 | X_2=x) = 1-F_{X}(x)$.
Now,
$P(X_1>X_2) = \displaystyle \int_{ll}^{ul} P(X_1>X_2 | X_2=x) dF_{X_2}(x) = \int_{ll}^{ul} (1-F_X(x)) dF_X(x)$.
Hence,
$P(X_1>X_2) = \displaystyle \int_{ll}^{ul} (1-F_X(x)) dF_X(x) = \int_{ll}^{ul} dF_X(x) -\int_{ll}^{ul} d(\frac{F_X^2(x)}{2})$
$P(X_1>X_2) = F_X(ul) - F_X(ll) - \frac{F_X^2(ul) - F_X^2(ll)}{2} = 1 - 0 - \frac{1-0}{2} = \frac{1}{2}$
All these seemingly different arguments are fundamentally the same way of expressing the same idea but I thought it would be good to write it out explicitly.
A: There's no calculation to perform -- the answer must be $1/2$ by symmetry.
A: Just plot the posible pair ocurrences  (in the $X_1-X_2$ plane: it lies inside the unit square), identify the "success" region (in which $X_1>X_2$ : a triangle). The probability is given (assuming that the variables are not only uniform but also independent) by the area of the triangle. That is, $1/2$.
In this particular problem, it's easy to guess the result from its symmetry. 
A: Consider the following experiment. Pick $X_1,X_2$ independently, uniformly at random from $[0,1]$; now, with probability $1/2$, switch $X_1$ and $X_2$. What does this tell you about the probability you're looking for?
A: Let's consider the more general case of the probability ${\rm P}(X_1 \geq a X_2)$, where $a \geq 1$ is constant.
You can find this probability as follows. Use the law of total probability, conditioning on $X_2$, to obtain
$$
{\rm P}(X_1 \geq a X_2) = \int_0^1 {{\rm P}(X_1  \ge aX_2 |X_2  = u)\,{\rm d}u} = \int_0^1 {{\rm P}(X_1  \ge au)\,{\rm d}u}, 
$$
where the last equality follows from independence. Hence, since $a \geq 1$,
$$
{\rm P}(X_1 \geq a X_2) = \int_0^{1/a} {{\rm P}(X_1  \ge au)\,{\rm d}u}  + \int_{1/a}^1 {{\rm P}(X_1  \ge au)\,{\rm d}u}.
$$
Finally, we obtain
$$
{\rm P}(X_1 \geq a X_2) = \int_0^{1/a} {(1 - au)\,{\rm d}u}  + 0 = \frac{1}{a} - a\frac{1}{{2a^2 }} = \frac{1}{{2a}}.
$$
In particular, 
$$
{\rm P}\bigg(X_1  \ge \frac{{3X_2 }}{2}\bigg) = \frac{1}{{2(3/2)}} = \frac{1}{3}.
$$
