Conditional probability in selection of natural numbers.

65 Views Asked by At

I need help with the following problem, please.

Given a set of $n\geq 3$ natural numbers (starting from 1), the following procedure is performed:

First, a random number is chosen from the set and recorded. Then another number is chosen at random from the same set and recorded again. The second number chosen is known to be at least as large as the first. What is the probability that the first number chosen is 2?

At first it seems to me that I should apply Bayes' theorem in the following way:

Let $X_i$ be the number recorded in the choice $i$, we look for $$P(X_1=2|X_2\geq X_1)=\frac{P(X_2\geq X_1|X_1=2)P(X_1=2)}{P(X_2\geq X_1)}$$

and calculating the probabilities is where I am having problems, I think that the probability $P(X_2\geq X_1|X_1=2)$ I can calculate as $1-P(X_2\leq X_1|X_1=2)=1-\frac{1}{n}$, while since there are $n$ numbers the probability $P(X_1=2)$ is $\frac{1}{n}$, however my difficulty is in calculating the probability $P(X_2\geq X_1)$.

I appreciate any help you can give me, thank you.

Sorry I forgot to mention that I need an answer using conditional probability, also every integer is equally likely from .

2

There are 2 best solutions below

0
On BEST ANSWER

As an alternative to Robert's answer of computing the probability by converting this into an equivalent problem, I will give a computation more aligned with what seemed to be your thought process.

You are correct in that you want to compute $$ P(X_1= 2 \;|\; X_2 \geq X_1)= \dfrac{P(X_2 \geq X_1 \;|\; X_1= 2)\, P(X_1= 2)}{P(X_2 \geq X_1)} $$ I assume that each of the integers $1, 2, \ldots, n$ are equally likely, i.e. $P(X= k)= \frac{1}{n}$.

The simplest probability to compute is $P(X_1= 2)$, which is of course $P(X_1= 2)= \frac{1}{n}$.

Now we compute $P(X_2 \geq X_1 \;|\; X_1= 2)$. You compute the complement, which is $P(X_2 < X_1 \;|\; X_1= 2)$ and because $X_1= 2$, this forces $X_2= 1$. But then this probability is $P(X_2 < X_1 \;|\; X_1= 2)= \frac{1}{n}$ so that $P(X_2 \geq X_1 \;|\; X_1= 2)= 1 - \frac{1}{n}$. There is an alternative thought process: because $X_1= 2$ and we want $X_2 \geq X_1$, the options are $X_2= 2, 3, \ldots, n$. This is a total of $n - 1$ options (all but the option $X_2= 1$) so that the probability of selecting one of these is $\frac{n - 1}{n}$, i.e. $P(X_2 \geq X_1 \;|\; X_1= 2)= \frac{n - 1}{n}$. One immediately sees the equivalence from $1 - \frac{1}{n}= \frac{n}{n} - \frac{1}{n}= \frac{n - 1}{n}$.

It only remains to compute $P(X_2 \geq X_1)$. You can start to think of the possibilities. For instance, if $X_= 1$, the possibilities for $X_2$ are $1, 2, \ldots, n$. If $X_1= 2$, the possibilities for $X_2$ are $2, 3, 4, \ldots, n$. If $X_1= 3$, the possibilities for $X_2$ are $3, 4, 5, \ldots, n$. Continue this until you have $X_1= n$, which forces $X_2= n$. But then we know that $$ \begin{split} P(X_2 \geq X_1)&= P(X_2 \geq X_1 \;|\; X_1= 1) + P(X_2 \geq X_1 \;|\; X_1= 2) + \cdots + P(X_2 \geq X_1 \;|\; X_1= n) \\ &= \sum_{k=1}^n P(X_2 \geq X_1 \;|\; X_1= k) \end{split} $$ We know also from the logic above and the fact that the integers $X_1, X_2$ are chosen independently that $$ \begin{split} P(X_2 \geq X_1 \;|\; X_1= k)&= P(X_2= k)P(X_1= k) + P(X_2= k+1) P(X_1= k) + \cdots + P(X_2= n) P(X_1= k) \\ &= \sum_{j=k}^n P(X_2= j) P(X_1= k) \end{split} $$ It is clear that $P(X_2= j)= \frac{1}{n}= P(X_1= k)$ (every integer has the same probability of occurring). So this is $$ \sum_{j=k}^n P(X_2= j) P(X_1= k)= \sum_{j=k}^n \frac{1}{n^2}= \frac{1}{n^2} \sum_{j=k}^n 1 = \frac{1}{n^2} \cdot (n-k+1)= \dfrac{n - k + 1}{n^2} $$ We can then finally compute $P(X_2 \geq X_1)$: $$ \begin{split} P(X_2 \geq X_1)&= \sum_{k=1}^n P(X_2 \geq X_1 \;|\; X_1= k) \\ &= \sum_{k=1}^n \dfrac{n - k + 1}{n^2} \\ &= \sum_{k=1}^n \left( \dfrac{1}{n} - \frac{k}{n^2} + \frac{1}{n^2} \right) \\ &= \frac{1}{n} \sum_{k=1}^n 1 - \frac{1}{n^2} \sum_{k=1}^n k + \frac{1}{n^2} \sum_{k=1}^n 1 \\ &= \frac{1}{n} \cdot n - \frac{1}{n^2} \cdot \dfrac{n(n+1)}{2}+ \frac{1}{n^2} \cdot n \\ &= 1 - \dfrac{n + 1}{2n} + \dfrac{1}{n} \\ &= \dfrac{2n - (n + 1) + 2}{2n} \\ &= \dfrac{n + 1}{2n} \end{split} $$ Putting this all together, you have... $$ \begin{split} P(X_1= 2 \;|\; X_2 \geq X_1)&= \dfrac{P(X_2 \geq X_1 \;|\; X_1= 2)\, P(X_1= 2)}{P(X_2 \geq X_1)} \\ &= \dfrac{\frac{n-1}{n} \cdot \frac{1}{n}}{\frac{n + 1}{2n}} \\ &= \dfrac{n-1}{n} \cdot \dfrac{1}{n} \cdot \dfrac{2n}{n + 1} \\ &= \frac{2(n - 1)}{n (n + 1)} \end{split} $$

We should at least do one sanity check: if $n$ is "small", the probability should be "larger". For instance, if $n= 5$, if we know that $X_2 \geq X_1$, the chances of $X_1= 2$ are "decent" because there would be "little" chance for $X_2 \geq X_1$ if $X_1$ were something like $X_1= 4$ or $5$. However, when $n$ is "large", the fact that $X_2 \geq X_1$ does not give a "great chance" that $X_1= 2$. Think if $n= 1,000,000$, if we knew $X_2 \geq X_1$ and checked $X_2= 600,000$, $X_1$ could have been any of $1, 2, \ldots, 600,000$. So as $n \to \infty$, the probability we seek should go to $0$. Notice that we have $$ \lim_{n \to \infty} P(X_1= 2 \;|\; X_2 \geq X_1)= \lim_{n \to \infty} \frac{2(n - 1)}{n (n + 1)}= 0, $$ which conforms with our very rough intuition above. Moreover, $P(X_1= 2 \;|\; X_2 \geq X_1)= \frac{2(n - 1)}{n (n + 1)}$ does decrease as $n$ increases, which again conforms with our intuition.

Notice that Robert's answer and the answer above match. Both answers demonstrate something. Robert's answer demonstrates the power of viewing probability/counting problems from the "simplest perspective." What that means is very dependent but seeing lots of problems and tricks, when you see a new problem, think can you transform the given problem into an (easier/familiar) equivalent problem.

I, however, am not particularly clever when it comes to combinatorial arguments - they have always been a weakness of mine. While I appreciate the cleverness and the beauty of them, any skills I have in them come from years of seeing/teaching them. As I tell my students, if in a moment you cannot be clever, you can at least be slow, methodical, and perseverant. The solution above is longer (especially as I wanted to be more - perhaps overly - detailed) than Robert's but is a bit more from "direct thinking." These types of solutions are nearly always longer and more tedious. However, being careful, patient, and perseverant will get you there all the same! Both types of solutions build skills and are worthy of attention, so practice both, i.e. always try both approaches until you are "satisfied" with your abilities in the area. But always be on the lookout for a "Robert" solution compared to a "direct" solution - it will save a lot of time/effort!

0
On

You don't say so explicitly, but I'm assuming each integer among the $n$ is equally likely to be drawn at either turn.

I'd just count ordered pairs. Each ordered pair, a priori, is equally likely. The number of ways to choose an ordered pair from $n$ integers such that the second coordinate is at least as large as the first is $$\sum_{k=1}^n k=\binom {n+1}{2}= \dfrac{n(n+1)}{2}.$$ There are $n-1$ ways to choose such an ordered pair with first coordinate $2$ -- the second coordinate can be anything in your range other than $1$. Therefore, the probability you want is $$\dfrac{2(n-1)}{n(n+1)}=\dfrac{4}{n+1}-\dfrac 2n.$$