How many 5 character passwords are possible if each password must contain at least one special character?

Suppose a system requires you to choose a 5 character password. Only the digits 0-9, lowercase letters, and 3 special characters are allowed to be used, and no character is allowed to be repeated. If at least 1 special character is also required, how many possible 5 character passwords can there be?

So I know for this I have to use combinations and permutations but I'm not sure how to approach multiple options like this. I'll try to write out my thought process: (SC = special character)

a (1 SC) = nCr(3, 1) * nPr(36, 4) * nPr(5, 1)

(choose 1 SC out of 3) * (choose 4 out of 36 digits or letters, no repetition) * (choose 1 placement in the 5 characters for the SC)

b (2 SCs) = nCr(3, 2) * nPr(36, 3) * nPr(5, 2)

(choose 2 SC out of 3) * (choose 3 out of 36 digits or letters, no repetition) * (choose 2 placements in the 5 characters for the SCs)

c (3 SCs) = nCr(3, 3) * nPr(36, 2) * nPr(5, 3)

(choose 3 SC out of 3) * (choose 2 out of 36 digits or letters, no repetition) * (choose 3 placements in the 5 characters for the SCs)

a + b + c = answer

Am I on the right track here? Any feedback is appreciated!


Solution 1:

$N$ - number of all characters (specials included)
$n$ - number of non-special characters
number of all possible 5 letter words from all possible characters ${N\choose 5} 5!$
number of all possible 5 letter words from non-special characters only ${n\choose5} 5!$ $$\text{Answer: }{N\choose5} 5! - {n \choose 5} 5!$$