How many passwords with one or more digits?

167 Views Asked by At

A symbol in a password is either one of $26$ latin letters or one of $10$ digits. How many $8$ symbol passwords with at least $1$ digit?

I know there are $36^8-26^8$ of them. But at first I thought there were $36^7\times 10$.

What was my mistake? What does the number $36^7\times 10$ represent?

2

There are 2 best solutions below

7
On BEST ANSWER

The whole length $8$ password space has size $36^8$. There are $26^8$ passwords with only letters and no digits. So $36^8 - 26^8$ counts the number of passwords with at least one digit.

$10\cdot 36^7$ counts the number of passwords with a digit at the first position, e.g. Or with a digit at the final position. Or any fixed pre-given position for that matter.

To count the number with at least one letter we have the substract the
number of passwords with only digits, so $36^8-10^8$.

7
On

$36^7 \times 10$ represents all passwords with one number in a chosen position. For $7$ of the places you choose from all possible letters and numbers and for the chosen one you choose only from the numbers.

Assuming your title is correct and you are looking for passwords containing one or more digits, then $36^8 -26^8$ represents the space of all possible passwords minus those which are completely made up of letters.

Similarly, if you were looking for passwords containing one or more letters, then the answer would be $36^8-10^8$, the space of all passwords minus those which are completely made up of numbers.