How many sequences of length $3$ can be produced using numbers chosen from $1, 2, 3, 4, 5$ with repetition if $5$ must appear exactly once? Lets say that we have $5$ numbers to choose from ($1,2,3,4,5$), and we want to count the number of ways to make $(x,x,x)$ where $5$ will appear once, and the other two spots will be $1$ thru $4$.
My approach:
I was thinking that we have $\binom{3}{1}$ ways to assign where $5$ will go.
Then I we have to consider two cases:
Case 1: When each spot has a unique number (ex: (5,1,2))
We choose the second spot with $\binom{4}{1} = 4$ ways (we have $4$ numbers to choose from and one spot to put it), and $\binom{3}{1} = 3$ ways to choose the last spot.
Then, we have $\binom{3}{1}\binom{4}{1}\binom{3}{1}$
Case 2: Both of the numbers are the same:
This can be made $\binom{3}{1}\binom{4}{2}$ wasys (where $\binom{4}{2}$ is we have $4$ numbers to choose from and we choose $2$ of them).
Then our final answer is:
$$\binom{3}{1}\binom{4}{1}\binom{3}{1} + \binom{3}{1}\binom{4}{2}$$
Is this the correct way to go about it? I've tried to list out all the combinations, and this answer and all the combinations I've made are not equal. So I am guessing my counting method is incorrect. A second set of eyes on this would be really appreciated!
 A: Your thought process is very good and close to the final answer.

${3 \choose 1}{4 \choose 1}{3 \choose 1} $  correctly finds the number
of ways to select 3 numbers where one is 5 and the other two are
distinct.

${3 \choose 1}{4 \choose 2}$ is slightly wrong. Notice how you said there are 4 numbers to select from and you choose 2 of them. Well if both numbers are the same you would actually only be selecting just one of them resulting in ${4 \choose 1}$ combinations.
Imagine you have 3 empty spots to fill in based on the conditions provided
_ _ _

You fill one of them with a 5:
_ 5 _

Two spots remain. You fill each of them in with the same number, resulting in:
151    252    353   454

We see that there are 4, or ${4 \choose 1}$ possible outcomes in the case the remaining two numbers are not distinct.
Thus, the total number of combinations here is:
${3 \choose 1}{4 \choose 1}{3 \choose 1} + {3 \choose 1}{4 \choose 1}$, or $48$
However, there is a much simpler approach.
Imagine there are 3 spots, one of which we select to put a 5 in. The other two spots have 4 options each (numbers 1-4) Which gives us:
${3 \choose 1}\cdot4\cdot4$, or $48$
