Expectation of conditional uniform variates I have two random variables $X_{1}, X{2}$ following $U(0,1)$. I need to compute $E(X_{1}|X_{1} > X_{2})$.
I am thinking that since the random variables are independent, so $X_{1}|X_{1} > X_{2}$ should just be $X_{1}$ and its expectation should be $\frac{1}{2}$.
I don't have answer of this problem. I just want to check whether my approach is correct.
 A: No, the event $X_1>X_2$ provides some information. Consider a more general case where you have independent $X_1,..,X_n$ and the event $\bigcap_{i=2}^n X_1>X_i$, surely you have the right to suspect that $X_1$ is closer to $1$ more probably than $0$.
For your question, there are various ways to calculate it, normalise the joint distribution in the region where $X_1>X_2$ and take the expectation. The answer will be $2/3$ (or a more straightforward way: $x_1$ coordinate of the center of mass of the triangle region).
A: Comment. illustrating @gunes (+1) argument via simulation in R.
set.seed(2021)
X1 = runif(10^6);  X2 = runif(10^6)
mean(X1[X1>X2])
[1] 0.6668622  # aprx 2/3

In the figure below, $E(X_1|X_1 >X_2)= 2/3$ is the
the average horizontal value of the blue points.
#smaller samples for clearer figure
x1 = X1[1:30000];  x2 = X2[1:30000]
plot(x1, x2, pch=".")
 points(x1[x1 > x2], x2[x1 > x2], pch=".", col="blue")


hist(X1[X1 > X2], prob=T, col="skyblue2")
 curve(dbeta(x,2,1), add=T, col="orange", lwd=2, n = 10001)


