If $X\sim U\{1,2,3,\cdots n\}$, $Y|X=x\sim U\{1,2,3,\cdots,x\}$ find $P(Y=j)$

43 Views Asked by At

I think that

\begin{eqnarray} P(Y=j)&=& \sum_{x=1}^nP(Y=j|X=x)P(X=x)\\ &=& \sum_{x=1}^n(\frac{1}{x})(\frac{1}{n})\\ &=& \frac{1}{n}\sum_{x=1}^n\frac{1}{x} \end{eqnarray}

This is correct?

1

There are 1 best solutions below

5
On

The answer below was written before the OP specified that $X$ and $Y$ were dependent. In light of that information, it's obviously incorrect so please disregard!

Is $j$ related to $X$ in any way? Otherwise, the answer is just $P(Y=j) = \frac{1}{n}$ since $Y$ is uniform over $\{1,...,n\}$: $$ \begin{align} P(Y=j) &= \sum_{x=1}^n P(Y=j, X=x) \\ &= \sum_{x=1}^n P(Y=j | X=x) P(X=x) \\ &= \frac{1}{n} \sum_{x=1}^n P(Y=j | X=x) \\ &= \frac{1}{n} \sum_{x=1}^n P(Y=j) ~~~~\text{ since $Y$ doesn't depend on $X$}\\ &= \frac{1}{n} \, \left( n \cdot P(Y=j) \right) ~\text{ again because $Y$ doesn't depend on $X$}\\ &= P(Y=j) \\ &= 1/n ~~~~~~~~~~~~~~~~~~~~~~~~\text{ since $Y$ is uniform on $1 \ldots n$} \end{align} $$