# Probability with locks

I'm not feeling very confident with probabilities so I would like some confirmation of my answers if possible. Thanks in advance!

The security code needed to open a safe in a jewellery shop is 590821. A burglar tries to open the safe by entering a randomly chosen sequence of 6 digits (where each digit entered is equally likely to be any integer from 0 to 9, independently of all other digits).

a) Find the probability that the burglar gets the first or the last digit right (or both).

Using the equation:

*# of sample points in Event / Total # of sample points

# of sample points in Event is = 3 because we want the First digit, last digit or both totalling 3.

Total # of sample points = 10 x 10 = 100 because we are dealing with only 2 parts of the lock.

So for a) 3/100 ? is this correct?

(b) Find the probability that the burglar enters the correct code.

Total # of sample points = 10 x 10 x 10 x 10 x 10 x 10 = 100,000 # of sample points = 6

so 6/100,000 for part b?

(c) Find the probability that the burglar gets exactly two of the six digits right.

A little more tricky, when calculating the #sample of points. Not sure how to do this one. But I think we need to think about how many ways we can get 2 digits correct out of the 6 digits. So 6C2 = 6!/2!(6-2)!

so 8.6 / 100,000 for part c?

(d) Given that the burglar gets exactly two of the six digits right, find the probability that the first two digits are wrong.

not sure how to answer this.

• For $(a)$: the probability of getting a specified digit wrong is $\frac 9{10}$ thus the probability of getting both of those wrong is $\left(\frac 9{10}\right)^2=\frac {81}{100}$ so the answer is $1-\frac {81}{100}=\frac {19}{100}$. – lulu Apr 20 '18 at 0:00
• There is a lot of carelessness in what you have written. $10\times 10\times 10\times 10\times 10\times 10=1,000,000$ for example. Not sure what the references to "sample points" mean. – lulu Apr 20 '18 at 0:02
• Sample space = all possible outcomes Sample point = an individual outcome – blaaaaaaa Apr 20 '18 at 0:04
• Ok, but there is only correct combination so where does the $6$ come from? – lulu Apr 20 '18 at 0:05
• Well, no. There are $1,000,000$ equi-probable sequences and only one winner so the answer to $(b)$ is $\frac 1{1,000,000}$. – lulu Apr 20 '18 at 0:11

a) Find the probability that the burglar gets the first or the last digit right (or both).

Using the equation:

# of sample points in Event / Total # of sample points

# of sample points in Event is = 3 because we want the First digit, last digit or both totalling 3.

Total # of sample points = 10 x 10 = 100 because we are dealing with only 2 parts of the lock.

So for a) 3/100 ? is this correct?

Not at all.   You want the probability for: guessing the first digit or the last digit or both.   Now, these events are not disjoint; they have an intersection of common outcomes, so make sure you don't overcount by using the Principle of Inclusion and Exclusion.   Also make sure you count in the same manner as you count the total ways.

And so, of the $10\times 10$ ways to guess these two parts of the lock, there are $1\times 10$ ways to guess the first digit, $10\times 1$ ways to guess the last digit, and among these there is $1\times 1$ way to guess both.

$$\dfrac {10+10-1}{100}=\dfrac {19}{100}$$

Now, retry the other parts whith what you have learned.

(d) Given that the burglar gets exactly two of the six digits right, find the probability that the first two digits are wrong.

not sure how to answer this.

The digits were selected for each placement were equally and independetly likely to be correct, so therefore the combinations of 2 correct and 4 incorrect placements chosen would also be unbiasedly distributed.

So, same principle: How many combinations of 2 correct and 4 incorrect placements are there? How many from these combinations have the first two placements wrong?

• so there are 8 combinations of 2 correct and 4 incorrect placements, and 1 combination having the first two placements wrong. So 1/8? – blaaaaaaa Apr 20 '18 at 1:04
• Certainly not. Please review your work on combinations. How many ways are there to select 2 from 6 items. How many ways to select 2 from 4? – Graham Kemp Apr 20 '18 at 1:15