# A combinatorics problem I can't quite understand

A pizzeria offers 777 types of pizza and 3 types of soda. Mary goes there everyday for lunch, always buying one slice of pizza and one soda. However, she never gets exactly the same thing on two consecutive days (that is, each time, either the drink or the pizza (or both) is different from what she had yesterday).

In how many ways can she plan her lunch for the next 15 days if today she tried a different pizzeria and did not like that place at all?

Answer: approximately $3.240 × 10^{ 50 }$ (but you should try to find the exact formula, not an approximation).

I'm not sure how to proceed with this question. The caveat in the second part of the question, that Mary tries a different pizzaria, makes no sense to me. My intuition is to calculate what the permutation of what it would look like if Mary just switched up pizza slices (which I think would be [777 * 776 * 775 * 777 * 776 * 775 * 777 * 776 * 775 * 777 * 776 * 775 * 777 * 776 * 775], though maybe the pattern would be 777 * 776 * 775... instead?), the permutation of Mary switching up types of soda [3 * 2 * 1... for all 15 days, though again I wonder if it would be 3 * 2 * 3) or maybe I should do a permutation that combines the two? I don't even know how to begin to think about this question. I added up the permutations above but I'm shy of the stated answer. Any insights would be most welcome.

• The "caveat" implies that whatever lunch she had today doesn't restrict her choices tomorrow, since it came from a different pizzeria. – Micapps Jun 15 '16 at 14:43

Mary has $777 \cdot 3=2331$ choices for the first day and $2330$ choices each day after that because this day has to be different from the last. This would give $2331 \cdot 2330^{14} \approx 3.24\cdot 10^{50}$ choices. The point of the other pizzeria is to say that she didn't eat here today and has the $2331$ choices tomorrow.
Notice that there are $777\times 3 = 2331$ possible lunches. So Mary must select 15 of them, and then decide in which order to have them. So there are ${2331 \choose 15} \times 15! = \frac{2331!}{2316!}$ ways to plan the lunches. Plugging this in to a computer, this is exactly: $721554522956870749367491575069940819296530824826880000\approx 7.2\cdot 10^{53}$
• This is not correct. She is allowed to have the same lunch on two different days as long as the days are not consecutive. The numeric answer is also too large. Alpha gets $\frac {2331!}{2116!} \approx 3.12 \cdot 10^{50}$ – Ross Millikan Jun 15 '16 at 14:39