I have a problem regarding how many passcodes can be generated with these parameters:
- Five digit code
- Two of the digits are odd
- Zeros can't be used
- Digits can be repeated
One approach I tried was to do $5 \cdot 5 \cdot 4 \cdot 4 \cdot 4$ and then multiply by how many ways the digits can be rearranged, but that doesn't work because sometimes the digits will repeat.
I could break it down into cases such as all no repeats multiplied by how many ways the digits can be rearranged ($5 \cdot 4 \cdot 4 \cdot 3 \cdot 2 \cdot 5!$), then look at only the odd digits are repeated ($5 \cdot 1 \cdot 4 \cdot 3 \cdot 2 \cdot 5!/2!$), etc.
I guess my question is if there is a solution that is more elegant than the case-by-case solution.
Your $5\cdot 5 \cdot 4 \cdot 4 \cdot 4$ would be the number of codes with the odd numbers first and second. Now multiply by the number of ways to choose the locations of the odd digits. You are keeping the odd and even digits in the order you generated them.