How many unique passwords are possible over alphabet of $62$ if order and repetition of characters don't matter?

292 Views Asked by At

Let there be some computer system for storing passwords. The length of passwords must be between $3$ and $100$ characters inclusive and must include one small letter, one capital letter and one number. There're $62$ legal characters in the system (A-Z, a-z, 0-9). The order of the characters doesn't matter as well as whether the characters repeat. For example, $a1abb1$ and $ab1$ are considered to be the same passwords. How many different passwords are possible?

The exercise recommends using inclusion/exculsion principle but I don't see why it should be used here, maybe I'm missing something.

Because order doesn't matter as well as repetitions we just need to choose some characters out of $62$. Therefore the number of different possible passwords is: $$ {61\choose1}+{62\choose 2}+\dots+{62\choose 62}=2^{62}-1 $$ Even though there's a restriction on password length it doesn't seem to matter in this problem because repetitions don't matter.

2

There are 2 best solutions below

0
On BEST ANSWER

While the exercise suggests to use inclusion exclusion, like Ross hinted at, you could instead just count all triples of sets $A_1\subseteq\{A,\dots,Z\}$, $A_2\subseteq\{a,\dots,z\}$, $A_3\subseteq\{0,\dots,9\}$ with $|A_i|\ge 1$ for $i=1,2,3$. You get $$ (2^{26}-27)^2 (2^{10}-11) = 4562142751537972397. $$

0
On

You are correct for the total number of passwords without the restriction that you need at least one character of each type. Now subtract the ones missing a type, but you have double subtracted the ones which are missing two types. That is where inclusion/exclusion comes in.