In: Statistics and Probability
In an exactly 8 character long password where capital letters, small letters, and digits (0 to 9) must be used. Regardless of the order, how many passwords will use exactly 5 ones, 4 twos, and one Z?
solution:
Given that
No.of capital letters = 26
No.of small letters = 26
No.of digits(0-9) = 10
Total No.of characters = 26+26+10 = 62
i) No.of passwords will use exactly 5 one's
---> Regardless of the order,
ex-1 :
1 | 1 | 1 | 1 | 1 |
ex-2:
1 | 1 | 1 | 1 | 1 |
The no.of possible ways to keep 5 one's in password = 8C5 = 56
The no.of possible ways possible ways to keep remaining 3 characters = 61*61*61 [ since 1 is not concerned here and we may keep any character from remaining 61 characters at each digit] By product rule:
Total No.of passwords that contains exactly 5 ones = 56 * 61 * 61 * 61 = 56*61^3
ii) No.of passwords will exactly use 4 two's
Regardless order,
2 | 2 | 2 | 2 |
The no.of possible ways to keep 4 two's in password = 8C4 = 70
The no.of possible ways possible ways to keep remaining 4 characters = 61*61*61*61 [ since 2 is not concerned here and we may keep any character from remaining 61 characters at each digit]
By product rule:
Total No.of passwords that contains exactly 4 two's = 70 * 61 * 61 * 61 * 61 = 70*61^4
iii) No.of passwords will use exactly one Z(capital)
The no.of possible ways to keep one Z in password = 8C1 = 8
The no.of possible ways to keep remaining 7 characters = 61^7 [ since Z(capital) is not concerned here and we may keep any character from remaining 61 characters at each digit]
By product rule:
Total No.of passwords that contains exactly one Z = 8 * 61 * 61 * 61 * 61 * 61 * 61*61 = 8 * 61^7
The Total No.of passwords will use exactly 5 one's, 4 two's and one Z = (56 * 61^3) + (70*61^4) + (8*61^7)