Two numbers are randomly selected from the set

conditional probabilityprobability

Number $\xi$ is randomly selected from the set $\{1, 2, 3,…, n\}$. Then number $\eta$ is selected from the same set so that $\eta \leq \xi$.

How can I find covariance $\mathrm{cov}(\xi, \eta)$ and variance $\mathrm{Var}(\eta)$?

I know that covariance can be found as $\mathbb{cov}(\xi, \eta) = E[\xi \eta] – E[\xi]E[\eta]$, where $E$ denotes expected value. But I don't know how to find $E[\xi \eta]$ and $E[\eta]$.

Best Answer

I will use $y,x$ instead of symbols used in the question So $y \in \{1,2, \cdots , n\}$, I am assuming each value occurs with equal probability, $P(y=i)=1/n$ for $i \in {1,2, \cdots , n}$. Similarly I assume $P(x=j)=1/y$ for $j \in \{1,2, \cdots , y\}$ for a given $y$.

Calculating $E[xy]=\Sigma_{1 \le y \le n} \Sigma_{1\le x\le y}xyP(x|y)P(y)$

$=\Sigma_{1 \le y \le n} \Sigma_{1\le x\le y}xy(1/y)(1/n)$

$=\Sigma_{1 \le y \le n} \Sigma_{1\le x\le y}x/n$

$=\Sigma_{1 \le y \le n} y(y+1)/(2n)$

$=(n+2)(n+1)/6$

Expression above uses $\Sigma_{1 \le i \le n}i^2=n(n+1)(2n+1)/6$ and $\Sigma_{1 \le i \le n}i=n(n+1)/2$

Similarly

Calculating $E[x]=\Sigma_{1 \le y \le n} \Sigma_{1\le x\le y}xP(x|y)P(y)$

$=\Sigma_{1 \le y \le n} \Sigma_{1\le x\le y}x/(yn)$

$=\Sigma_{1 \le y \le n} (y+1)/(2n)= (n+3)/4$

The expectation of y is simple $E[y]=\Sigma_{1 \le y \le n}y/n=(n+1)/2$

So $Cov[xy]=(n+2)(n+1)/6-(n+3)(n+1)/8=(n+1)(n-1)/24$

Related Question