In: Statistics and Probability
You just purchased the lockbox below to store a spare set of keys for your house. It allows you to set a passcode using digits from 0 to 9:
How it works:
-Each digit is either ON or OFF, so pushing the same button twice removes it from the combination (as opposed to adding it a second time to the code). E.g. pressing 2, 7, 4 or pressing 2, 7, 3, 4, 3 would produce the same code: 274
-It is a mechanical lock box (not digital) so it does not recognize the order of the buttons pushed. E.g. pressing 4, 5, 8, 1 is the same as pressing 8, 1, 4, 5: both represent the same code (4581 = 8145)
-Pressing the CLEAR button clears the last code attempted (sets all digits to OFF)
a) Explain why the correct code cannot exceed 10 digits.
b) There is no manual that comes with the lockbox. Your friend thinks the code needs to be exactly 10-digits long. If this were true, explain why this would not be a good lock box.
c) What is the probability of randomly guessing the correct code on your first attempt? Explain how you arrived at your formula.
d) Another friend suggests using 9-digit codes over 2- or 3-digit codes as they are longer and better for security. Do you agree or disagree? Explain.
a) Suppose that the number of digits in the code exceeds 10. Then there would be atleast one digit occuring twice. Suppose that digit is a. Then a is pressed more than once. If it is pressed twice, then according to the lock rule there is no a in the code. If it is pressed thrice then it means it is once in the code and so on. So there can't be no digit multiple times in the code. So maximum digits = 1+1+1+...(10 times) = 10.
b) Since the order of the code does not matter as long as the digits are same, if someone presses 0123456789 he has unlocked that lockbox. So for security reasons it is not a good lock.
c) Total number of codes possible = 210 – 1 = 1023(each digit from 0 to 9 has two possibilities – that it is in the code or it is not in the code. Also the possibility that no code is there is subtracted.) So Probability that the code is guessed ont the first time = 1/1023 ~ 0.00098
d) Number of 9 digit codes = 10C9 = 10 Number of 2 digit codes and 3 digit codes are 10C2 = 45 and 10C3 = 120 respectively , so it is safer to apply a 2 digit or 3 digit lock. So I disagree.