106k views
3 votes
In how many ways can we form a four-digit password, if no four repeated numbers nor four consecutive numbers are allowed? For example, 8901 or 2333 are allowed, while 1234 nor 3555 are not.

User Wolric
by
8.0k points

1 Answer

2 votes

To determine the number of ways we can form a four-digit password with the given constraints, we can break down the problem into steps:

Step 1: Count the total number of four-digit passwords without any constraints.

In this case, the first digit can be any number from 0 to 9 (total of 10 possibilities). The second digit can also be any number from 0 to 9 (another 10 possibilities). The same applies to the third digit and fourth digit, giving us a total of 10 * 10 * 10 * 10 = 10,000 possibilities.

Step 2: Subtract the passwords with four repeated numbers.

In this case, the first three digits have only 10 possibilities each, but the fourth digit must be different from the previous three. So, we have 10 * 10 * 10 = 1,000 combinations with four repeated numbers.

Step 3: Subtract the passwords with four consecutive numbers.

If the first digit is 0, 1, 2, 3, 4, 5, or 6, then there are only six possibilities for the second digit (to avoid four consecutive numbers). The third digit has a similar restriction, so it also has six possibilities. The fourth digit must be different from the previous three, giving us a total of 7 * 6 * 6 = 252 combinations.

Step 4: Calculate the final result.

To obtain the number of valid passwords, we subtract the counts from Step 2 and Step 3 from the count in Step 1:

10,000 - 1,000 - 252 = 8,748

Therefore, there are 8,748 ways to form a four-digit password, considering the given constraints.

User Nazila
by
8.4k points

Related questions

asked Mar 13, 2024 123k views
Vigamage asked Mar 13, 2024
by Vigamage
7.9k points
1 answer
0 votes
123k views
1 answer
2 votes
32.4k views