The correct option is B 51
a) If the first place is 8:
The other 3 places can be filled in 32 =27 ways (since there are 3 distinct digits).
There is one number 8555 and one number 8888 which are not possible in this case since we do not have those many 5′s and those many 8′s.
Thus, there are 27−2=25 numbers.
b) If the first place is 9:
The other 3 places can be filled in (9) 3 *3 *3 = 27 ways (since there are 3 distinct digits).
There is one number 9555 which is not possible in this case since we do not have those many 5′s.
Thus, there are 27−1=26 numbers.
Thus, the answer =25+26=51.
Hence, (A) is correct.