So, the problem I found goes like this:

You have $n$ different numbers, numbered from $ 1 $ to $n$. You can randomly choose $m$ (different) of them. The computer also randomly selects $m$ (different) of them. If you and the computer have exactly $k$ common numbers, then you win a certain amount of money.

The problem asks us to find the probability of winning.

I have solved some easier problems involving probabilities. But here, the only thing I could think of was that the probability for a certain sequence of $m$ numbers to emerge is:

$$ \frac{1}{\dbinom{n}{m}} $$

How do you solve it? I'm on my way of getting used to this type of problems and I could really use some help.


2 Answers 2


Good divided by total; or multiply your result with the number of matching sequences. There are $m\choose k$ ways to pick $k$ of the $m$ winning numbers and $n-m\choose m-k$ ways to pick the remaining numbers as non-winners. Divided by the total ways to pick $m$ numbres, we find $$ \frac{{m\choose k}{n-m\choose m-k}}{n\choose m}$$


Let us assume you have picked your $m$ numbers. Now it's the computer's turn. It has to match $k$ of your numbers. Which $k$? These can be chosen in $\binom{m}{k}$ ways. Then it has to produce $m-k$ numbers which do not match any of yours. This can be done in $\binom{n-m}{m-k}$ ways.

So the number of ways the computer can match $k$ of your numbers is $\binom{m}{k}\binom{n-m}{m-k}$.

For the probability, divide $\binom{m}{k}\binom{n-m}{m-k}$ (the number of "favourables,") by the number of (equally likely) choices the computer can make. This is $\binom{n}{m}$.

  • $\begingroup$ Thank you for your answer! I've designated Hagen's answer as the winner since it appeared on top of the list. But thank you too!! $\endgroup$
    – Bardo
    Aug 26, 2014 at 7:23
  • $\begingroup$ You are welcome. $\endgroup$ Aug 26, 2014 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.