CompoundPage

Random Pair Generator

The random pair generator starts with eleven names, and because eleven is odd, one pair becomes a trio rather than leaving somebody without a partner.

Separate names with commas. Up to 500.

With people per group: spread the leftover people so sizes differ by at most one, and never leave anyone in a group of one. Off: full groups and a smaller last one. Splitting by number of groups is always even.

5 random groups1: Kai, Grace, Jack | 2: Finn, Dev | 3: Ava, Isla | 4: Ella, Chloe | 5: Ben, Hugo

Group sizes 11 is not a multiple of 2. Dealing groups of 2 would leave one person alone, so they join another group instead.
3, 2, 2, 2, 2
Names read
11 names
Method The whole list is shuffled, then the first 3 go to group 1, the next 2 to group 2, and so on.
Fisher-Yates shuffle, then dealt in order
Equally likely orders 11! = 11 x 10 x ... x 1, and each order comes up with probability exactly 1/11!.
39,916,800
Different ways to form these groups Counting a grouping once regardless of the order inside each group or the order of same-sized groups.
17,325
The groups
GroupSizeMembers
Group 13Kai, Grace, Jack
Group 22Finn, Dev
Group 32Ava, Isla
Group 42Ella, Chloe
Group 52Ben, Hugo

How the Random Group Generator works

Random pairs are groups of two, so the draw is the same shuffle-and-deal as every other group: shuffle the list with Fisher-Yates, then take the names two at a time. What makes pairs their own problem is the odd number.

With an even list there is nothing to decide. Eight people make four pairs, and there are 8! / (2^4 x 4!) = 105 different ways to pair them, all equally likely. The general count for 2k people is (2k - 1) x (2k - 3) x ... x 3 x 1, which grows fast: twenty people can be paired 654,729,075 ways.

With an odd list, someone is left over, and there are only two honest options. The leftover person can join one of the pairs and make a trio: eleven names give four pairs and one group of three, and which pair becomes the trio, and who joins it, is as random as everything else. Or the leftover person is named as the odd one out and has no partner, which suits a rotation: a bye in a round of matches, or someone who sits out this week and is guaranteed a partner next week.

For a gift exchange, random pairs are not quite the same thing as a Secret Santa. A pairing is mutual: if Ava is paired with Ben, Ben is paired with Ava. A Secret Santa is a one-way chain in which nobody draws themselves, and that is a different draw (a random permutation with no fixed points). Pairs work for a swap where partners exchange with each other; for the one-way version, shuffle the list and have each person give to the next name, with the last giving to the first.

There is no option to keep particular people apart or to avoid repeating last week's pairs; constraints like that change the odds, so if a pair should not happen, draw again.

Random Group Generator FAQ

What happens with an odd number of people?

Kept even, one pair becomes a group of three, so nobody is left alone. Otherwise one person is named as the odd one out, which suits a bye or a rotation.

How many ways can a group be split into pairs?

For 2k people it is (2k - 1) x (2k - 3) x ... x 1. Eight people can be paired 105 ways, ten people 945 ways, twenty people 654,729,075 ways. Each draw here picks one of them with equal probability.

Can I use this for Secret Santa?

Only for a mutual swap where partners exchange with each other. A Secret Santa is a one-way chain; for that, shuffle the list and have each person give to the next name in it.

Can I stop the same pairs coming up again?

No. Every draw is independent and does not remember the last one. To avoid repeats, note the previous pairs and draw again if one comes back.

More from the Random Group Generator

Related calculators

Embed this calculator
<div id="compoundpage-random-group-generator"></div>
<script src="https://compoundpage.com/embed/random-group-generator.js" async></script>

The same calculation as JSON