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= 265 =11881376
possible passwords with 0 a's = 255=9765625
possible passwords with 1 a = 5C1 * 254=1953125
(no of ways a can be placed in 5 places = 5C1 and other 4 places can be filled by other 25 alphabets in 254 ways)
required possible way = 265-255 - 5* 254
=162626
if we use way 1 :
No of 5 letter passwords using two a's= 5C2 * 253=156250
No of 5 letter passwords using three a's= 5C3 * 252=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.