Answer: (a) \(1080\); (b) \(2160\).
Answer: (a) \(1080\); (b) \(2160\).
(a) The number must be less than \(60000\), so the first digit can only be \(1,2,3,4\) or \(5\).
It must end in a multiple of \(3\), so the final digit is either \(3\) or \(6\).
If the final digit is \(6\), the first digit can be any of \(1,2,3,4,5\). After choosing the first and last digits, there are \(6\) choices, then \(5\) choices, then \(4\) choices for the middle three positions. This gives
\(5\times6\times5\times4=600.\)
If the final digit is \(3\), the first digit can be \(1,2,4\) or \(5\). This gives
\(4\times6\times5\times4=480.\)
Therefore the total number of codes is
\(600+480=1080.\)
(b) The number must be even, so the final digit is \(2,4,6\) or \(8\), and the first digit must still be less than \(6\).
First consider final digit \(6\) or \(8\). There are \(2\) choices for the final digit. The first digit can be any of \(1,2,3,4,5\), so there are \(5\) choices. The middle three positions can then be filled in
\(6\times5\times4\)
ways. This gives
\(2\times5\times6\times5\times4=1200.\)
Now consider final digit \(2\) or \(4\). There are \(2\) choices for the final digit. The first digit can be one of \(1,3,5\) or the remaining one of \(2\) and \(4\), so there are \(4\) choices. The middle positions can again be filled in \(6\times5\times4\) ways. This gives
\(2\times4\times6\times5\times4=960.\)
Therefore the total is
\(1200+960=2160.\)