This a may be an inconvenient question, but I am needing help in the understanding the top answer given in this question: How many possible combinations in 8 character password? My main problem is that I can’t understand why or how some passwords where removed twice?
Asked
Active
Viewed 97 times
-1
-
1Are you familiar with the inclusion-exclusion principle? – JMoravitz Dec 16 '17 at 22:02
1 Answers
1
This is an example of the inclusion-exclusion principle.
When you subtract the number of passwords with no lowercase you also subtract passwords that have neither lowercase nor uppercase. Then you subtract the number of passwords with no uppercase and this time you also subtract passwords that have neither lowercase nor uppercase. Thus you have subtracted the passwords that have neither lowercase nor uppercase twice.
md2perpe
- 26,770
-
But if your doing 95^8 - 69^8, how does that get rid of both no upper and lowercase? Aren’t you only removing the upper or lowercase when you do that? – Hunter T. Dec 17 '17 at 00:28
-
If we just write $95^8 - 69^8$ we cannot say whether $69^8$ represents passwords with no uppercase or passwords with no lowercase. But look at what Thomas Pornin writes: "Then remove all passwords with no lowercase ($69^8$), all passwords with no uppercase ($69^8$)" Both removals include the string
12345678, so this is removed twice. – md2perpe Dec 17 '17 at 22:07 -