For a certain alarm system, each code is comprised of 5 digits, but no digit can be used more than twice. How many codes can be made?	Choose one:
A) 30240	B) 60480	C) 91440	D) 98240	E) 101040

Rationale: case 1 : all digits distinct select 5 digits out of 10 in 10 c 5 ways and arrange them in 5 ! ways which gives us 10 c 5 x 5 ! = 30240 case 2 : two digits are same , other 3 are distinct e . g . 45722 select a digit which is to be repeated in 10 c 1 ways , select other 3 digits in 9 c 3 ways and arrange them in 5 ! / 2 ! ways to get 10 c 1 x 9 c 3 x 5 ! / 2 ! = 50400 ways case 3 : two digits repeated and one other digit e . g . 33448 select 2 digits to be repeated in 10 c 2 ways , select the single digit in 8 c 1 ways and arrange them all in 5 ! / 2 ! . 2 ! ways to get 10 c 2 x 8 c 1 x 5 ! / 2 ! . 2 ! = 10800 sum of all = 30240 + 50400 + 10800 = 91440 ways ans : c
Answer: C