How many four-digit odd numbers, all of digits different, can be formed from the digits 0 to 9, if there must be a 5 in the number? 
How many four-digit odd numbers, all of digits different, can be formed from the digits 0 to 9, if there must be a 5 in the number?

I know that there are 4 different cases where 5 is in the number:
5 _ _ _
_ 5 _ _
_ _ 5 _
_ _ _ 5
The first digit cannot be 0, since it has to be a 4-digit number.

There are special conditions attached to the $\color{red}{\text{first}}$ and $\color{blue}{\text{last}}$ characters, so group into 3 cases:


*

*$5$ first: then for the remaining places there are (choosing the last digit first) $\color{blue}{4}\times 8\times 7 = 224$ options

*$5$ second/third: then for the remaining places there are $\color{blue}{4}\times \color{red}{7}\times 7 = 196$ options for each, so total of $2 \times 196 =392$ for this case.

*$5$ last: then for the remaining places there are $\color{red}{8}\times 8\times 7 = 448$ options


Total options then are: $224+392+448=1064$.
