Possible Password Combinations

  • Thread starter Mr Davis 97
  • Start date
In summary, there is a constraint that each password must contain at least one digit and there are a total of 36^6 possible passwords without this constraint. To find the number of possible passwords with the constraint, we can subtract the number of passwords without any digits (10^6) from the total possible passwords, resulting in 36^6 - 10^6 = 26^6. Another approach is to directly count the number of passwords with varying numbers of digits and then sum them up, with the result being (36-26)*(36^5) + (36-25)*(36^4)*(6!/5!) + (36-24)*(36^3)*(6!/4!*2!) + (36-
  • #1
Mr Davis 97
1,462
44

Homework Statement


Each user on a computer has a password, which is six to eight characters long, where each character is an uppercase letter or a digit. Each password must contain at least one digit . How many possible passwords are there?

Homework Equations

The Attempt at a Solution


My reasoning was as follows: First, for passwords with length 6, we can choose the 6 places where at least one digit will go, and that digit can be chosen in 10 different ways. Then we multiply this by ##36^5##, since that is the number of choices we have for the other characters in the password of length 6. We apply similar reasoning to passwords of length 7 and length 8, and get ##10 \cdot 6 \cdot 36^5 + 10 \cdot 7 \cdot 36^6 + 10 \cdot 8 \cdot 36^7##. However, this is not the right answer. Where am I going wrong?
 
Physics news on Phys.org
  • #2
There seems to be no restraint on having a password of only numbers, your reasoning creates this restraint.

366 will give you all the possible passwords for a six character long passwords containing 0-9 and a-z (note: passwords only containing letters are still in the mix.) Now you need to find a way to separate to passwords containing only letters.
 
Last edited:
  • #3
I think you are counting many combinations more than once. For example, you are counting the combination 111111 six times. It's easy to see that your calculation can't be right, because 10*6*36^5 is greater than the 36^6 combinations of six characters ignoring how many digits there are. I would start with the 36^6 possible sequences, then subtract the ones that have no digits. This is a smaller number than your calculation.
 
  • #4
phyzguy said:
I think you are counting many combinations more than once. For example, you are counting the combination 111111 six times. It's easy to see that your calculation can't be right, because 10*6*36^5 is greater than the 36^6 combinations of six characters ignoring how many digits there are. I would start with the 36^6 possible sequences, then subtract the ones that have no digits. This is a smaller number than your calculation.
So your method of counting the complement is good, and it works. But I'm just curious, is there any way to directly counting how many passwords there are without overcounting? Would it be to complicated to justify doing?
 
  • #5
Your method double counts all passwords with two digits, triple counts all passwords with three digits and so on. For example 1AAAA2 is counted once where the '1' is the digit chosen in your first factor of 10 and once where the '2' is that digit.

You need to make the first digit chosen special in some way. For instance you could make it the earliest digit in the six characters. Approaching it that way you can avoid multiple counting.

EDIT: added because the above two posts appeared while I typed mine. The method of the previous paragraph will allow you to calculate the number of passwords without having to deduct anything.
 
  • #6
Mr Davis 97 said:
So your method of counting the complement is good, and it works. But I'm just curious, is there any way to directly counting how many passwords there are without overcounting? Would it be to complicated to justify doing?

You could count all passwords with 1 digit $$10*25^5*\frac{6!}{5!*1!} $$+ all passwords with 2 digits $$10^2*25^4*\frac{6!}{4!*2!} $$, etc. This should work.
 
  • #7
(366-266)+(367-267)+(368-268)

Is the answer I was talking about.
 
  • #8
Emilyneedshelp said:
(366-266)+(367-267)+(368-268)

Is the answer I was talking about.
This being a homework forum, that's rather too much help at this stage.
 
  • #9
phyzguy said:
This should work.
True, but not very efficient. Sometimes it is simpler to overcount then subtract out those that violated the rules.
 
  • #10
haruspex said:
This being a homework forum, that's rather too much help at this stage.

I'm sorry about that, I thought the post above had posted an answer too.
 

1. How many possible passwords are there?

The number of possible passwords depends on the length and complexity of the password. For a password with only numbers, there are 10 possible combinations for each digit. For a password with both letters and numbers, there are 36 possible combinations for each digit. Therefore, the total number of possible passwords can range from 10^(length) to 36^(length), where length is the number of characters in the password.

2. What is the formula for calculating the number of possible passwords?

The formula for calculating the number of possible passwords is (n^r), where n is the number of characters in the character set (e.g. 10 for numbers, 26 for lowercase letters, etc.) and r is the length of the password. This formula assumes that the characters can be repeated in the password.

3. How does using special characters affect the number of possible passwords?

Using special characters in a password can significantly increase the number of possible combinations. For example, using a combination of numbers, letters, and special characters can result in over 90 possible combinations for each character. This drastically increases the overall number of possible passwords and makes it more difficult to guess or crack.

4. Can using a longer password increase the security of my account?

Yes, using a longer password can increase the security of your account. As the length of the password increases, the number of possible combinations also increases, making it more difficult for someone to guess or crack your password. Experts recommend using a password with at least 8 characters, but using a password with 12 or more characters can significantly increase the security of your account.

5. How can I create a strong and unique password?

To create a strong and unique password, it is recommended to use a combination of uppercase and lowercase letters, numbers, and special characters. Avoid using personal information such as your name, birthdate, or address in your password. Additionally, using a password manager can help generate and store strong and unique passwords for each of your accounts.

Similar threads

Replies
12
Views
425
  • Precalculus Mathematics Homework Help
Replies
1
Views
667
  • Precalculus Mathematics Homework Help
Replies
3
Views
764
  • Precalculus Mathematics Homework Help
Replies
1
Views
941
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
918
  • Precalculus Mathematics Homework Help
Replies
1
Views
715
  • Precalculus Mathematics Homework Help
Replies
3
Views
721
  • Precalculus Mathematics Homework Help
Replies
3
Views
2K
  • Precalculus Mathematics Homework Help
Replies
6
Views
953
Back
Top