Permutation with $n$ repetitions of each element? Here's the problem:
A man has dinner 5 days a week, Monday to Friday, choosing from 10 restaurants. Thus, there are $$10\times9\times8\times7\times6$$
ways that he can have dinner if no repetitions are allowed.
Now, what if he can eat at each restaurant at most twice?
My first idea is that there are $\binom{20}{5}$ ways to pick the restaurants, where each of the 20 is a chance for the restaurant to get picked. Then if you want to permute them, you have $\binom{20}{5} \times 5!$ ways the man can eat dinner that week, but this is overcounting since for example the cases of eating at restaurant #1 on Monday and Wednesday, and at restaurant 1 on Wednesday and Monday are being counted as separate cases when they should be the same.
Is there a better approach to solve this problem?
 A: three methods all give the same answer 91440
method 1
$10^5$ - number of ways to go to any restaurants any time
$10 * C^3_5 * 9 * 9 + 10 * C^4_5 * 9 + 10$ - number of ways to choose restaurants such that there is one restaurant chosen at least 3 times.
The answer is then $10^5 - 10 * C^3_5 * 9 * 9 - 10 * C^4_5 * 9 - 10 = 91440$
method 2
$10 * 9 * 8 * 7 * 6$ - choosing restaurants each at most one time
$C^2_5 * 10 * 9 * 8 * 7$ - choosing restaurants such that there is exactly one visited twice, and three others one time
$(C^2_5 * 10 * 9 * C^2_3 * 8) / 2$ - choosing restaurants such that there are two restaurants both visited twice and, one more restaurant visited once.
thus, answer is $10 * 9 * 8 * 7 * 6 + C^2_5 * 10 * 9 * 8 * 7 + (C^2_5 * 10 * 9 * C^2_3 * 8) / 2 = 91440$
method 3
numeric gives 91440: https://paste.ofcode.org/VyS2NMg6b6VyNNBBAccahw
A: Since several solutions have already been posted using various methods, here, for the sake of completeness, is a solution using exponential generating functions.  If you are not familiar with generating functions, you may find relevant resources in the answers to this question: How can I learn about generating functions?
The exponential generating function for the number of ways to visit $10$ restaurants $n$ times, with no restaurant visited more than twice, is
$$f(x) = \left( 1 + x + \frac{1}{2!} x^2 \right)^{10}$$
We are interested in the case $n=5$.  Using $[x^n]$ to denote the "coefficient of $x^n$" operator and applying the Binomial Theorem,
$$\begin{align}
[x^5] f(x) &= [x^5] \sum_{i=0}^{10} \binom{10}{i} \left( x + \frac{1}{2!} x^2 \right)^i \\ 
 &= [x^5] \sum_{i=0}^{10} \binom{10}{i} x^i \left( 1 + \frac{1}{2!} x \right)^i \\ 
&= \binom{10}{3} [x^2] \left( 1 + \frac{1}{2!} x \right)^3 + \binom{10}{4} [x^1] \left( 1 + \frac{1}{2!} x \right)^4  + \\ &\qquad \binom{10}{5} [x^0] \left( 1 + \frac{1}{2!} x \right)^5 \\
&= \binom{10}{3} \binom{3}{2} \frac{1}{2^2} + \binom{10}{4} \binom{4}{1} \frac{1}{2} + \binom{10}{5} \\
&= 762
\end{align}$$
(This computation is really easy if you use a computer algebra system to expand the polynomial.)  Since we used an exponential generating function, the answer to our problem is $$5! \cdot [x^5]f(x) = 91440$$
A: As you said, there are $10 \times 9 \times 8 \times 7 \times 6$ ways if no repetitions are allowed.
If one repetition is allowed, then we can either go to one restaurant twice or we can go to two restaurants twice. If we go to one restaurant twice, there are ${5 \choose 2}$ ways to choose the days, so we have ${5 \choose 2} \times 9 \times 8 \times 7$. For the other case, there are $5 \times 10 \times 9 \times {4 \choose 2} \times 8$ ways.
Adding all of these ways gives a total of $56880$ ways.
A: Having dinner at a restaurant atmost twice= no restaurant repeated + exactly 1 restaurant visited twice + exactly 2 restaurants visited twice
$\implies$Total no. of ways= $\binom{10}{5}5! +\binom{10}{4}\binom{4}{1}\frac{5!}{2!}+\binom{10}{3}\binom{3}{2}\frac{5!}{2!2!}$
