1

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?

max
  • 194
  • 8

4 Answers4

3

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

  • Say "use PIE or give a more general ans. Don't give the solution right away. I'm flagging this ans. to get this to mods attention – RishiNandha Vanchi Dec 23 '19 at 03:58
  • 1
    Thanks for clearing that up! One comment, I think for method 2 the first line should be $10 * 9 * 8 * 7 * 6$ – max Dec 23 '19 at 04:53
2

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$$

awkward
  • 14,736
0

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.

Toby Mak
  • 16,827
  • Should it be $10{5 \choose 2} \times 9 \times 8 \times 7$? – max Dec 23 '19 at 03:47
  • Yes, I'm fixing my post now. – Toby Mak Dec 23 '19 at 03:50
  • Why would it be $4 \choose 2$ instead of $3 \choose 2$? – max Dec 23 '19 at 04:06
  • I thought using another method would help. We can choose the restaurant where he does not eat more than once, which gives $10 \times 5$ ways. We can choose one of the repeated restaurants, and we have $4 \choose 2$ because there are 4 places left. Finally, the two spots must be at the same restaurant so there are $8 \times 1$ ways. – Toby Mak Dec 23 '19 at 04:10
  • 1
    Therefore this part of the answer must be correct. This is a good strategy you can use when you want to check an answer. – Toby Mak Dec 23 '19 at 04:13
  • Your reasoning seems right, but govordovsky has shown by simulation that the correct result is 91,440... any thoughts on why? – max Dec 23 '19 at 04:23
0

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!}$