A computer first selects a natural number n in a uniform manner from the set $\{1, 2, 3, 4, 5\}$ (This means that each of these numbers has an equal chance of becoming chosen). Then our computer uniformly selects a natural number m from the set $\{1,\ldots,n\}$. Given that $m = 3$, what is the probability that $n = 5$?
I know the basic rule that $$\mathbb{P}[A|B] = \frac{\mathbb{P}[A\cap B]}{\mathbb{P}[B]},$$ but I have trouble with applying this formula.
I need to know two things: The intersection of A and B, and the probability of B.
But it seems that B doesn't have a fixed probability, since it depends on A. So the probability of B is. 1/n.
How do I take the intersection of A and B?
The answer is 12/47. But I don't know how to get there.
Can I get feedback on this problem?
Ter
HINT
Think of Bayes Theorem. Intuitively, you know that $m=3$. What is the probability $p_1$ to pick $m=3$ if $n = 1$? What about $p_2$ (if $n=2$)? Find $p_3,p_4,p_5$ and then you need the chance it was actually $5$ only, which would be $$ \frac{p_5}{p_1 + p_2 + p_3 + p_4 + p_5} $$