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.
Probability and uniform distribution
-
0There's a related riddle. Two non-atomic (i.e. continuous) equidistributed random variables $X_1,X_2$ are sampled. You're given one of them, and you guess whether it is the smaller one or the larger one. Show that even without knowing the distribution you can always guess correctly with probability strictly greater than $1/2$! – 2011-02-07
5 Answers
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}. $
-
0As an exercise, apply the same method to compute the probability of $X_1 \geq aX_2$, where $X_1$ and $X_2$ are independent exponential rv's with different means. – 2011-02-07
There's no calculation to perform -- the answer must be $1/2$ by symmetry.
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
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.
-
0Yeah. I get it now. Thanks – 2011-02-07
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.
-
1See the answer by Shai Covo for a treatment of that case. To picture it on the square $[0,1]\times[0,1]$: A general principle for picturing inequalities is to consider the corresponding equation; the inequality picks out one side of the manifold (in this case a line) determined by the corresponding equation. So in your example, the equation would be $X_1=2X_2$, which is a line from the origin to the point $(1,1/2)$ on the right-hand border of the square. This line cuts out the lower-right half of the lower half of the square, so the probability is 1/4, in accordance with Shai Covo's result. – 2011-02-07
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?