How many 5 letter (lower case) passwords are possible with with at least 2 'a's?
number of ways of filling a box with all letter = 26 and without a = 25.
solution :
way 1:
possible passwords with 2a's , 3a's, 4a's or 5a's.
way 2:
total possible passwords with all lower case alphabets - (0 a's + 1 a's).
following way 2 as its short :
total passwords possible= 26^{5 }=11881376
possible passwords with 0 a's = 25^{5}=9765625
possible passwords with 1 a = 5C1 * 25^{4}=1953125
(no of ways a can be placed in 5 places = 5C1 and other 4 places can be filled by other 25 alphabets in 25^{4} ways)
required possible way = 26^{5}-25^{5} - 5* 25^{4}
=162626
if we use way 1 :
No of 5 letter passwords using two a's= 5C2 * 25^{3}=156250
No of 5 letter passwords using three a's= 5C3 * 25^{2}=6250
No of 5 letter passwords using four a's=5C4 *25=125
No of 5 letter passwords using five a's = 5C5 =1
=156250+6250+125+1 = 162626 answer.