How many five digit numbers can be formed that are both odd and less than $40,000$ with the set $\{2,3,4,5,6\}$

combinatoricspermutations

I have to find how many possible five digit numbers which are both less than 40,000 and odd can be made with the set $\{2,3,4,5,6\}$ by using each number once only .

So far I have noted that there are only two possible choices for the first digit; $2,3$

And only two possible choices for the last digit; $3,5$

Hence, by using dashes to represent the possible number of choices for each corresponding digit:

$$\underline{2} \space \underline{}\space \underline{}\space \underline{}\space \underline{2}$$

Filling in the remaining three middle digits:

$$\underline{2} \space \underline{3}\space \underline{2}\space \underline{1}\space \underline{2}$$
$$2*3*2*1*2=24$$
However I know this is incorrect, I am a bit confused on how to deal with the fact that both the first digit and the last digit have an overlapping choice of the number $3$, I have tried to split it into two cases with one case where the first digit is $2$ and the other case where the first digit is $3$ but it

How would I go about breaking down this problem logically and solving it?

Best Answer

Assuming you cannot repeat digits...

Case 1: the first digit is a 2.

There are 2, candidates for the last digit, and 6 ways to fill the remaining digits.

12 arrangements under this condition.

Case 2: the first digit is a 3.

The last digit is a 5. There are still 6 ways to fill the remaining digits.

$6+12 = 18$