Your company has patened an electronic digital padlock that
Your company has patened an electronic digital padlock that a user can program with his or her own five-digit code. (Each digit can be 0 thru 9) The padlock is designed to open if either the correct code is keyed in or if exactly one of the digit is incorrect. How many codes will open a programed padlock?
Please show all work and explain your methods.
Solution
the correct code = 1 way
For incorrect code, exactly one digit can be incorrect.
total digits = 10
number of ways in which only one digit is incorrect:
1x1x1x1x9 + 1x1x1x9x1+ 1x1x9x1x1+ 1x9x1x1x1+ 9x1x1x1x1 = 45
So, total codes by which it will open = 45+1=46
1x1x1x1x9 represents that out of 10 number only the correct digit is to be used. So, 1 is used and 9 is used because leaving the correct digit 9 digits are left which would be incorrect.

