2

I have researched this site and find several secret Santa related questions but none that I can find that relates to couples. If there are three couples (6 people) and no one can draw their own name or the name of their significant other, how many ways can this be done?

Thanks in advance.

Steve
  • 21
  • 1
  • 4
  • 1
    I don't doubt your search, but I do think there have been some secret santa questions including couples which you might be interested in (it's not the same as this question so as far as I can tell your question isn't a duplicate). http://math.stackexchange.com/questions/85470/ http://math.stackexchange.com/questions/73341/ It would be nice if you could offer your own attempts at answering the question though. – Dan Rust Dec 01 '13 at 23:05
  • Presumably, each name must be drawn exactly once. – Ben Grossmann Dec 01 '13 at 23:18
  • Thanks for the comments. I still have yet to find an answer. I am not very skilled at combinatorics. My first thought was to calculate the number of permutations as order would show the direction of gift giving (30) and subtract out permutations of couples giving gifts (6) which leaves us with 24 possibilities. But this is clearly an incorrect answer. Looking into the problem more it seems to involve derangements which I do not understand very well. And from what I've read the derangement examples are slightly different than my problem because they don't look at couples. Please help. – Steve Dec 02 '13 at 12:28
  • The answer here http://math.stackexchange.com/questions/73341/whats-the-general-expression-for-probability-of-a-failed-gift-exchange-draw was already mentioned by Daniel Rust. It uses generalized derangements and specifically deals with couples. –  Dec 02 '13 at 14:50
  • Anyway with only 3 couples, it is easiest to do a brute force calculation by hand. –  Dec 02 '13 at 14:54

3 Answers3

0

I wrote up this algorithm and tested in Maxima. It takes as arguments n for number of total people participating in secret santa and k couples.

It is using inclusion/exclusion with forbidden positions. https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle

$$ \sum_{i=0}^{n}{{\left( -1\right) }^{i}}\cdot \left( n-i\right) !\cdot \sum_{j=0}^{\frac{i}{2}}{{2}^{j}}\cdot \begin{pmatrix}k\cr j\end{pmatrix}\cdot \sum_{p=0}^{k-j}{{2}^{2\cdot p}}\cdot \begin{pmatrix}k-j\cr p\end{pmatrix}\cdot \begin{pmatrix}n-2\cdot k\cr i-2\cdot j-p\end{pmatrix} $$

Andy
  • 1
0

Drawing names for secret santa is equivalent to permutating (rearranging) the names, against a list of the names. Let 1,a ; 2,b ; 3,c be the 3 couples. Under your conditions, 1,a,2,b,3,c; must be rearranged such that the (original) positions of 1 and a should contain neither of 1 and a, that of 2 and b should have neither of 2 and b, and those of 3 and c should be filled with neither of 3 and c.

  • If 1 and a occupy the (original)positions of 3 and c, 2 and b can be given positions in 2 ways. So, 3 and c have to occupy the positions 2 and b. This accounts for 2.2.2 = 8 ways.
  • If 1 and a occupy the positions 2 and b, 2 and b have to be both in the places of 3,c. Now, 3 and c can be positioned in 2 ways. This accounts for 2.2.2 =8 ways.
  • If 1 and a occupy positions such that one of them is assigned a place of 3,c and the other has a place in 2,b, 2 and b can be placed in 4 ways(the other 2 ways are not allowed since both the positions 3,c have to be filled before placing 3 and c).Now, 3,c can be placed in 2 ways. There are 4.4.2 = 32 ways under this.

Hence, there are 48 ways in total.

Akshara
  • 80
  • Unfortunately, this is the wrong answer. –  Dec 02 '13 at 15:42
  • why is it wrong? do you see a flaw in the counting? – Akshara Dec 03 '13 at 09:20
  • The correct answer is 80. –  Dec 03 '13 at 13:17
  • I agree, why is it wrong. The sage program list 10. Why is this wrong? Why is 80 correct? – Steve Dec 04 '13 at 03:18
  • No, why is my answer wrong. I'm asking for any mistake you see in my logic. – Akshara Dec 04 '13 at 10:54
  • I don't see any mistake in your logic because I didn't read your solution. If you want someone to go through it in detail and find your error for you, I suggest you post it as a separate problem. Good luck! –  Dec 06 '13 at 04:47
0

Suppose that the couples are Adam and Alice, Bob and Brenda, and Cathy and Charles. If you just want the answer, you can calculate it online with Sage. Open a notebook and type

D = Derangements(['A','A','B','B','C','C'])

D.cardinality()

and click "evaluate". The answer is 10.

You can, of course, choose different numbers of couples. You could also throw in singles, triples, etc.


If you want a list of them, then evaluate

D.list()

For instance, the entries in ['B','B','C','C','A','A'] are the first letter in the names drawn by Adam, Alice, Bob, Brenda, Cathy, and Charles respectively.

There are 8 ways to assign names to each arrangement, so the number of named permutations is 80. This result also follows from the formula in joriki's answer here. We have $$\int_0^\infty (2-4x+x^2)^3 e^{-x}\,dx=80. $$


Update: The Sage program that I suggested outputs a list of ten permutations, for example: ['B', 'B', 'C', 'C', 'A', 'A']. What does this mean, and how come the answer to this question is sometimes 10 and sometimes 80?

First of all, we may as well suppose that the six people line up in alphabetical order to randomly choose a name. We interpret ['B', 'B', 'C', 'C', 'A', 'A'] as follows:

$$\begin{array}{c||c|c|c|c|c|c} \text{Chooser} &\text{Adam}&\text{Alice}&\text{Bob}&\text{Brenda}&\text{Cathy}&\text{Charles}\\ \hline \text{First letter in}&\text{B}&\text{B}&\text{C}&\text{C}&\text{A}&\text{A}\\ \text{name chosen}\\ \end{array}$$

There are a total of ${6!\over 2!\,2!\,2!}=90$ possible permutations, and exactly 10 of them (including the one above) correspond to the situation where nobody gets their own name or the name of their partner. This is why the Sage program returns the answer 10.

Notice that the table above does not tell us what person chose which name, as
this information is not needed. All we need to know is that everyone chose a name whose first letter differs from the first letter of their own name. The good permutations are those with no $A$s in the first two spots, no $B$s in the second two spots, and no $C$s in the final two spots.

Suppose, though, that we want all that information anyway. One possible outcome consistent with the example above is:

$$ \begin{array}{c||c|c|c|c|c|c} \text{Chooser} &\text{Adam}&\text{Alice}& \text{Bob}& \text{Brenda}& \text{Cathy}& \text{Charles}\\ \hline \text{Name chosen}&\text{Bob}&\text{Brenda}&\text{Charles}&\text{Cathy}&\text{Adam}&\text{Alice}\\ \end{array} $$

There are a total of $6!=720$ "named" permutations and exactly 80 of them correspond to the situation where nobody gets their own name or the name of their partner.

You see that every permutation of "first letters" corresponds to exactly $2!\times 2!\times 2!=8$ permutations of "names". That's because you could write, in either order, "Adam, Alice" or "Alice, Adam" for the $A$s. That is, you have two ways to write in the A-names. Similarly there are two ways to write in the B-names and two ways to write in the C-names. There are eight times as many named permutations as un-named permutations.

So what is the right answer: 10 or 80? Well, that's up to you. An argument could be made for either choice, but once you know one of them, it is easy to calculate the other one.

  • @ Byron: Thanks for taking the time to help out. I still am a bit lost. Looking the at the article you linked me to it asks about the probabilities and doesn't explicitley say how to calculate the number of possibilities (at least not that I can tell - maybe I just don't understand it). Using Sage workbook I get: [[2, 2, 3, 3, 1, 1], [2, 3, 1, 3, 1, 2], [2, 3, 1, 3, 2, 1], [2, 3, 3, 1, 1, 2], [2, 3, 3, 1, 2, 1], [3, 2, 1, 3, 1, 2], [3, 2, 1, 3, 2, 1], [3, 2, 3, 1, 1, 2], [3, 2, 3, 1, 2, 1], [3, 3, 1, 1, 2, 2]]. We can't have people giving themselves gifts. Is this right? Sorry, I am trying. – Steve Dec 02 '13 at 16:23
  • I think you are confusing the position and the numbers. Nobody is buying gifts for themselves. I have updated my answer with letters and this may be easier to understand. –  Dec 02 '13 at 16:39
  • It has been a while since I have been in a math class, so I am very rusty. I understand the general concpet of a derangement (especially in context of the hat problem). I guess I don't understand how derangements apply to this situation. Could you maybe shed some light? I know this is a trival problem, it's quite frustrating for me. – Steve Dec 02 '13 at 17:03
  • Do you understand my new solution with letters? –  Dec 02 '13 at 17:23
  • No. [B, B, C, C, A, A], for example, not sure what this means. I took to to mean that B give to B and C to C and A to A. But that's not right. I then thought that maybe the positions were originally [A,B,C,D,E,F] and so A gives to B and B to B, but that's not right either. – Steve Dec 02 '13 at 17:40
  • The entries in ['B','B','C','C','A','A'] are the first letter in the names drawn by Adam, Alice, Bob, Brenda, Cathy, and Charles respectively. So Adam draws a name that starts with B, Alice draws a name that starts with B, etc.. –  Dec 02 '13 at 17:47
  • Stupid question: Why can't we use [A,B,C,D,E,F]? – Steve Dec 02 '13 at 18:40
  • You can do anything you like. But if the people are named A,B,C,D,E, and F who are the couples? –  Dec 02 '13 at 18:41
  • OK. I think I understand. The couples are [1,1,2,2,3,3] which is why you used numbers, right? So, [2, 2, 3, 3, 1, 1] would be someone from couple 1 chosing someone from couple 2, in the first element, correct? I think I understand if this is correct. Thank you SO MUCH! Is there a generalized formula to find out the number of possibilities? I know using your code in SAGE that in this case there is 10. – Steve Dec 02 '13 at 19:13
  • I see from searching online that in general the number of derangements can be counted by n!/e (round to nearest integer). If this is the case, if I use 6! (for six people) or 3! (for 3 couples), either way it doesn't get me to 10 (which is the answer from SAGE). Is there a formula that can let me know the number of possibilities? – Steve Dec 02 '13 at 19:52
  • @Steve The problem with couples is not solved with derangements. It is solved with generalized derangements. The solutions you found on the internet are for a different problem. –  Dec 02 '13 at 20:18
  • @Steve The integral in my solution is the formula that solves the derangement problem for couples. –  Dec 02 '13 at 20:19
  • Byron, your answer above says 80 but using sage it gives me 10 (using the code you provided). Why the difference? – Steve Dec 03 '13 at 03:12
  • Each "couple arrangement" corresponds to eight "name arrangement"s. Which of these answers will be useful for you depends on what permutations you consider. Is it all 720 permutations of names, or only the 90 permutations of "couple" information? –  Dec 03 '13 at 03:30
  • It might help if you could tell me why you want the answer to this question, and how much you know about permutations. In fact, this information ought to be part of your original posting. –  Dec 03 '13 at 03:31
  • Byron: The need is simply curiosity. I was pulled into a secret santa situation and the question came up of how many different ways can the gift exchange occur. I am not by any means an proficient at combinatorics. I have a good grasp of permutations and combinations; as well as a little bit of understanding of multisets and arrangements around a circle. Derangements and this problem I do not understand at all. I am trying to understand how to calculate this type of problem. Using the code from SAGE it gave me a result of 10, and looking at the answers above, 10 isn't there. – Steve Dec 03 '13 at 17:39
  • I prob. did something wrong. I really am trying to understand and learn. I really have researched and tried to figure this out. I am very thankful for your assistance in navigating this. – Steve Dec 03 '13 at 17:40
  • I appreciate your effort in trying to understand my solution. Your background seems strong, and I have not been successful in pinpointing your difficulty. I wrote a little blurb about why a combinatorial question might have two different, legitimate answers which I've posted to my website. See if that helps.

    http://www.stat.ualberta.ca/people/schmu/preprints/ambiguity.pdf

    –  Dec 04 '13 at 15:45