Take a chance with the padlock

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


The answer is 0.0443.

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.

2 solutions

Rohit Sachdeva
Apr 16, 2015

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

A great way (I think better than mine) of counting the complete number of combinations which satisfy the conditions. Thanks for sharing your solution.

Jihoon Kang - 6 years, 1 month ago
Jihoon Kang
Apr 16, 2015

Firstly, let's consider how many possibilities there are:

Let the first digit be 0. Then there are 2 cases:

  1. The remaining three digits are either 1 or 0. In which case, we have 2 3 = 8 2^3=8 possibilities.

  2. The remaining digits are either 9 or 0. In which case we also have 2 3 = 8 2^3=8 possibilities.

But here, we counted 0000 twice. So when the first digit is 0, we have 2 × 8 1 = 15 2 \times 8 -1=15 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 10 × 15 = 150 10 \times 15=150 possible padlock configurations which satisfy the above conditions.

Now there are 1 0 4 = 10000 10^4=10000 different combinations in total. Here it is easier calculating the probability that all 3 attempts fail:

1st attempt: we have P 1 P_1 (fail) = 10000 150 10000 = 9850 10000 =\frac{10000-150}{10000}=\frac{9850}{10000}

2nd attempt: Since the first attempt failed, we have 1 less possibility. Then P 2 P_2 (fail) = 9850 1 10000 1 = 9849 9999 =\frac{9850-1}{10000-1}=\frac{9849}{9999}

3rd attempt: Since the first and second attempt failed, we have 2 less possibilities. Then P 3 P_3 (fail) = 9850 2 10000 2 = 9848 9998 =\frac{9850-2}{10000-2}=\frac{9848}{9998}

So the probability of failing all is

9850 10000 × 9849 9999 × 9848 9998 = 0.9556672... \frac{9850}{10000} \times \frac{9849}{9999} \times \frac{9848}{9998}=0.9556672...

So the probability of succeeding is 1 0.9556672... = 0.044332741... = 0.0443 ( 3 s f ) 1-0.9556672...=0.044332741...=0.0443(3sf)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...