Problem in Counting - Number of Passwords

  • Context: High School 
  • Thread starter Thread starter SamitC
  • Start date Start date
  • Tags Tags
    Counting
Click For Summary

Discussion Overview

The discussion revolves around calculating the number of possible passwords that can be created with 6 to 8 characters, where letter case does not matter and each password must contain at least one digit. Participants explore different approaches to the problem and the implications of including or excluding blank characters.

Discussion Character

  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a calculation method for the number of passwords with 6, 7, and 8 characters, leading to a total of 2,684,483,063,360.
  • Another participant questions the inclusion of blanks as valid characters in passwords, suggesting that blanks should not count.
  • Several participants discuss the implications of adding blanks to passwords, with some arguing that it complicates the counting of valid passwords.
  • One participant suggests that if blanks are allowed, the calculations should be adjusted to account for them, proposing a new total of 3,316,699,747,290.
  • Another participant emphasizes that the validity of a password is determined by the book's definitions and rules, which may not align with personal interpretations.
  • There is a repeated concern about how blanks affect the total character count and the validity of passwords, with some participants expressing confusion over the treatment of blanks in the calculations.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the treatment of blanks in password calculations, leading to multiple competing views on how to approach the problem. There is disagreement on whether blanks should be considered valid characters and how they affect the total count of passwords.

Contextual Notes

Participants note that the calculations depend heavily on the definitions of valid passwords and the treatment of blanks, which remain unresolved. The discussion highlights the complexity of counting valid passwords under different assumptions.

SamitC
Messages
36
Reaction score
0
Problem: How many passwords can be created with 6 to 8 characters. Letter case does not matter. Every password must have at least 1 digit.

Approach taken in the solution in the book:
Passwords with 6 characters P6 = 36^6 − 26^6 = 1,867,866,560.
Similarly, we have P7 = 36^7 − 26^7 = 70,332,353,920
and P8 = 36^8 − 26^8 = 2,612,282,842,880.
So, Answer: P = P6 + P7 + P8 = 2,684,483,063,360

My approach:
(number of passwords possible with 6 characters) * (adding 7th an 8th characters including blank) - (number of passwords possible with 6 alpha) * (adding 7th an 8th alpha including blank)

36^6 * 37^2 - 26^6 * 27^2 = 2,754,815,417,280

The answers are different. Can you pls. help finding what did I miss?
 
Physics news on Phys.org
I don't think blanks count as characters ... would your exercise (or your computer, for that matter) accept a ##1## plus six spaces as password ?
[edit] ah, see what you mean with these blanks. But adding two blanks to 6 letters doesn't work...
 
One has ##36^8 + 36^7 + 36^6 - 26^8 - 26^7 - 26^6##, the other has ##36^6 * 37 * 37 - 26^6 * 27*27##
 
BvU said:
[edit] ah, see what you mean with these blanks. But adding two blanks to 6 letters doesn't work...
That's actually okay. adding two blanks to a 6 letter password gives a 6 letter password, and we should count that.
The problem is adding blank+letter or letter+blank. only one of these cases produces a valid password.
 
  • Like
Likes   Reactions: SamitC and BvU
SamitC said:
Every password must have at least 1 digit.
[edit] shoot, it gets counted in and then subtracted, my bad.
 
  • Like
Likes   Reactions: SamitC
willem2 said:
The problem is adding blank+letter or letter+blank. only one of these cases produces a valid password.

Can you pls. explain more on this? I did not understand the blank+letter or letter+blank concept.
As per my understanding, blank is nothing. So if two blanks remain anywhere in a 7 character word, it becomes a 5 character word. i.e. does not matter where blank remains but what matters is how many times we allow blanks. Pls. correct me if wrong.
 
SamitC said:
Can you pls. explain more on this? I did not understand the blank+letter or letter+blank concept.
As per my understanding, blank is nothing. So if two blanks remain anywhere in a 7 character word, it becomes a 5 character word. i.e. does not matter where blank remains but what matters is how many times we allow blanks. Pls. correct me if wrong.

It seems I can't use the blanks. If the last two digits are blank then it means 6 character password which is already counted. Now, 7th or 8th char being blank means the same thing - 7 character password.
Now I am asking to myself - can we solve this problem using the blanks as characters with additional logic?
 
SamitC said:
It seems I can't use the blanks. If the last two digits are blank then it means 6 character password which is already counted. Now, 7th or 8th char being blank means the same thing - 7 character password.
Now I am asking to myself - can we solve this problem using the blanks as characters with additional logic?
You will have to count the cases with 0, 1 and 2 blanks separately.
There's one combination with 2 blanks, 36 with 1 character + a blank, and 362 with 2 characters.
You will get 366(1 + 36 + 362) which is the same as with the other method.
 
  • Like
Likes   Reactions: SamitC and BvU
It's important to state that it doesn't matter what we think is a valid password. The OP asks about the book answer, so the only thing that counts is what the book thinks. Without more information from the book, one is fishing for a set of rules that will match the book calculations.

From the book calculations, a blank is not valid anywhere. It's just the total number of possibilities from {a..z,0..9} (= 366) minus the total number of all-non-digit possibilities from {a..z} (=266) That is for 6 character passwords. The final answer is the sum of the answers for 6, 7, and 8 character passwords, similarly defined.
 
Last edited:
  • #10
Beg to differ. You would get 1 867 866 560 which is not the book answer
 
  • #11
BvU said:
Beg to differ. You would get 1 867 866 560 which is not the book answer
That is the book answer for 6 characters. It is summed with the corresponding answers for 7 and 8 characters. So the book's approach and definition of what is a valid password seems clear. (After seeing your response, I added another line to post #9.)
 
  • #12
SamitC said:
It seems I can't use the blanks. If the last two digits are blank then it means 6 character password which is already counted. Now, 7th or 8th char being blank means the same thing - 7 character password.
Now I am asking to myself - can we solve this problem using the blanks as characters with additional logic?
If you are allowing blanks, you would have to specify the rules you want to follow for a legitimate password with blanks. If you do not want to count trailing blanks the logic will change, but if you just want to allow a blank like any other non-digit character, then change all the book calculation 36's and 26's to 37 and 27, respectively:
6 characters = 376-276 = 2,178,305,920
7 characters = 377-277 = 84,471,523,930
8 characters = 378-278 = 3,230,049,917,440
Total of 6, 7, or 8 characters = 3,316,699,747,290

PS. I don't see why many password programs wouldn't use trailing blanks as part of the password.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
6
Views
10K
  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 32 ·
2
Replies
32
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
2
Views
2K
Replies
3
Views
2K