# Conditional Distribution

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• Jan 22nd 2011, 12:42 PM
statmajor
Conditional Distribution
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.
• Jan 23rd 2011, 01:58 PM
tom@ballooncalculus
P(X = x | Y = y) = 0 for x < y.

Otherwise, though...

http://www.ballooncalculus.org/draw/prob/cond.png

... this example is for N = 3, using the same approach as here, http://www.mathhelpforum.com/math-he...on-169035.html.

The first stage gives the branches a weighting of 6, i.e. 3!, a common multiple of all the possible x's.

The second stage shares that weight between x possible y's.

So for example, P(X = 2 | Y = 2) = 3/5, while P(X = 3 | Y = 2) = 2/5. (Try to use the tree to see why that is.)

For P(X = x | Y = y) I guess you can then make a general numerator of $\displaystyle \displaystyle{\frac{N!}{x}}$

... and a denominator of $\displaystyle \displaystyle{\sum_{i=y}^N\frac{N!}{i}}$

Hope this isn't too far off...

__________________________________________________ ____________

Don't integrate - balloontegrate!

Balloon Calculus; standard integrals, derivatives and methods

Balloon Calculus Drawing with LaTeX and Asymptote!
• Jan 23rd 2011, 04:01 PM
statmajor

I'm just confused as to why it is N! since there are only N cards in the deck.
• Jan 24th 2011, 06:40 AM
tom@ballooncalculus
It could be N or N! or 1 or 1/N or whatever we like. The N's are going to cancel anyway. I think I was just hoping the whole numbers would help you to get a venn-diagram-like grasp of the conditional reasoning. E.g., the (y=2) branches sum to form a region populated with 5 elements, 3 of them contained in its (x=2) sub-region and the other 2 contained in the remaining (x=3) sub-region.
• Jan 24th 2011, 01:06 PM
statmajor
I'm trying to do this piece by piece, and right now I'm trying to figure out P(Y=y).

In the case of when X = N, there would be N X branches, and $\displaystyle T = \displaystyle{\sum_{i=y}^N i}$ (Y = y) branches.

So if I wanted to find P(Y = 1), there are N y =1 (in the case of when X = N), so P(Y = 1) = $\displaystyle \frac{N}{T}$.

For P(Y = 2), there are N - 1 second branches that contain y = 2 branches. so $\displaystyle P(Y = 2) = \frac{N - 1}{T}$.

to generlize it, $\displaystyle P(Y = y) = \frac{N - (y-1)}{T}$.

Does this make sense, or am I just way off base here?
• Jan 24th 2011, 01:39 PM
tom@ballooncalculus
Are you assuming all the second branches are equally likely? How about this (possibly more conventional) probability tree (for N = 3 as before) ...

http://www.ballooncalculus.org/draw/prob/conda.png

... then I get P( X=x | Y=y ) ...

$\displaystyle \displaystyle{= \frac{\displaystyle{\frac{1}{Nx}}}{\displaystyle{\ sum_{i=y}^N\frac{1}{iN}}}$

$\displaystyle \displaystyle= \frac{\frac{1}{x}}{\displaystyle \sum_{i=y}^N \frac{1}{i}}$
• Jan 24th 2011, 01:50 PM
statmajor
Can't I assume that the second branches are equally likely when I'm calculating P(Y = y)?
• Jan 24th 2011, 02:12 PM
tom@ballooncalculus
No, you want to add all the probabilities that Y = y that are conditional on the various X = x. As per usual with a tree.
• Jan 24th 2011, 02:40 PM
statmajor
So what you're saying is that I also have to account for probability of the first branch X = x being chosen.

So for example:

$\displaystyle P(X = N | Y = 1 ) = \frac{1}{N} + \frac{1}{2N} + ... +\frac{1}{N(N-1)} + \frac{1}{N^2}$

$\displaystyle P(X = N | Y = 2 ) =\frac{1}{2N} + ... +\frac{1}{N(N-1)} + \frac{1}{N^2}$
• Jan 24th 2011, 02:46 PM
tom@ballooncalculus
No, that's P(Y = 1).
• Jan 24th 2011, 02:54 PM
statmajor
Is the P(Y = 2) correct though?
• Jan 24th 2011, 03:03 PM
tom@ballooncalculus
Provided that's what you call it (so far, it isn't), then yes. To get P( X=N | Y=2 ), use the Bayes formula you quoted (although I'd be even more pleased if you used the tree, since it was meant to make things clearer!) to figure that you need to divide P( X=N & Y=2 ) by P( Y=2 ).
• Jan 24th 2011, 03:46 PM
statmajor
To get P(X = 3 | Y = 2) using the tree you provided, there are 2 secondary branches that have y = 2, and there are a total of 5 branches that can be chosen (3 of them when X = 3, and 2 of them when X = 2):

$\displaystyle P(X = 3 | Y = 2) = \frac{2}{5}$

EDIT: Something tells me I'm still not getting it as I dont get how you got P(X = 2 | Y = 2) = 3/5.

Would I able to generalize P(Y = y) as $\displaystyle \displaystyle{\sum_{i=y}^N \frac{1}{iN}}$
• Jan 24th 2011, 10:59 PM
tom@ballooncalculus
Quote:

Originally Posted by statmajor
Would I able to generalize P(Y = y) as $\displaystyle \displaystyle{\sum_{i=y}^N \frac{1}{iN}}$

Yes! ... but not from below:

Quote:

To get P(X = 3 | Y = 2) using the tree you provided, there are 2 secondary branches that have y = 2, and there are a total of 5 branches that can be chosen (3 of them when X = 3, and 2 of them when X = 2):
Now you ARE treating all secondary branches as equally probable.

Quote:

$\displaystyle P(X = 3 | Y = 2) = \frac{2}{5}$
Yes, but...
Quote:

EDIT: Something tells me I'm still not getting it as I dont get how you got P(X = 2 | Y = 2) = 3/5.
... as you suspect, that was a fluke. Maybe you can get the both of the fractions correctly from the first tree by converting it into the right kind of venn diagram. The trouble is, the tree favours this venn diagram, with Y regions spilt and distributed among and enclosed within X regions...

http://www.ballooncalculus.org/draw/prob/condb.png

To get X conditional on Y you want it the other way round, which can just about be depicted as follows... (have to dash, so it won't be till later on today, now, but try to anticipate... meantime, someone else might well offer a different perspective - good luck, you're nearly there)

http://www.ballooncalculus.org/draw/prob/condc.png
• Jan 25th 2011, 05:34 PM
statmajor