Killer robots are trying to take over the world. They know the password to the doomsday weapon is 5 digits long and contains either 0 or 1, and either 2 or 3, and either 4 or 5, and either 6 or 7, and either 8 or 9. If the robots can enter 5 passwords per second, how long (in seconds) will it take them to go through all the possible passwords?
Details and assumptions
The order of the digits matter. The password 12341 is different from the password 43211.
The password 12341 doesn't satisfy the condition, because it doesn't contain either 6 nor 7 (or alternatively because it doesn't contain either 8 or 9).
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.
The password has five digits. Any of the five digits can be filled by two ways I.e. the first digit in two ways alongwith the second digit in two ways and so on by the given five pairs . Further these five pairs of digits can be permuted in 5! ways and the total number of possible passwords are 5 ! × 2 ^ 5 = 3840. As the killer robots can enter five passwords per second hence it will take 3840 / 5 seconds = 768 seconds to enter al possible passwords.
Since the number has 5 digits, from the question, we can see that each digit must come from a different set mentioned. Each code is formed by arranging the 5 sets then choosing one digit from each set.
There are 5 sets, so there are 5 ! = 1 2 0 ways of arranging the sets. From each set, we have 2 choices for the digit. Thus, the total number of possible codes is 5 ! × 2 5 = 3 8 4 0 .
The amount of time it takes to go through all the possible passwords is 5 3 8 4 0 = 7 6 8 seconds.
Since the password is 5 digits long and requiring either 0 or 1, etc. we can count that there are (2^5)\ possible codes with 0 or 1 on the first place, 2 or 3 on the second, 4 or 5 on the third, 6 or 7 on the fourth, and 8 or 9 on the fifh.
Next we need to find in how many ways they can be arranged, which is (5!)\ so in total there are (2^5 . 5!)\ Since the robot can input 5codes per second, the time required to input all possible codes are (\frac{2^5 . 5!}{5})\ which is equal to (768)\
The password consists of 5 digits,each digit has two possible values given,hence the number of ways of forming will be 2^5 . Now the 5 digits can be arranged in 5! different ways. Hence total number of possible passwords =5! * 2^5 =3840. Now the robot can enter 5 passwords per second hence, Time taken by it will be =3840/5 =768 seconds .
Since each possible pair doesn't overlap, we can choose one number from each to get 2 5 = 3 2 possibilities. Then to order the 5 numbers, there are 5 ! = 1 2 0 ways. The number of possible passwords is 1 2 0 ∗ 5 . Then since distance over rate equals time, 1 2 0 ∗ 3 2 / 5 = 7 6 8 seconds.
We know the password is five digits long. Lets call these digits A , B , C , D , E .
We can say
A is 0 or 1
B is 2 or 3
C is 4 or 5
D is 6 or 7
E is 8 or 9
Since there are five slots and two choices for each one, there is 2 5 permutations for each ordering of A , B , C , D , E .
There are 5 ! orderings for A , B , C , D , E . Thus, the total number of passwords is 5 ! × 2 5
Since a robot can enter in 5 passwords per minute, we divide the total number by five.
5 5 ! × 2 5
4 ! × 2 5 = 2 4 × 3 2 = 7 6 8
768
First, we account for the number of possibilities for the number of digits. Since it contains one each of 0/1, 2/3, 4/5, 6/7, and 8/9, there are 2 possible values for each number, or 32 possibilities total.
Next, we can arrange the selected digits. Since all 5 digits are distinct, there are 5! = 120 ways to arrange them.
Therefore, there are 32 120 possible passwords, at 5 passwords per second, it takes 32 120/5 = 768 seconds.
We can represent the digits of the password, in no particular order, as
(0 or 1) (2 or 3) (4 or 5) (6 or 7) (7 or 8) (9 or 0)
As can be seen, the possibilities for each digit are mutually exclusive from the others. Hence, we can calculate the number of combinations of digits in the password simply by multiplying the number of possibilities for each digit, giving us
2 × 2 × 2 × 2 × 2 = 2 5 = 3 2
Then we calculate the number of possibilities for the order of digits, which for 5 digits would be
5 ! = 1 2 0
Hence the number of possible passwords can be found by calculating both the possible combinations of digits and the possible orders of digits, giving
3 2 × 1 2 0 = 3 8 4 0
Finally, because the robots enter 5 passwords a second, we just divide by 5
3 8 4 0 / 5 = 7 6 8
Since the conditions "0 or 1, and either 2 or 3, and either 4 or 5, and either 6 or 7, and either 8 or 9" involve mutually exclusive partitions, we can begin by splitting the characters of the password into groups: S (for smallest, 0 or 1), s (for low, 2 or 3), M (for medium, 4 or 5), b (for big, 6 or 7), and B (for biggest, 8 or 9).
Now we have that the password contains all of S, s, M, b, and B and contains 5 characters. Hence, we know that the password is some permutation of SsMbB. There are 5P5 = 5! = 120 of these.
However, since each of S, s, M, b, and B have 2 options, we multiply our 120 by 2 for each letter (we multiply by 2^5). Thus, we get that there are 120*2^5 = 3840 total possible passwords
Since the robot can enter 5 passwords per second, 3840 passwords * 1 second/5 passwords = 768 seconds
We know one of the digits is either 0 or 1, another is either 2 or 3, another is either 4 or 5, another is either 6 or 7 and the remaining digit is 8 or 9. This gives us a total of 2 2 2 2 2 = 32 sets of digits.
The digits are also distinct so there are a total of 5! = 120 ways to arrange each of the sets of digits. Hence there are 120*32 total passwords.
The robots enter 5 passwords every second. The number of seconds needed is 120 32/5 = 24 32 = 768 and we are done.
For the 1st code's digit (c.d. from now on), they can choose any of 10 digits, but for every next c.d. , they must reduce set of available digits by 2 because otherwise there won't be enough 'space' for some of other digits that password must contain. Example: Let's say 1st digit is 0, we can't use 1 anymore (because of problem's conditions), but if we use 0 again and have 0 0 X X X, we can't put 4 digits (1st (2 or 3), 2nd (4 or 5), 3rd (6 or 7), 4th (8 or 9)) in 3 spaces (and we must put 4 digits because of problem's conditions, which demand that one digit from (a or b) must be used). So we get number of passwords: 10*8*6*4*2 and divide it by 5 to count time process takes.
Solution 1: Since we have a total of 5 digits, and we have 5 groups of 2 where we must use exactly 1 number from each of those groups. If we start constructing a possible password, there are 10 choices for what the first digit could be. The second digit cannot be in the same group as the first digit, so there are 8 possibilities for it. We continue this reasoning and see there are 6 possibilities for the 3th digit, 4 possibilities for the 4th digit, and 2 possibilities for the last digit. So in total there are 1 0 ∗ 8 ∗ 6 ∗ 4 ∗ 2 = 3 8 4 0 possible passwords. Since the robots can enter 5 passwords per second, it will take them 3 8 4 0 / 5 = 7 6 8 seconds to enter all the passwords.
Solution 2: There are 2 choices for whether the number contains 0 or 1, 2 for 3 or 4, etc. So there are 32 choices for which 5 digits appear in the number. There are 5 ! = 1 2 0 ways to arrange the five digits, so there are 3 2 × 1 2 0 = 3 8 4 0 different possible passwords. Since the robots can enter 5 passwords per second, it will take them 3 8 4 0 / 5 = 7 6 8 seconds to enter all the passwords.
total choices for numbers taken will be 2 × 2 × 2 × 2 × = 3 2 ( multiplication principle) since we can arrange then in 5 ! ways we have 3 2 × 5 ! possible passwords . dividing by speed of robots , we have
5 3 2 × 5 ! = 7 6 8 seconds needed !
Problem Loading...
Note Loading...
Set Loading...
There are five groups of numbers to choose from: 0 and 1, 2 and 3, 4 and 5, 6 and 7, 8 and 9, with the condition that you cannot choose two numbers from the same group. The number we are seeking also has five digits. It's now easy to see that we must choose exactly 1 number from each of the five groups, because if we were to not choose a number from a certain group, we would have to choose a second number from one of the previous four groups, violating the "either" clause.
By the above reasoning, there are 2 ways to select a number from the first group, 2 ways from the second group, and so on for all five groups. This means there are 2 5 = 3 2 ways to choose the possible numbers in the password. But wait, we're not done yet! We still have to count the number of ways to arrange these 5 numbers.
There is no overlap between any of the five groups: each digit from 0-9 appears once. Because we have to choose a single number from each group, it is obvious that these five numbers are distinct. Thus, there are 5 ! = 1 2 0 ways to arrange the numbers we have chosen.
With 3 2 ways to choose the numbers and 1 2 0 ways to arrange them, there are 3 2 × 1 2 0 = 3 8 4 0 possible combinations. As the robots can enter 5 passwords a second, it will take them 5 3 8 4 0 = 7 6 8 seconds.