Let $(X,Y)$ be a bivariate discrete R.V. with joint pmf $$p(x,y)=\begin{cases} \frac{1}{{m+1 \choose 2}} \text{if $y=1,2 \ldots,x$ & $x=1,2,\ldots,m$} \\ 0 \ \text{otherwise} \end{cases}$$ for a given positive integer $(m>1)$.Find $E(X)$ from the marginal distribution of $X$ and also from $E(X|Y)$.
I got the first part .Let the marginal pmf of $X$ be $p_X(x)$. Thus, $p_X(x)=\sum_{y} \frac{1}{{m+1 \choose 2}}=\frac{x}{{m+1 \choose 2}}$ Thus $E(X)=\sum_{x=1}^{m} \frac{x^2}{{m+1 \choose 2}} = \frac{2m+1}{3}$
But how to get $E(X)$ from $E(X|Y)$?