# Number of possible passwords given criteria

I'm trying to calculate the number of possible passwords provided that the length is 6 characters long. The characters can be any of the 26 lowercase letters or the digits 0-9. Supposing that the password must contain at least three letters, how many valid passwords are there to choose from?

I know that I would take the characters + digits (26 + 10) to the power of 6 (the length of the password). But how would I account for the constraint of the password containing at least three letters. E.g. "ab1234" is not a valid password.

• Will it be valid to sum up the passwords count for exactly $3$, exactly $4$, exactly $5$, exactly $6$ letters in each? Commented Jun 20, 2020 at 19:00
• I was thinking along the lines of 36^6 - (10^6 * 2) but i'm not sure if that's correct. Commented Jun 20, 2020 at 19:07
• Try to think of all terms of binominal expansion of $(26+10)^6$ as each term ${6\choose k}26^k10^{6-k}$ corresponds to taking $k$ letters and $6-k$ digits. What terms will sum up to the answer then? Commented Jun 20, 2020 at 19:20

## 1 Answer

If we consider the Newton's binobial $$(26+10)^6=\sum\limits_{k=0}^6 {6\choose k}26^k10^{6-k}$$ each (say $$k$$th) term of the RHS has the reasoning like "we have to place $$k$$ letters and $$6-k$$ digits. We choose the places where the letters will be in $${6\choose k}$$ ways, then choose $$k$$ letters in $$26^k$$ ways and $$6-k$$ digits in $$10^{6-k}$$ ways independently".

So if we are allowed to use only $$3$$ to $$6$$ letters, the answer will be $$\sum\limits_{k=3}^6 {6\choose k}26^k10^{6-k}.$$