How many $5$-digit numbers can be made from digits in the number $75226522$? I'm having troubles with this one:
How many $5$-digit numbers can be made from digits in the number $75226522$ ?
So there is: one seven, one six, two fives, and four twos in that number.
So I guess I need to use combination with repetition but I'm having trouble with understanding this.
I know how many $8$-digit numbers there are: $$ \frac{8!}{4!2!}$$ But I'm clueless in $5$-digit case
 A: Add up the following:


*

*The number of ways to rearrange $\color\red{2222}\color\green{ 5}\color\orange{ }\color\lightblue{ }$, which is $\frac{5!}{\color\red{4!}\color\green{1!}\color\orange{  }\color\lightblue{  }}= 5$

*The number of ways to rearrange $\color\red{2222}\color\green{  }\color\orange{6}\color\lightblue{ }$, which is $\frac{5!}{\color\red{4!}\color\green{  }\color\orange{1!}\color\lightblue{  }}= 5$

*The number of ways to rearrange $\color\red{2222}\color\green{  }\color\orange{ }\color\lightblue{7}$, which is $\frac{5!}{\color\red{4!}\color\green{  }\color\orange{  }\color\lightblue{1!}}= 5$

*The number of ways to rearrange $\color\red{ 222}\color\green{55}\color\orange{ }\color\lightblue{ }$, which is $\frac{5!}{\color\red{3!}\color\green{2!}\color\orange{  }\color\lightblue{  }}=10$

*The number of ways to rearrange $\color\red{ 222}\color\green{ 5}\color\orange{6}\color\lightblue{ }$, which is $\frac{5!}{\color\red{3!}\color\green{1!}\color\orange{1!}\color\lightblue{  }}=20$

*The number of ways to rearrange $\color\red{ 222}\color\green{ 5}\color\orange{ }\color\lightblue{7}$, which is $\frac{5!}{\color\red{3!}\color\green{1!}\color\orange{  }\color\lightblue{1!}}=20$

*The number of ways to rearrange $\color\red{ 222}\color\green{  }\color\orange{6}\color\lightblue{7}$, which is $\frac{5!}{\color\red{3!}\color\green{  }\color\orange{1!}\color\lightblue{1!}}=20$

*The number of ways to rearrange $\color\red{  22}\color\green{55}\color\orange{6}\color\lightblue{ }$, which is $\frac{5!}{\color\red{2!}\color\green{2!}\color\orange{1!}\color\lightblue{  }}=30$

*The number of ways to rearrange $\color\red{  22}\color\green{55}\color\orange{ }\color\lightblue{7}$, which is $\frac{5!}{\color\red{2!}\color\green{2!}\color\orange{  }\color\lightblue{1!}}=30$

*The number of ways to rearrange $\color\red{  22}\color\green{ 5}\color\orange{6}\color\lightblue{7}$, which is $\frac{5!}{\color\red{2!}\color\green{1!}\color\orange{1!}\color\lightblue{1!}}=60$

*The number of ways to rearrange $\color\red{   2}\color\green{55}\color\orange{6}\color\lightblue{7}$, which is $\frac{5!}{\color\red{1!}\color\green{2!}\color\orange{1!}\color\lightblue{1!}}=60$


Hence the total number of ways is $5+5+5+10+20+20+20+30+30+60+60=265$.
A: Number with no 5's, so either three or four 2's: $$\frac{5!}{3!} + 2 \times \frac{5!}{4!}.$$
Number with one 5, so either two, three, or four 2's: $$\frac{5!}{2!} + 2 \times \frac{5!}{3!} + \frac{5!}{4!}.$$
Number with two 5's, so either one, two, or three 2's: $$\frac{5!}{2!} + 2 \times \frac{5!}{2! 2!} + \frac{5!}{2! 3!}.$$
Now adding these three numbers together should give the right result. 
