Each user on a computer system has a password, which is six to eight characters long,$\dots$ Question:
Each user on a computer system has a password, which is six to eight characters long, where each character is an upper-case letter or a digit. Each password must contain at least one digit. How many possible passwords are there?


  I'm in the Basic of Counting section of my Discrete Mathematics book, and I have a problem with my reasoning with this. I will give you my reasoning and the books reasoning. Both give different answers, but I don't see a difference in the train of thought, so I need someone to point out the difference.


My Attempt:
Immediately I noticed 3 kinds of character length which allows me to break it down to three cases, respectively $P_6, P_7, P_8$, then add all of them. For $P_6$, $5$ will be made up of alpha numeric characters, and $1$ is made up of just digits due to the requirement of "at least one digit", thus

$$P_6 = (36)^5*10$$

Should be enough to show my train of thought, now the books solution.

Books Solution: The book did the same thing in dividing in 3 cases and adding them later so I'll go ahead and show you their train of thought for $P_6$. 

$$P_6 = 36^6 - 26^6$$

Basically its the number of possible 6 alphanumeric minus just alpha numeric.


  I know that both give different answers, but I still can't tell why.
Your calculation for $P_6$ gives the number of words in which the first five characters can be letters or digits, and the last must be a digit.  But there is nothing in the rules to say that the last must be a digit.

Alternatively, you could interpret your answer to say that, for example, symbols $1,2,4,5,6$ can be anything, and the $3$rd must be a digit.  Same problem - there is no requirement that any specific symbol must be a digit.

The simplest solution to the problem is the one given in the book.
$36^6$ gives you the number of passwords  $6$ characters long, including passwords which are alphanumeric. But it also includes password which contains only alphabet, therefore subtract subtract $26^6$. 

Similarly for passwords of length $7$ and $8$.