An urn contains $n$ cards marked from $1$ to $n$. Two cards are drawn at a time. Find the mathematical expectation of the product of the numbers on the cards.
I tried to answer this question and obtained the answer to be $\frac{(n+1)^2}{4}$ with replacement. Is it right?
How to approach it when it is without replacement?
Thank you :)
With replacement, assuming independence: $$E[N_1N_2]=E[N_1]E[N_2]=\frac{(n+1)^2}{4}$$ Without replacement, using the tower property of conditional expectation: $$\begin{aligned}E[N_1N_2]&=E[E[N_2|N_1]N_1]=\\ &=E\bigg[\frac{1}{n-1}\sum_{k\neq N_1}kN_1\bigg]=\\ &=\frac{1}{n(n-1)}\sum_{j=1}^n\sum_{k \neq j}kj=\\ &=\frac{1}{n(n-1)}\sum_{j=1}^nj\sum_{k \neq j}k=\\ &=\frac{1}{n(n-1)}\sum_{j=1}^nj\bigg(\frac{n(n+1)}{2}-j\bigg)=\\ &=\frac{1}{n(n-1)}\bigg(\frac{n^2(n+1)^2}{4}-\frac{n(n+1)(2n+1)}{6}\bigg)=\\ &\stackrel{\textrm{Thanks @Henry}}{=}\frac{(n+1)(3n+2)}{12}\end{aligned}$$