# Cracking a 5 digit password

A gang of thieves has discovered that the 5 digit combination to a safe is even and has exactly one odd digit and exactly two digits equal to each other. How many possible combinations are there for them to try?

• this is middle school probability question...
– Oray
Feb 28, 2016 at 18:18

$7200$
• There are four possible parity patterns for the combination (o=odd, e=even): $oeeee$, $eoeee$, $eeoee$, and $eeeoe$.
• Every parity pattern contains four even digits, of which two must be equal to each other. This gives ${4\choose2}=6$ possibilities for picking the two equal positions.
• Once we have fixed the parity pattern and the two positions with equal digits, there remain five possibilities for the odd digit ($1,3,5,7,9$) and $5\cdot4\cdot3=60$ possibilities for fixing the three distinct even digits ($5$ possibilities for the leftmost even digit, $4$ for the next, and $3$ for the last.)
Altogether, this yields $4\cdot 6\cdot 5\cdot 60=7200$ possible combinations (out of $100,000$ combinations overall with five digits).