A card is picked at random from N cards labeled 1,2,...,N and the number that appears is X. A second card is picked at random from cards numbered 1,2,..., X and its number is Y. Find the conditional distribution of X given Y = y.

From what I understand, there are two decks. The first deck has N cards, while the second deck has X cards, which depends on the value of the card chosen from the first deck, hence x and y are not independent.

$\displaystyle P(X = x | Y = y) = \frac{P(X = x , Y = y)}{P(Y = y)}$

$\displaystyle P(Y = y) = \frac{1}{x}$

I'm not sure how to find P(X = x , Y = y).

Any help would be greately appreciated. Thank you.