(i) Digits are not repeated:
The first digit must be 3 or 4 to ensure the number is between 3000 and 5000. This gives us 2 choices for the first digit.
After choosing the first digit, we have 4 remaining digits. We need to choose 3 more digits from these 4, which can be done in:
\(4 \times 3 \times 2 = 24\)
Thus, the total number of ways is:
\(2 \times 24 = 48\)
(ii) Digits can be repeated and the number is odd:
The last digit must be odd, so it can be 1, 3, or 5. This gives us 3 choices for the last digit.
The first digit must be 3 or 4 to ensure the number is between 3000 and 5000. This gives us 2 choices for the first digit.
The middle two digits can be any of the 5 digits (1, 2, 3, 4, 5) and can be repeated. Therefore, there are:
\(5 \times 5 = 25\)
ways to choose the middle two digits.
Thus, the total number of ways is:
\(2 \times 25 \times 3 = 150\)