I'm working from Kenneth Rosen's book "Discrete Mathematics and its applications (7th edition)". One of the topics is counting, he gives an example of how to count the total number of possible passwords.
Question: Each user on a computer system has a password, which is six to eight characters long, where each character is an uppercase letter or digit. Each password must contain at least one digit. How many possible passwords are there?
His solution: Let $P$ be the total number of possible passwords, and let $p_6, p_7$ and $p_8$ denote the number of possible passwords of length 6, 7, and 8, respectively. By the sum rule, $p = p_6 + p_7 + p_8$.
$P_6 = 36^6 - 26^6 = 2,176,782,336 - 1,308,915,776 = 1,867,866,560$
Similar process for $p_7$ and $p_8$.
This is where I'm confused, what is the logic for finding $p_6$? If I was given the question, I would have done as follows:
$p_6 = 36^5 * 10$, because 5 of the 6 characters can be a letter or a number, so 36 possible values for each character. One character has to be numerical, so it has 10 possible values. All multiplied together, gives you $p_6$. Obviously I'm wrong, but why is he right?
I'd just like to understand the thinking behind Rosen's solution, as he does not make that clear in the book.