Probability that $m$ of $n$ elements is in set of $p$ elements

55 Views Asked by At

Let say I have $n$ elements $X = \{x_1, ..., x_n\}$ and that I have 2 random subsets $X_1 = \{x_1', ..., x_m'\} \subset \{x_1, ..., x_n\}$ and $X_2 = \{x_1', ..., x_p'\} \subset \{x_1, ..., x_n\}$ with $m < p$.

My question is: 'What is the probability that 2 elemnts of $X_1$ are also present in $X_2$.

It is a long time ago that I did such things. I know that I certainly need combinations (https://en.wikipedia.org/wiki/Combination) but I can get to the solution. Can anyone help me?

1

There are 1 best solutions below

5
On

If it is exactly 2 elements, the probability is : $$\frac{\binom{n}{2}\binom{n-2}{m-2}\binom{n-m}{p-2}}{\binom{n}{p}\binom{n}{m}} $$

Since $\binom{n}{p}\binom{n}{m}$ is the number possibilities to make two sets of $p$ and $m$ elements out of a set of $n$ elements (since $\binom{n}{p}$ is the number of ways to get a set of $p$ elements out of a set of $n$ elements, and $\binom{n}{m}$ is the number of ways to get a set of $m$ elements out of a set of $n$ elements).

Then, I peak two elements that will be in both sets : $\binom{n}{2}$ possibilities ; for choosing the rest of the elements of the set of cardinal $m$ : $\binom{n-2}{m-2}$ possibilities and for choosing the rest of the elements of the set of cardinal $p$ (two are already chosen and I can't peak in the $m$ elements already chosen since I want EXACTLY 2 elements in common) : $\binom{n-m}{p-2}$ possibilities.

Now if I want to know the probabilities of at least to elements in common, it is equal to : 1- probability of 0 element in common - probability of exactly one element in common. So, with the same method, this probability is : $$ 1- \frac{\binom{n}{m}\binom{n-m}{p}}{\binom{n}{p}\binom{n}{m}}-\frac{\binom{n}{1}\binom{n-1}{m-1}\binom{n-m}{p-1}}{\binom{n}{p}\binom{n}{m}}= 1- \frac{ \binom{n-m}{p}}{\binom{n}{p}}-n\frac{\binom{n-1}{m-1}\binom{n-m}{p-1}}{\binom{n}{p}\binom{n}{m}}$$