My wife has five siblings with something like a 15 year spread from oldest to youngest. That’s a lot of adult siblings to buy Christmas presents for when you’re the youngest in high school or college, so when the youngest were younger, we decided to do a Secret Santa exchange at Christmas. Siblings and significant others (who’ve been around for a while) play along, and everybody draws a name and gets a gift for one among the group. It’s nice because instead of stressing over being more frugal about gifts for a whole bunch of people, we can try to think about one person and get something thoughtful and with less concern about balancing the old budget.
Because I write code for a living, I volunteered years ago to automate this so that it could be truly random and truly secret, and also to impose certain necessary restrictions. For example, I’ll already be getting gifts for my wife, so I shouldn’t get to draw her name in the Secret Santa drawing. As we’ve added more significant others to the mix over the years, the restrictions have become more, well, restrictive.
A couple of years ago, I found some bugs in my code that made it sort of surprising that we’d never had a big snafu. It was possible (though unlikely) for a person to get drawn twice, if I recall correctly. The code does record who drew whom, but I use some simple reversible encryption to obscure the data so that even if I view the data, I can’t tell who drew whom without jumping through some hoops to decrypt the data. It looks like this:
mysql> select id, selected, selectee, spouse from people;
+----+----------+----------------------------+--------+
| id | selected | selectee | spouse |
+----+----------+----------------------------+--------+
| 1 | 1 | Šð·4Ì9ΟO*Ú | 2 |
| 2 | 1 | àßúœÉsë1‘™ | 1 |
| 3 | 1 | 4èàÿ|tB Ýá)Öœ– | 0 |
| 4 | 1 | Ñkdt»Ù޼üHÚ©z% | 8 |
| 5 | 1 | ã,oŒô-ârvó-b | 11 |
| 6 | 1 | (Ûk;Öîì(:vû^ƒ€ | 13 |
| 7 | 1 | Éãä“úHàücLݦÙ5* | 12 |
| 8 | 1 | åÐï÷¡I•Ò0Ñ´Y | 4 |
| 12 | 1 | Á/ðE™©„“Ü% | 7 |
| 11 | 1 | ®§V$]n1½ŽÂÎw«y | 5 |
| 13 | 1 | †Ì>í…²”[Å*çƒ@© | 6 |
+----+----------+----------------------------+--------+
So even if someone had in the past been selected to receive more than one gift, it wouldn’t have been readily obvious, and it would have been tricky to fix, since the code fires off an email to everybody letting them know whose name they were assigned.
So say Joe and Bob both draw Mary. They’d each get an email letting them know to get a gift for Mary, and unless I snooped a bit, I wouldn’t notice, and even if I did notice, I’d have to regenerate the assignments for the whole group, which’d result in confusion. Inevitably somebody would wind up looking at the older email, and we’d have chaos. Luckily, we had no snafus, and I fixed the bug.
I have occasionally played with the idea of mixing things up a bit, though. For example, I think it’d be fun to make everybody get me a gift. Or, to put a less actually selfish spin on it, it’d be sort of fun to make everybody get me a gift and then in turn get everybody else a gift. I’m far too lazy for that, though, so once again we’ve got a random selection (within the usual constraints), and hopefully everybody winds up being happy with it.