I just wanted to check if my thinking is correct regarding a probability problem. The problem is as follows:

You are randomly selecting a 4-digit PIN code. What is the probability that at least 2 of the digits are the same?

My approach was to use the complement event, which means finding the probability that all 4 digits are unique. The number of possible combinations where all 4 digits are unique is:

10 * 9 * 8 * 7 = 5040

And since there are 10,000 possible combinations in total (10 options for each digit), the probability of getting a PIN code with all unique digits is:

5040/10000 = 0.504

Therefore, the probability of getting a PIN code with at least 2 of the digits being the same is:

1 - 0.504 = 0.496 or approximately 49.6%

Could someone please confirm if my thinking and calculation are correct? Thank you in advance!

  • 8
    $\begingroup$ You are correct. And seems like best way, using the "one minus" trick. $\endgroup$
    – coffeemath
    Commented Mar 6, 2023 at 1:27
  • $\begingroup$ @ronno I'd think because the author, "cricket900", answered the question correctly in the question, that the credit should go to them. Maybe they don't know it is encouraged here to post answers to your own questions? $\endgroup$
    – coffeemath
    Commented Mar 14, 2023 at 18:22
  • $\begingroup$ @coffeemath I think this counts as a proof-verification question even if not tagged as such. Relevant meta post. $\endgroup$
    – ronno
    Commented Mar 15, 2023 at 6:58

1 Answer 1


Your proof is correct, and in my opinion your decision to compute the probability that there are not two or more digits the same, and subtract that from $1,$ is the simplest way to proceed.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .