Probability Triangle vertices Let $X$ and $Y$ be the two coordinates of a point, which is uniformly chosen in the triangle with vertices $(0,0), (1,1)$ and $(-1,1)$ 
a) compute $E(X), E(Y)$
b) the condintional expectations $E(X\mid Y=y)$ and $E(Y\mid X=x)$
I know that by symmetry the expected value of X should be zero, but how do I show this. How to I show $E(Y)$
Thanks
 A: The point is selected uniformly inside a triangle $T$ of area $1$.  
By examining a sketch of that triangle, we can see the density of $Y=y$ will be equal to the length of the horizontal cross-section at that height, which is $2y$.

In full.
The probability density function of this is $f_{X,Y}(x,y) = \mathsf 1_{\langle x, y\rangle\in T}$.
The support of the coordinate pair is the triangle: $\{\langle x, y\rangle:y\in (0;1), x\in (-y;y)\}$
By definition: $$\begin{align}
\mathsf E(Y) & = \int_0^1\int_{-y}^{y} y f_{X,Y}(x,y)\operatorname d x\operatorname dy
\\ & = \int_0^1 y \int_{-y}^{y} 1\operatorname d x\operatorname dy
\end{align}$$

 Furthermore the expectation point should be the centroid (or centre of mass) of the triangle, which clearly is at $\langle 0, 2/3\rangle$.


The points will be uniformly distributed over the horizontal cross section, so $f_{X\mid Y} (x\mid y)=1/(2y)$. 
$$\begin{align}
\mathsf E(X\mid Y=y)
 & = \int_{−y}^{y} x\,f_{X\mid Y} (x\mid y)\operatorname dx
\\
 & = 0
\end{align}$$
Which is the expected value of a random variable uniformly distributed over $[-y;y]$ after all.
Similarly:
$$\begin{align}
\mathsf E(Y\mid X=x)
& = \int_x^1 y\,f_{Y\mid X}(y\mid x)\operatorname d y 
\\
& = \int_x^1 \frac y{1-x}\operatorname d y 
\end{align}$$

 The expected value of a random variable uniformly distributed over $[x;1]$ is, of course, $(1+x)/2$ 

