News0 min ago
Probability
I am trying to calculate the odds on guessing the code to open a combination lock of 10 digits when the combination is (a) a certain four digit number and (b) the same four digits but in any order. All four digits are different. Could anyone out there tell me how to do it and (even better) explain it in terms that even a bear of little brain could understand?
Many thanks in advance.
Many thanks in advance.
Answers
Best Answer
No best answer has yet been selected by RocW. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.Your layout doesn't make it clear whether the condition stated:
"All four digits are different." just applies to part (b) or to part (a) as well.
a - if condition does NOT apply) The numbers possible are 0000 to 9999 = 10000 different values, of which just one is correct so 1 in 10000
a - if condition DOES apply)
The number of ways of guessing the 1st digit is 10
That digit cannot be used again so for the second reel there are 9 choices.
That digit cannot be used again so for the third reel there are 8 choices. . . . and so on
Chances are therefore 1 in 10 x 9 x 8 x 7.
b) The number of ways of arranging 4 different digits in any order is factorial 4 so just divide your answer to part (a) by factorial 4.
"All four digits are different." just applies to part (b) or to part (a) as well.
a - if condition does NOT apply) The numbers possible are 0000 to 9999 = 10000 different values, of which just one is correct so 1 in 10000
a - if condition DOES apply)
The number of ways of guessing the 1st digit is 10
That digit cannot be used again so for the second reel there are 9 choices.
That digit cannot be used again so for the third reel there are 8 choices. . . . and so on
Chances are therefore 1 in 10 x 9 x 8 x 7.
b) The number of ways of arranging 4 different digits in any order is factorial 4 so just divide your answer to part (a) by factorial 4.
The number of combinations is 10^4. This is because you have 10 * 10 * 10 * 10 = 10,000. Each different digit can be chosen independent of the other digits you have.
If the numbers have to be unique, then you will have 10 * 9 * 8 * 7 = 5040 combinations. This is because for the first digit you have a choice of 10 numbers. But you effectively have a choice of 9 numbers for the second number. This is because one of them has already been used (your choice of the first digit). And again and again, giving you a choice of 8 and then 7 numbers to choose from for the remaining digits.
Now, ordering. If you have three numbers, how many ways can you write them? Take 3 numbers to make it easy:
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
That gives 6 combinations (any order). This can be easily understood with factorials. A factorial of a number is the result of multiplying that (integer number greater than zero) by numbers successively down to zero. It's written as an exclamation mark.
So for example, 2 factorial = 2! = 2 * 1 = 2.
Thee factorial = 3! = 3 * 2 * 1 = 6.
4 factorial = 4 * 3 * 2 = 24.
You notice here that three factorial gives 6. So to see how many choices of arrangements we have of a 3 digit number, we just find its factorial (6, as we have shown above).
Back to your problem.
For the first question, we have shown that there are 10,000 possible combinations of any 4 digit code (if each number can be from 0 to 9).
So the probability of choosing this one number is 1 / 10,000 = 0.0001.
But if you can choose this in any order, you should multiply this by 4! (4 factorial), since there are 4 numbers to rearrange in any order. This gives us a probability of 0.0024.
If the numbers are all unique (different), then there are 5040 combinations. This gives us a
If the numbers have to be unique, then you will have 10 * 9 * 8 * 7 = 5040 combinations. This is because for the first digit you have a choice of 10 numbers. But you effectively have a choice of 9 numbers for the second number. This is because one of them has already been used (your choice of the first digit). And again and again, giving you a choice of 8 and then 7 numbers to choose from for the remaining digits.
Now, ordering. If you have three numbers, how many ways can you write them? Take 3 numbers to make it easy:
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
That gives 6 combinations (any order). This can be easily understood with factorials. A factorial of a number is the result of multiplying that (integer number greater than zero) by numbers successively down to zero. It's written as an exclamation mark.
So for example, 2 factorial = 2! = 2 * 1 = 2.
Thee factorial = 3! = 3 * 2 * 1 = 6.
4 factorial = 4 * 3 * 2 = 24.
You notice here that three factorial gives 6. So to see how many choices of arrangements we have of a 3 digit number, we just find its factorial (6, as we have shown above).
Back to your problem.
For the first question, we have shown that there are 10,000 possible combinations of any 4 digit code (if each number can be from 0 to 9).
So the probability of choosing this one number is 1 / 10,000 = 0.0001.
But if you can choose this in any order, you should multiply this by 4! (4 factorial), since there are 4 numbers to rearrange in any order. This gives us a probability of 0.0024.
If the numbers are all unique (different), then there are 5040 combinations. This gives us a
[it cut my answer]
But if you can choose this in any order, you should multiply this by 4! (4 factorial), since there are 4 numbers to rearrange in any order. This gives us a probability of 0.0024.
If the numbers are all unique (different), then there are 5040 combinations. This gives us a probability of finding that combination as 1 / 5040. To take into account any ordering of the digits, multiply by 4!, to give us 24 / 5040.
But if you can choose this in any order, you should multiply this by 4! (4 factorial), since there are 4 numbers to rearrange in any order. This gives us a probability of 0.0024.
If the numbers are all unique (different), then there are 5040 combinations. This gives us a probability of finding that combination as 1 / 5040. To take into account any ordering of the digits, multiply by 4!, to give us 24 / 5040.