# Probability of Opening a Pushbutton Lock

## Homework Statement

A password has numbers 0-9 in it. The password is 5 digits, repeats are not allowed, and order doesn't matter (I just have to have the correct 5 digit buttons depressed).

A. If I guess at the password, what is the probability that the box will open?

B. If I have completely forgotten the password, what is the probability that it will take less than 10 tries to get it open?

Combination

## The Attempt at a Solution

10C5 = 252
1/252 = .003 The chances of guessing the code (This seems to low how the order doesn't matter of the numbers as long as they are pushed right)

(1/252)+(1/251)+(1/250)....(1/1/242) =.04% (Also seems to low)

I thought maybe I need to do 5x10/252 because order doesn't matter and there 5 digits and 10 numbers to choose from.

Last edited by a moderator:

phinds
Gold Member
2021 Award

## The Attempt at a Solution

10C5 = 252
I don't see how you get that. Forget trying to use formulae, just think of it this way: how may ways can you fill the first position? Having done that, how many ways can you fill the second position? Keep going and what do you get?

I don't see how you get that. Forget trying to use formulae, just think of it this way: how may ways can you fill the first position? Having done that, how many ways can you fill the second position? Keep going and what do you get?
10 Digits chose 5
10!/(5!(10-5)!)= 252

I thought of it as 10*9*8*7*6=30240
5^10=9765625 ways to choose numbers ( this doesn't account for repeats not being allowed)

PeroK
Homework Helper
Gold Member
2021 Award

## Homework Statement

A password has numbers 0-9 in it. The password is 5 digits, repeats are not allowed, and order doesn't matter (I just have to have the correct 5 digit buttons depressed).

A. If I guess at the password, what is the probability that the box will open?

B. If I have completely forgotten the password, what is the probability that it will take less than 10 tries to get it open?

Combination

## The Attempt at a Solution

10C5 = 252
1/252 = .003 The chances of guessing the code (This seems to low how the order doesn't matter of the numbers as long as they are pushed right)

(1/252)+(1/251)+(1/250)....(1/1/242) =.04% (Also seems to low)

I thought maybe I need to do 5x10/252 because order doesn't matter and there 5 digits and 10 numbers to choose from.

It's a funny sort of lock if the order doesn't matter! Yes, 10C5 is correct.

Your method for part b) is not correct. Imagine there were only two options and you had two choices. You would definitely get it right it two attempts. But not with your method of calculation.

Would it just be 10/252 then? Then is part A right?

PeroK
Homework Helper
Gold Member
2021 Award
Would it just be 10/252 then? Then is part A right?

Yes, part A is right. You have to rethink part B. 10/252 is an approximation, but not exact. Although, less than 10 attempts means only 9 attempts in my book!

phinds
Gold Member
2021 Award
I thought of it as 10*9*8*7*6=30240
Yeah, that's what I was getting but I see now that that is the answer to a different question than the one asked.

Yes, part A is right. You have to rethink part B. 10/252 is an approximation, but not exact. Although, less than 10 attempts means only 9 attempts in my book!

Could do a geometric series right. So:
1/252+1/251+1/250 +1/249.... 1/242

Just dont know hwo to set it up using that formula
a(a-r^n)/1-r
n=10
r=?

PeroK
Homework Helper
Gold Member
2021 Award
Could do a geometric series right. So:
1/252+1/251+1/250 +1/249.... 1/242

Just dont know hwo to set it up using that formula
a(a-r^n)/1-r
n=10
r=?

Okay, a big hint. What about the probability of not guessing it in 9 attempts?

251/252 is not guessing the right number

250/251 would be not guessing the 2nd time (since we have one less guess made)

PeroK
Homework Helper
Gold Member
2021 Award
251/252 is not guessing the right number

250/251 would be not guessing the 2nd time (since we have one less guess made)

Good, so keep going from there.

Good, so keep going from there.

How can I set this up with the formula?

SammyS
Staff Emeritus
Homework Helper
Gold Member
How can I set this up with the formula?
Keep going a little further.

What do you do with 251/251, 250/251, 249/250, etc. ?

By the way, 1/252 ≈ 0.00397 .

PeroK
Keep going a little further.

What do you do with 251/251, 250/251, 249/250, etc. ?

By the way, 1/252 ≈ 0.00397 .

In your case you would be subtracting them, which would be arthemtic.

verty
Homework Helper
How can I set this up with the formula?

I'll show you one possibility. Instead of 10 tries, let's imagine it's 2 tries.

There is ##{1 \over 252}## chance I get it on my first go and ##{251 \over 252} \cdot {1 \over 251}## chance I get it on the second go. Does that makes sense? See if you can take this idea further.

PeroK
Homework Helper
Gold Member
2021 Award
In your case you would be subtracting them, which would be arthemtic.

We're all giving you ideas, but if you note we are leaving some thinking to you!

SammyS
Staff Emeritus
Homework Helper
Gold Member
In your case you would be subtracting them, which would be arthemtic.
No, don't subtract them as a group.

I'll show you one possibility. Instead of 10 tries, let's imagine it's 2 tries.

There is ##{1 \over 252}## chance I get it on my first go and ##{251 \over 252} \cdot {1 \over 251}## chance I get it on the second go. Does that makes sense? See if you can take this idea further.

Alright I remember this!

So :
1: 1/252
2: 1/252 * 251/252
3: 1/252 * 251/252 * 250/251
4: 1/252 * 251/252 * 250/251 * 249/250...

Geometric:
(1/252)/(1-(1/252)) = still get .003 tho :(

verty
Homework Helper
Alright I remember this!

So :
1: 1/252
2: 1/252 * 251/252
3: 1/252 * 251/252 * 250/251
4: 1/252 * 251/252 * 250/251 * 249/250...

Geometric:
(1/252)/(1-(1/252)) = still get .003 tho :(

Some of the time, I get it right on the first go. This is a frequency of ##{1 \over 252}##. Some of the time I don't, and some of that time I get it on my second go. That is a frequency of ##{251 \over 252} \cdot {1 \over 251}##. I can't explain this any better. I hope it helps but otherwise I'm sorry I couldn't be more helpful.

Ray Vickson
Homework Helper
Dearly Missed
Alright I remember this!

So :
1: 1/252
2: 1/252 * 251/252
3: 1/252 * 251/252 * 250/251
4: 1/252 * 251/252 * 250/251 * 249/250...

Geometric:
(1/252)/(1-(1/252)) = still get .003 tho :(

Your computations are wrong. Let the events be ##S_n=## succeed on draw ##n## and ##F_n = ## fail on draw ##n##.
$$\begin{array}{ll} P(S_1) = \frac{1}{252}, &P(F_1) = \frac{251}{252} \\ P(S_2|F_1) = \frac{1}{251}, & P(F_2|F_1) = \frac{250}{251}\\ P(S_3|F_1 \cap F_2) = \frac{1}{250},&P(F_3|F_1 \cap F_2) = \frac{249}{250} \\ \vdots & \vdots \end{array}$$ Thus,
$$P(F_1 \cap F_2) = \frac{251}{252} \cdot \frac{250}{251} = \frac{250}{252}.$$
Similarly, ##P(F_1 \cap F_2 \cap F_3) = 249/252, ## etc.