How many $6$ digit numbers can you make with the numbers $\{1, 2, 3, 4, 5\}$ so that the digit $2$ appears at least 3 times? I can't seem to understand.  
I thought about it this way. We take a first example:  
$222aaa$ for each blank space we have $5$ positions, so in this case the answer would be $125$ ($5 \times 5 \times 5$) numbers.
Now the position of the twos can change so we calculate the numbers for that taking this example:  
$222aaa$ and the possibilities for this are the number of ways you can arrange $6$ digits ($6!$) and divide by repetitions so divided by $2 \cdot (3!)$ so answer $= 20$
So final answer should be $125 \cdot 20 = 2500$. But this answer is wrong and I don't understand why.
 A: Let ${S_n}$ be the number of ways you can have the  digit 2 appears ONLY 3, 4 ,5 , and 6 times where $ n = 3 , 4 , 5, 6$.  We can then add $S_3 + S_4 + S_5 + S_6$ to get our answer.  To find $S_n$, note that there are ${6}\choose {n}$ ways of arranging the 2's, and for each of those there are $6-n$ places for the other digits; however, we will not include 2 in these other digits or else we will end up overcounting.  So we $4^{(6-n)}$ different numbers we can make.
So $S_3 =$ ${6}\choose{3} $$4^3$ 
$S_4 =$ ${6}\choose {4}$$4^2$
$S_5 =$ ${6}\choose{5} $$4 = 24$
$S_6 =$ ${6}\choose{6}$ $=1$
Now just add these numbers up.
A: 
How many six-digit numbers can be formed using numbers from the set $\{1, 2, 3, 4, 5\}$ with replacement if the digit $2$ must appear at least three times?

There are $\binom{6}{k}$ ways of choosing exactly $k$ positions for the $2$'s and $4^{6 - k}$ ways to fill the remaining $6 - k$ positions with a number different from $4$.  The number of six-digit numbers that can be formed using numbers from the set $\{1, 2, 3, 4, 5\}$ in which the digit $2$ appears at least three times can be found by adding the number of outcomes in which the digit $2$ appears exactly three times, exactly four times, exactly five times, and exactly six times
$$\sum_{k = 3}^{6} \binom{6}{k}4^{6 - k} = \binom{6}{3}4^3 + \binom{6}{4}4^2 + \binom{6}{5}4^1 + \binom{6}{6}4^0 = 1545$$
(as Dionel Jaime found) or by subtracting the number of outcomes in which the digit $2$ appears fewer than three times from the total number of words that can be formed from the five numbers in the set when those numbers are used with replacement
$$5^6 - \sum_{k = 0}^{2} \binom{6}{k}4^{6 - k} = 5^6 - \left[\binom{6}{0}4^6 + \binom{6}{1}4^5 + \binom{6}{2}4^4\right] = 1545$$

Where did you make your mistake?

By designating three positions for the $2$'s and then filling the remaining three positions with any of the five numbers in the set, you counted cases in which $2$ appears more than three times multiple times.
You counted cases in which the digit $2$ appears four times four times, once for each of the $\binom{4}{3}$ ways you could designate three of the four $2$'s as your three $2$'s.  To see this, observe that you count the number $232422$ four times:
$$\color{blue}{2}3\color{blue}{2}4\color{blue}{2}2$$
$$\color{blue}{2}3\color{blue}{2}42\color{blue}{2}$$
$$\color{blue}{2}324\color{blue}{22}$$
$$23\color{blue}{2}4\color{blue}{22}$$
You counted cases in which the digit $2$ appears five times ten times, once for each of the $\binom{5}{3}$ ways you could designate three of your five $2$'s as your three $2$'s.  You counted cases in which the digit $2$ appears six times twenty times, once for each of the $\binom{6}{3}$ ways you could designate three of your six $2$'s as your three $2$'s.  Notice that 
$$\binom{6}{3}4^3 + \binom{4}{3}\binom{6}{4}4^2 + \binom{5}{3}\binom{6}{5}4^1 + \binom{6}{3}\binom{6}{6}4^0 = 2500$$ 
A: Since you have only $5$ numbers, you can try it making cases

Case $1.$ When there are $3~2's$

$3$ spaces left

Case $1.a)$  When all the three numbers are different 

Total numbers= $4\times 3\times 2=24$
Total permutation=$\frac{6!}{3!}=120$
Total cases=$24\times 120=2880$

Case $1.b)$ When two of three numbers are same

Total numbers=$12$
Total permutation=${6!}{3!2!}=60$
Total cases=$12\times 60=720$

Case 2. When there are $4 ~2's$

$2$ places left

Case $2.a)$ When the two numbers are different

Total numbers=$4\times 3=12$
Total permutation=$\frac{6!}{4!}$
Total cases=$12\times 30=360$

Case $2.b) When the two numbers are same

Total numbers=$4$
Total permutation=$\frac{6!}{4!2!}=15$
Total cases=$4\times 15=60$

Case $3.$ When there are five $2's$

Total cases=$4\times 6=24$

Case $4.$ When there are  six $2's$

Total cases=$1$
Adding all will give $2880+720+360+60+24+1=4045$
