Discrete mathematics problem - Probability theory and counting
Posted
by Mohammad
on Stack Overflow
See other posts from Stack Overflow
or by Mohammad
Published on 2010-05-18T00:01:57Z
Indexed on
2010/05/18
0:10 UTC
Read the original article
Hit count: 412
discrete-mathematics
Hello All,
I'm taking a discrete mathematics course, and I encountered a question and I need your help. I don't know if this is the right place for that though :)
It says:
Each user on a computer system has a password, which is six to eight characters long, where each character is an uppercase letter or a digit. Each password must contain at least one digit. How many possible passwords are there?
The book solves this by adding the probabilities of having six,seven and eight characters long password. However, when he solves for probability of six characters he does this
P6 = 36^6 - 26^6
and does
P7 = 36^7 - 26^7
and
P8 = 36^8 - 26^8
and then add them all
I understand the solution, but my question is why doesn't calculating, P6 = 10*36^5 and the same for P7 and P8, work? 10 for the digit and 36 for the alphanumeric?
Also, if anyone could give me another solution, other than the one in the book.
Thank you very much :)
© Stack Overflow or respective owner