number of ways of inviting friends for dinner

I have 3 friends and I want to invite them for dinner. If there are n ways of inviting my friends in such a way that only one friend is invited on a night and I do this for 6 consecutive nights, then find n. Also a friend can be invited for at the most 3 times.

I did it the following way:
Since any friend can be invited for a max of 3 times, therefore we can consider that there are 9 friends who can come only once. So answer must be 9 permute 6.

However the correct answer is 510. What did I do wrong?

• Maybe a different formulation will help. Suppose you have 3 red balls, 3 blue balls, and 3 green balls. How many ways can you put them into 6 baskets (one in each basket). – Jemmy Dec 20 '13 at 17:38
• @jeremy 9 choose 6 ? – Shaurya Gupta Dec 20 '13 at 17:40

These are the possible ways you choose to invite your friends and the total count

You can invite any two friends, three nights each and this you can do three number of ways $$3*{6\choose 3}*{3\choose3} = 60$$

You can invite any friend three times, second friend 2 times and third friend one time. This you can do 6 number of ways. $$6*{6\choose3}.{3\choose2}.{1\choose1} = 360$$

You can invite 1st friend two times, second friend two times and third friend two times. This you can do 1 number of ways: $${6\choose2}*{4\choose2}*{2\choose2} = 90$$

Adding all of them and we obtain the answer as $\boxed{510}$

Thanks

Satish

If I understand correctly what you mean by "9 friends" and "9 permute 6," it sounds like you are in effect turning each of your three friends into triplets and then inviting a different "person" each night. I.e., if your friends are Andy, Bob, and Carl, then you imagine them as Andy1, Andy2, Andy3, Bob1, Bob2, Bob3, Carl1, Carl2, and Carl3 (henceforth abbreviated $A1,A2$, etc.), in which case you can now invite them in an order such as $(B2,C2,B1,A2,A3,A1)$ for a total of $9\times8\times7\times6\times5\times4$ ways.

The problem with this is that it counts, for example, $(B2,C3,B1,A3,A1,A2)$ as different from $(B12,C2,B1,A2,A3,A1)$, but of course they are the same as far as your actual friends, $(B,C,B,A,A,A)$, are concerned. So if you try to go this route, you need to assume that you invite the "first" among each set of triplets first, the second second (if at all), and the third third, and that re-complicates the counting.

I'm only answering (or trying to answer) the question "What did I do wrong?" Do you want to take another stab at the problem, or do you want some additional help?

• So that is what I did wrong, when I calculated the permutation, I double counted the same friend since A2, A3 and A1 are all A! – Shaurya Gupta Dec 21 '13 at 9:15