# number of possible password combinations

There is a computer password , whose restriction is that it .

1)Each character is an upper case alphabet (A...Z) or a digit (0 to 9))

2) It should be of length 6

3) It should have at least 1 digit

I solved it as

combinations of password with at least 1 digit = Total password combinations - Number of passwords without digit

$$= 36^6 - 26^6$$ $$= 1867866560$$

This answer is the correct answer . But I wanted to do it by another way too .

Here I do

combinations of password with at least 1 digit = combinations of password with 1 digits + combinations of password with 2 digits + combinations of password with 3 digits + combinations of password with 4 digits + combinations of password with +5 digits + combinations of password with 6 digits

$$26^5*10^1 + 26^4*10^2 + 26^3*10^3 + 26^2*10^4 + 26^1*10^5 + 10^6$$

Answer comes as $192447360$ .Is the approach right, If so where am I going wrong in this method ? Please help .

Thanks

-
The digit can be in any one of the $6$ places. So your first term should be $6\times26^5\times 10$ instead (and so on for the other terms). – Lord Soth Jul 26 '13 at 18:46
Similarly for all parts.Yes .Now I understand where I went wrong . Thanks . – Harish Kayarohanam Jul 26 '13 at 18:55

## 2 Answers

When you calculate no. of passwords with $k$ digits $1\le k\le 6$, the number is $$\binom{6}{k}10^k(26)^{6-k}$$ So, in your calculations you are missing the binomial coefficients.

-

${\bf Hint}$: in your sum, you have not accounted for the amount of ways to choose where to place each digit for each of the 6 cases.

-