Let G be a undirected graph with vertices $V = \lbrace1,..., n\rbrace$ and edges $E \subseteq {V \choose 2}$ and $|E| = m$. If we choose a set $R$ of $r$ vertices at random (every set in ${V \choose r}$ with same probability) , then the probability for an edge $\lbrace i, j \rbrace$ to have both endpoints in $R$ is:
$$\frac{n-2 \choose r-2}{n \choose r} = \frac{r (r -1)}{n(n-1)}$$
Let $X$ be a random variable such that X = #$(\frac{R}{2} \cap E)$. We compute: $$E(X) = m. \frac{r (r -1)}{n(n-1)}$$.
I understand how to calculate $E(X)$. So, it should be for every value of $X$ being $x$, probability $Pr[X=x]$ should get multiplied with $X$ and all such values should get summed up. In this case, it should be $$E(X) = \sum i * Pr[X = i]$$
But, I am not being able to figure out how the $E(X) = m. \frac{r (r -1)}{n(n-1)}$ is being calculated here. Any clue on this is welcome.