- calculatorcalculatorxmrmcm+()789÷c456×ce123−√±0.+=transfer display
- flag
-
a popular website requires users to create a password consisting of digits only. if no digit may be repeated and each password must be at least 9 digits long, how many passwords are possible?
title
password
your result
correct
difficulty
very hard
your pace
0:02
others' pace
2:02
video explanation
text explanation
for this (and all) counting problems, we need to ask if order matters. in this password question, we essentially need to know if these two 9-digit long passwords are different:
123456789 vs. 987654321.
each has the same 9 digits, but arranged differently. well, as we know from pin numbers and email passwords, these two values are different passwords. hence, order matters and we’re dealing with a permutation question.
great! our next step is to tackle the at least 9-digits long part of our question. first, let’s list all the possible digits. they are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
in total, there are 10 digits from 0 - 9. since no digit may repeat, and the password must be at least 9-digits long we have only two possible lengths: 9 digits long, or the full 10 digits long password.
for the 9-digits long password, we lay out 9 slots:
_ _ _ _ _ _ _ _ _ .
in the first slot, we have 10 digits to choose from; in the second, we have 9 digits to choose from, and so on. so, we’re left with:
9-digits = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2
this is the same as 10p9 = 10!
for the 10-digits long password, we lay out 10 slots:
_ _ _ _ _ _ _ _ _ _ .
again, in the first slot, we have 10 digits to choose from; in the second, we have 9 digits to choose from, and so on until we fill the 10th slot. we have:
10-digits = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.
this is the same as 10p10 = 10!
finally, we add these two distinct sets of possible password arrangements together to have 10! + 10! = 2 x 10! passwords. voila! that is our answer :)
frequently asked questions
faq: just to clarify—can the first number in this password be 0?
a: yes, the first digit can be 0. if we changed from numbers to letters, any single letter could be the start of our password. in the same way, 0 is allowed to be the first digit in a string of digits for a password even though if we were simply making a number we wouldn't include it. this isn't quite a number —it's a password. on your computer, it's possible to type in a number starting with 0 as your password, so we can do it here as well. :)
related lessons
watch the lessons below for more detailed explanations of the concepts tested in this question. and don't worry, you'll be able to return to this answer from the lesson page.