# $f(U_1|U_1>U_2)$ where $U_1$ and $U_2$ are independent uniform variables

We have two distributions of uniform random variables over $(0, 1)$ named $U_1$ and $U_2$ (and they are independent). How can we calculate $f(U_1|U_1>U_2)$, $f(U_2|U_1>U_2)$, $E(U_1|U_1>U_2)$ and $E(U_2|U_1>U_2)$? I tried to use $f(x|y) = f(x,y)/f(y)$ but what does $f(U_1, U_1>U_2)$ even means? I can't think about it since $U_1>U_2$ is a condition and $U_1$ is a random variable.

• Hello, user188461, and welcome to the site! We like users who are asking about homework or self-study to add the "self-study" tag, so we know to guide them to the answer rather than simply provide them with one (which doesn't necessarily aid understanding as much as the other approach.) – jbowman Dec 13 '17 at 19:12
• Note that since $U_1$ and $U_2$ have the same distribution, you only need to solve the problems for $U_1 > U_2$, as the problem is symmetric in $U_1$ and $U_2$. – jbowman Dec 13 '17 at 19:20
• When used as an argument in the pdf, do use lower case letter instead of uppercase. So it is clearer to state $f(u_1 | U_1 ＞ U_2 )$, instead of $f(U_1 | U_1 ＞ U_2 )$. – Zhanxiong Dec 17 '17 at 15:43

On a general basis [rather in the special case you mention, since this seems to come from an exercise], finding the distribution of one or several random variable(s) $X$ given an event $A$ can proceed by introducing the event as a new random variable$$Y=\mathbb{I}_A(X)$$which takes values 1 and 0 depending on whether or not the event occurred. This means creating the joint distribution of $X$ and $Y$, which can be derived from the distribution density $f$ of $X$ [assuming a density with respect to a given measure] as$$X,Y\sim f(x)\times \mathbb{I}_A(x)^y \mathbb{I}_{A^c}(x)^{1-y}$$From the joint density, you can derive the conditional$$X|Y=y\sim f(x)\times \mathbb{I}_A(x)^y \mathbb{I}_{A^c}(x)^{1-y}\big/ \mathbb{P}(A)^y\mathbb{P}(A^c)^{1-y}$$

The picture below may help you to get some intuition behind the meaning of $f(U_1\vert U_1>U_2)$ and $f(U_1 , U_1>U_2)$ in terms of relative area. You could evaluate the probability by using an integral that computes the cumulative distribution function.

$$P(U_1 \leq x \vert U_1>U_2) = \frac{P(U_1 \leq x, U_1>U_2)}{P(U_1>U_2)} = \frac{\int_0^x \left( \int_{U_2}^x f(U_1,U_2) dU_1 \right) dU_2}{\int_0^1 \left( \int_{U_2}^1 f(U_1,U_2) dU_1 \right) dU_2 } = x^2$$

where the second equality follows when we plug in the uniform density $f(U_1,U_2)=1$.

To go back to the intuitive picture. This $P(U_1 \leq x , U_1>U_2)$ is related to the area $\frac{1}{2}x^2$ of the little triangle from (0,0)-(0,x)-(x,x), which is when $U_1<x$ and $U_1>U2$. This $P(U_1>U_2)$ is related to the area $\frac{1}{2}$ of the triangle from (0,0)-(0,1)-(1,1), which is when $U_1<1$ and $U_1>U_2$.

• (+1) Very nice explanation. As the question seems to correspond to an exercise (unless the OP states otherwise), it could have been better not to provide a complete resolution. – Xi'an Dec 17 '17 at 16:22
• @Xi'an you are right about the complete resolution. I was worried about that, to give an easy way out (for that reason I gave $x^2$ which still needs to be differentiated), before I found out that the question was 4 years old. anyway the matter of solving homework questions is a tricky situation. On the one hand student's need to train and practice doing these questions independently. On the other hand students that are looking on the Internet for answers might be more of the type who still need to understand before they can even start training. This particular case is mostly instructive. – Sextus Empiricus Dec 17 '17 at 19:29
• Oh I thought December 13 was this week and not December of 2013! – Xi'an Dec 17 '17 at 19:59
• Oops, my mistake. Not 4 years ago. Anyway, I don't believe this is much like a practice question, and more like an understanding question. – Sextus Empiricus Dec 17 '17 at 21:15