Probability of an integer $a$ being larger than the greatest element in an random integer array $\left\langle a_{1},a_{2},a_{3}...a_{n}\right\rangle$

60 Views Asked by At

Say we have two integers $a_{1},a_{2}$ randomly chosen from the set of all integers . We can say that the probability of $P\left\{ a_{1}\geq a_{2}\right\} =\frac {1} {2}$ .

Similarly say we have an array of $n$ randomly chosen integers $\left\langle a_{1},a_{2},a_{3}...a_{n}\right\rangle$ . Then we have another randomly chosen integer $a$ which is a key for comparison .

Then $P\left( a\geq a_{i}\right) =\frac {1} {2}\forall i\leq n$ then comparing our key element $a$ with all other elements in the array we can write $P\left( \left( a\geq a_{1}\right) \cap \left( a\geq a_{2}\right) \ldots \cap \left( a\geq a_{n}\right) \right) =\frac {1} {2^{n}} $

Then my question is that following similar logic , say we have sorted our array in non increasing order then can we write for some randomly chosen integer $a$ that $P\left( a\geq a_{1}\right) =\frac {1} {2^{n}}$ ? Where $a_{1}$ is the greatest element of the randomly selected array $\left\langle a_{1},a_{2},a_{3}...a_{n}\right\rangle$ .

1

There are 1 best solutions below

1
On BEST ANSWER

You have $n+1$ integers ($a$ and the various $a_i$), so the probability that $a$ is the greatest is simply $\frac{1}{n+1}$.