Q:

How many passwords with one or more digits?

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?

A:

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$.

