RSECon25 has been a treat — both the organizational tracks and the technical tracks were really fun. And as always, the hallway track was even better — even though I really have to work on writing down and remembering people's names! Sorry for the folks I didn't recognize from last year :(
On the last day, Sam Tygier Nerd Sniped me — well, he was decent enough to not do it on a road crossing. But I consider putting me on a mathematical quest on a drinking / board gaming evening as nerd-sniping.
The question was this:
As our group of RSEs grew too large for everybody to know each other organically, I want to organize coffee-pairs. Each week I want a list of people and propose them to have a coffee, either IRL or over Zoom. The pairs should not repeat.
An additional question, which I didn't think about yet, is this:
How to handle absent people and changing group?
So I got out the paper, pencil, and started to draw some grids and n-grams, and we looked if we can point to an easy pattern. Very quickly we realized that it gets complicated, and our first algorithms were NP-something, as we needed to try out and search a tree with dead-ends. At one moment we were not sure whether it's possible at all, so we counted the possible pairs and the number of pairs necessary:
N RSEs, where N is evenN*(N-1)/2 total pairs of RSEs possibleN-1 RSEs, so we can suppose that the coffee
drinking has to go on for N-1 weeks without repetitionsN/2 pairs of coffee per week
— which is the actual number of pairs, and so there is no contradiction.This doesn't prove that it's possible, but at least it doesn't prove it's impossible, so we continued searching. By this time we lost Warrick Ball (I'm working on my names but had to ask SaraH, not Sara…) who gave us some ideas to help us get along the way.
Then we started to fill out the grids of N×N RSEs with A, B, ... for the different
weeks, and effectively found solutions up to 8 RSEs. Then it got complicated, because there was a lot of
trial-and-error implied. This is where I left, too, and continued to think about the problem under the pouring
rain. The beers had their effect and I visualized a tetrahedron where the nodes are RSEs and the edges are
coffees.
So I had a pattern to describe the 3 coffee-weeks (A0/A1, B0/B1, C0/C1)
with 4 RSEs.
One of the insights was that with N
RSEs, there are N-1 weeks (duh).
And if you get an appropriate pattern, like the A0/A1, and rotate it around the
correct axis, here the vertical one, you can get all pairs for every week.
I considered an N-dimensional setup of the problem, but quickly
came back to good old 2D space, as my brain cannot handle more than 4D space. Thinking about the tetrahedron, I
visualized it from the top (the beer was still strong...), and realized the following:
N-1 weeks, so if I use an N-1-gram, and put the Nth node in
the middle, all I need is a non-repeating pattern connecting the nodes and rotate it N-1 times
N-1-gram, if all the nodes are paired up, there is
one remaining nodeNth node can be put in the middle and be connected to the remaining node1, 2, ..., N/2-1, then you can
rotate this pattern to generate all the N-1 weeks, because due to the different distances,
there will be no repetitions of pairs — and so all possible pairs will be generated (there might have to be
a proof here, but it sounds intuitive to me)Now the previous search in a 2D-grid is reduced to a search in a 1D list, where I need to find a pattern to construct these connections.
After a lot of paper-filling with pen and pencil, and not looking at the internet how to solve this problem, I finally saw the light. I went through quite some dead-ends and drew the solutions in all kinds of ways, before I managed to separate the pairs: Looking at the pairs as even and odd distances allows you to always insert one pair in the next higher pair:
A is the pair i, i+1 — B is the pair j, j+2 — C is the pair
k, k+3 — R is the remaining node which is connected to the node N
Nth RSE is in the middle of the N-1-gramWhen you draw this in an N-1-gram, you get this very nice drawing:
I hope this is a nice enough intuitive description of the problem, as Sam requested :)
To solve the problem of pairing up an even number of N RSEs into N/2 pairs for coffee,
allowing them to go on for N-1 weeks without drinking coffee twice with the same person (except if
they want to, of course), you have to:
N/2 groups[0..N-1] of RSEsMy brother-in-law, famous mathematician family-dad, pointed out the following explanation, which is technically the same, but easier to put in place:
N/2 seats on each sideIf you find an error in this description, please contact Linus Gasser.
Thanks for Qwen3-30b to create the nice JavaScript-visualizations...