I have a feeling that this question is supposed to be easy, but I'm having a hard time with it (probably because I'm not familiar with conditional expectations with respect to $\sigma$-algebras):
Let $\Omega = \{(x, y)\in [0, 1]^2 \mid x\geq y\}$ and $P$ the uniform probability in $\Omega$. Define the $\mathcal{B}(\Omega)$-measurable random variables $X_1, X_2:\Omega\to\mathbb{R}$ with
$$X_1(x, y)=x$$ $$X_2(x, y)=y$$
for every $(x, y)\in \Omega$. Find the explicit formula for the conditional expectation $E[X_2\mid \sigma(X_1)]$ in terms of $X_1$ and $X_2$ (where $\sigma(X_1)=\{X_1^{-1}(A)\mid A \in \mathcal{B}(\mathbb{R})\}$).
I only know the formal definition of conditional expectation, but this problem made me realize that I have no clue how to find the explicit formula in concrete examples.
It's a general fact that if $X$ and $Y$ are random variables (with $X$ having finite expectation) and $\mathcal{G}=\sigma(Y)$, then there is a Borel function $f:\mathbb{R}\to\mathbb{R}$ such that $$ \mathbb{E}[X\mid\mathcal{G}]=f(Y) $$
So it's enough to determine $f$. In this case $X_1$ and $X_2$ have a joint pdf $$ f_{X_1,X_2}(x,y)=2\cdot1_{0\leq y\leq x\leq 1}$$ hence the marginal pdf of $X_1$ is $$ f_{X_1}(x)=\int f_{X_1,X_2}(x,y)\;dy=\int_0^x2\;dy=2x\cdot 1_{0\leq x\leq 1} $$ so the conditional pdf is $$ f_{X_2|X_1}(y|x)=\frac{1}{x}\cdot 1_{0\leq y\leq x} $$ for $0\leq x\leq 1$. From this we can conclude that $X_2$ is uniformly distributed on $[0,X_1]$, hence $$ \mathbb{E}[X_2\mid X_1]=\frac{X_1}{2} $$