You are a given a standard 4 digit padlock, where each digit can be {0, 1, ..., 9}.
You are told that you have 3 attempts to unlock the padlock. You only need to be correct in 1 of these 3 attempts to be successful.
What you are not told, however, is that any digit in the correct combination is at most 1 unit difference from all the other 3 digits.
What is the probability that you will succeed (to 3 significant figures)?
Note that you are not stupid. You will remember the unsuccessful attempts, and avoid them in future attempts.
Note that 0 and 9 can be considered to be a unit difference
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
A great way (I think better than mine) of counting the complete number of combinations which satisfy the conditions. Thanks for sharing your solution.
Firstly, let's consider how many possibilities there are:
Let the first digit be 0. Then there are 2 cases:
The remaining three digits are either 1 or 0. In which case, we have 2 3 = 8 possibilities.
The remaining digits are either 9 or 0. In which case we also have 2 3 = 8 possibilities.
But here, we counted 0000 twice. So when the first digit is 0, we have 2 × 8 − 1 = 1 5 possibilities.
Now, we get identical cases for when the first digit varies. There are 10 possibilities for the first digit, hence, in total, we have 1 0 × 1 5 = 1 5 0 possible padlock configurations which satisfy the above conditions.
Now there are 1 0 4 = 1 0 0 0 0 different combinations in total. Here it is easier calculating the probability that all 3 attempts fail:
1st attempt: we have P 1 (fail) = 1 0 0 0 0 1 0 0 0 0 − 1 5 0 = 1 0 0 0 0 9 8 5 0
2nd attempt: Since the first attempt failed, we have 1 less possibility. Then P 2 (fail) = 1 0 0 0 0 − 1 9 8 5 0 − 1 = 9 9 9 9 9 8 4 9
3rd attempt: Since the first and second attempt failed, we have 2 less possibilities. Then P 3 (fail) = 1 0 0 0 0 − 2 9 8 5 0 − 2 = 9 9 9 8 9 8 4 8
So the probability of failing all is
1 0 0 0 0 9 8 5 0 × 9 9 9 9 9 8 4 9 × 9 9 9 8 9 8 4 8 = 0 . 9 5 5 6 6 7 2 . . .
So the probability of succeeding is 1 − 0 . 9 5 5 6 6 7 2 . . . = 0 . 0 4 4 3 3 2 7 4 1 . . . = 0 . 0 4 4 3 ( 3 s f )
Problem Loading...
Note Loading...
Set Loading...
1 thing I would suggest to mention that a unit can mean that 0 & 9 could be together..I didnt take that combination in first attempt....
Now, digits that can be together are 0 & 1, 1 & 2, 2 & 3,......8 & 9, 9 & 0
Say we can have 0s & 1s, we can have 2^4 =16 combinations.
For 1s & 2s we can have 16-1=15 combinations (as 1111 is already counted above).
Similarly till 0s & 9s where we will count 14 cases only(as both 0000 & 9999 have been already counted in above cases).
So total 150 cases possible.
P(1st attempt)=150/10000
P(2nd attempt) =9850/10000 x 150/9999
P(3rd attempt) =9850/10000 x 9849/9999 x 150/9998
Total Probability of success=0.044