Pick $2$ number randomly from $1$ to $n$ what is the probability of one number being smaller than $k$ and other one is greater than $k$?

722 Views Asked by At

We need to pick $2$ number randomly from $1$ to $n$. what is the probability of one number being smaller than $k$ $(1<K<n)$ and the other one is greater than $k$?

My attempt

Here I assumed whatever $k$ is gonna be, it doesn't matter as one number will be always greater than the other number.

Given a set of numbers: $1 - n$.

Number of ways the first number can be picked is : $n$ (any number between $1 - n$)

Number of ways the second. number can be picked is : $n$ (any number between $1 - n$)

Total Combination is $n \times n = n^{2}$.

Now to pick the numbers in such a way that one is greater than the other,

Number of ways the first number can be picked is : $n$ (any number between $1 -n$)

Number of ways the second. number can be picked is : $n-1$ (any number other than the first number)

favorable combinations we get is $n(n-1)$

The probability that the two numbers picked between 1 to n, where one number is greater than the other, is : $\dfrac{n(n-1)}{n^{2}} = \dfrac{n-1}{n}$.

I am not sure whether am I right or wrong?

3

There are 3 best solutions below

5
On BEST ANSWER

There are $n-k$ numbers greater than $k$ and $k-1$ numbers smaller. Thus Your probability should be $2\times\frac{(n-k)\times(k-1)}{n^{2}}$

1
On

The number of ways to arrange $3$ numbers is $3!=6$. In two of these arrangements, $k$ is in the middle. So the probability is $1/3.$

8
On

The numbers are:

$$1,2,3,\dots,n$$

So we have a total of $n$ numbers.

Probability of selecting a number between $1$ and $k$, including $1$ and excluding $k$, is $\frac{k-1}{n}$

Probability of selecting a number between $k$ and $n$, excluding $k$ and including $n$, is $\frac{n-1}{n}$

Also, since we have two numbers, the can be permuted in $2!=2$ ways

Therefore, the probability of selecting two numbers, exactly on of them less than $k$ is given by:

$$P=\frac{2(k-1)(n-1)}{n^2}$$