Selecting a PIN with at least one repeat I would like to select a PIN with at least one repeat. I am not sure how to go about finding the number of ways to do this.
I know if you normally want both repeats and non-repeats it would be like this:
$$10×10×10×10$$
And without repeats:
$$10×9×8×7$$
What about at least one repeat?
 A: For at least $1$ digit being repeated, consider all possible combinations subtract away those combination with no repetition.
$$10^4-10 \times 9 \times 8 \times 7$$
A: A PIN has either no repeats, or at least one repeat. Just subtract the number of PINs with no repeats from the total number of PINs in existence:
$$10^4-10×9×8×7=4960$$
A: A $4$-digit pin with at least one repetition has four cases:
Two of the digits are repetitions and the others aren't. Out of four digits, choose two of them to be the same and the others different $\binom 4 2 = 6$
$$
RRAB \\
RARB \\
RABR \\
ARRB \\
ARBR \\
ABRR 
$$
Two pairs of repetitions, out of four digits, choose two pairs $\frac{\binom 4 2}{2} = 3$ (almost the same count as above, except for one small difference; we're selecting which two from the first pair, the remaining two become the second pair)
$$
RRAA \\
RARA \\
RAAR \\
\color{red}{ARRA} \\
\color{red}{\text{already covered by $RAAR$}} \\
\color{red}{ARAR} \\
\color{red}{\text{already covered by $RARA$}} \\
\color{red}{AARR} \\
\color{red}{\text{already covered by $RRAA$}}
$$
Three of the digits are repetitions. Out of four digits, choose three of them to be the same, $\binom 4 3 = 4$
$$
RRRA \\
RRAR \\
RARR \\
ARRR
$$
Four of the digits are repetitions. Out of four digits, all of them are the same, $\binom 4 4 = 1$
$$
RRRR
$$
For the two digit repetition case, we can make 3 choices of digits: $R$ can be chosen freely from $10$ values, the $A$ can be chosen from the remaining $9$ and the $B$ can be chosen from the remaining $8$. There are $6$ ways to order these, so the number of pins contributed by this case is $(6 \text{ orderings}) \times (10 \text{ choices for $R$}) \times (9 \text{ choices for $A$}) \times (8 \text{ choices for $B$} )$.
For the pair of repetitions case, we can make 2 choices of digits: $R$ can be chosen freely from $10$ values, the $A$ can be chosen from the remaining $9$. There are $3$ ways to order these, so the number of pins contributed by this case is $(3 \text{ orderings}) \times (10 \text{ choices for $R$}) \times (9 \text{ choices for $A$}) $.
For the three digit repetition case, we can make 2 choices of digits: $R$ can be chosen freely from $10$ values, the only $A$ can be chosen from the remaining $9$. There are $4$ ways to order these, so the number of pins contributed by this case is $(4 \text{ orderings}) \times (10 \text{ choices for $R$}) \times (9 \text{ choices for $A$} )$.
For the four digit repetition case, we can see that there are only $10$ subcases. There are no choice of orderings and only a choice of which value will dominate all digits. $(1 \text{ orderings}) \times (10 \text{ choices for R})$
Adding it all up together, you get $6(10 \times 9 \times 8) + 3(10 \times 9) + 4(10 \times 9) + 1(10) = 4960$
Some thinking needs to be done about why those orderings in red don't need to be counted. Think about when $R = 1$ and $A = 2$ and when $A = 1$ and $R = 2$. What do you get for those pairs of pairs?
