I just started learning conditional expectation, so I'm a bit stuck with this problem:
Find $\mathbb{E}(Y\,\mid\,X)$ when $(X,Y)$ is uniformly distributed on the triangle with vertices $(0,0), (1,0), (1,1).$
My question is from where to begin and can I approach problems with conditional expectation?
The joint distribution is $$f_{X,Y}(x,y)=\begin{cases}2&\text{ if }&0\leq y\leq x ,\ 0\leq x\leq 1\\ 0&\text{otherwise }.\end{cases}$$ Then $$f_X(x)=\int_0^xf_{X,Y}(x,y)\ dy=2\int_0^x\ dy=2x,\ \text { if }0\leq x\leq 1.$$
So $$f_{Y|X=x}(y)=\frac{f_{X,Y}(x,y)}{f_X(x)}=\begin{cases}\frac1x&\text{ if }&0\leq y\leq x ,\ 0\leq x\leq 1\\ 0&\text{otherwise }.\end{cases}$$ Finally $$E[Y\mid X=x\ ]=\int_0^1yf_{Y|X=x}(y)\ dy=\int_0^x\frac yx\ dy=\frac12x. $$ if $0\leq x\leq 1$.
This is all in accordance with intuition supported by the figure below: