Artificial intelligent assistant

Probability of repeating at least 2 digits Pin codes consist of 4 digits between 0 and 9. If a pin-code were generated by a random number generator (e.g. by 4 ten-sided dice), what is the probability that it will have at least two digits that repeat?

It's easier to compute the probability of the opposite event, namely that you get four _different_ digits.

Imagine that you choose the digits one by one by rolling a singe ten-sided die. You win if some digit appears twice. What is the chance of _losing_? In order to lose, all of the following must be true:

* The first digit is some digit.
* The second digit is different from the first digit, which happens with probability 9/10.
* The third digit is different from the two first ones. They are already known to be different, so this happens with probability 8/10.
* The fourth digit is different from the tree first ones, which happens with probability 7/10.



So the probability of losing is $\frac{9}{10}\cdot\frac{8}{10}\cdot\frac{7}{10}=\frac{9\cdot 8\cdot 7}{1000} = 0.504$

The chance of winning is one minus this.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e8811c28ecc8fb7e70f5ccff9ffdacb4