Number of possible passwords given criteria

combinatorics

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.

Best 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}.$$