Suppose you want to generate a password using ASCII characters ($128$ characters.)How many ways can you create a password of 10 characters long that has at least one lowercase letter (a-z) and at least one number ($0-9$)?
** MY ANSWER: $26*10*(128)^{10}$**
I don't understand why this is wrong? Can anybody help? Thanks!
It is easiest to concentrate first on the bad strings, the ones that do not qualify. These are the strings that are missing a lower-case letter, or a number, or both.
There are $102^{10}$ strings with no lower-case letters, and $118^{10}$ with no numbers. However, if we add these two numbers we are double-counting the words that miss both letter and number. There are $92^{10}$ of these. It follows that there are $102^{10}+118^{10}-92^{10}$ bad strings. Thus the number of good strings is $$128^{10}-102^{10}-118^{10}+92^{10}.$$