1
$\begingroup$

I have that the number of 4 digit codes (each can be 0-9) is $10^4$.

I know that the number of 4 digit codes with no repeats is $P(10,4)$.

I figured that (the total number of 4 digit codes) - (4 digit codes with no repeats) should equal

(4 digit codes with 3 repeats) : 10

$+$

(4 digit codes with 2 repeats) : ${4\choose 3} \cdot 10 \cdot 9 = 360$

$+$

(4 digit codes with 1 repeats) : ${4\choose 2} \cdot 10 \cdot 9 \cdot 8= 4320$

but

$4690 \neq 4960$

My brain is going to explode. Please help!

$\endgroup$
2
$\begingroup$

You missed $\overline{AABB},\overline{ABAB}$, $\overline{ABBA}$ etc which contains $${4\choose 2} \cdot 10 \cdot 9 \cdot\frac{1}{2}=270$$ cases, and $4690 + 270 = 4960$.

$\endgroup$

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.