My friends invited me home to play the game of Secret Santa, where we are supposed to draw a lot & play the role of 'Santa' for a friend in the group.
So, we write all our names and pick a name randomly. If any of us ends up having their own name picked, then we reshuffle and pick names all over again (the rationale being that one can not be one's own Santa).
There are seven of us while playing so I thought of the final 'Santa-allocation' as a permutation of (1:7) onto itself, with some restrictions.
I would like to invite various ideas about how we could use Mathematica in particular or any programming language or even an algorithm to:
- List/print out ALL the 'valid' Santa-allocations
- Is scalable as the number of friends playing 'Secret Santa' grows