# Conga Line Mathematics

Recently I was situated on a mezzanine floor overlooking a heaving dance party, and had the opportunity to witness the spontaneous formation, growth, and eventual breakdown of a conga-line. It was a fascinating structure to observe. I love a party as much as the next lover of parties, so I immediately hit the library to scout out some academic treatise on the Conga Line, hoping to uncover the mathematical and sociological secrets of this swirling, growing, navigating emergent life form and all its many aspects. But nothing turned up.

So I have a duty to science to record my observations, for the benefit of humanity.

Before embarking on this study we must discuss the nature and definition of a conga line, with a little brushing up on the history books.

According to some sources, the Conga line is a novel carnival dance from Cuba that rose to popularity in the 1930s, but other sources point out that trilobites have been fossilized mid-conga as many as 480 million years ago. So the truth is probably somewhere in between. History is like that.

Strictly speaking, if we wish to get into the formal definitions and exclude trilobites from our calculations, a Conga line involves people lined up, serially, one behind the other, with each person's hands on the hips (or shoulders) of the person in front, marching in a 1-2-3-kick shuffle in time to music.

One person is at the front of the conga. There role is pivotal, particularly in the earliest stages of the emergent behaviour. And once the conga is fully formed, it is their duty to navigate, or "weave" the head of the conga line throughout the dance floor, at a fairly constant rate, despite the numerous obstacles that a crowded dance floor typically provides.

The second person in the line has a less visible, but equally critical role, as they are the first joiner. Without their participation the person in front would not be the head of a conga line.

Every participant, from the leader, to the last member, can engage in "spruiking" behaviour - intended to encourage other non-participants to forgo whatever other mating-rituals they were engaged in, and to instead join the conga line.

The traditional way to join the conga line is to join at the back of the line. But line members who are encouraging others to join will frequently allow new joiners to "break in" -- splicing themselves in between two previously adjacent participants. This kind of behaviour interrupts the flow of the conga line and is one of many ways that a pile up or conga-jam can occur. These are resolved generally by allowing time to pass: the head of the conga moves on and the participants move forward, creating a longer line. But also, spontaneous kinks or bends can form along the length of the conga, to accommodate a greater number of dancers in less "as the crow flies" distance -- following a kind of space filling curve of which Hilbert would be proud.

Now that we've described the basic system, we could hopefully recognize one if we encountered it in the wild, and armed with this background knowledge we can discuss the pertinent aspects I wish to share.

## Phase 1: Formation

A dance floor, at any moment in time, has a certain energy. The energy varies as people leave or join the dance floor, as songs change from one to the next, as alcohol or other substance enters the blood stream of the revellers, and so on. For a conga line to form, the energy level, ε, must be above a certain threshold which we will call:

Τc

A simplistic simulation of the conga equation would simply say, when ε > Τc there is a probability ρc that a conga line will form, and leave it at that.

But the granularity here is insufficient for any useful predictions to be enjoyed. We need to attack the problem at a deeper level.

## Simulation

I wanted to find a way to simulate conga dynamics. I started to write a logo program, and got as far as a dance floor filled with random dancers:

But I didn't know how to use the type system to create an array of dancers.

I considered modelling them in a C# program, and releasing it as a game through the Itch.io platform for indie gamers.

But a different option that I found particularly intriguing would be to create a text adventure game, from the point of view of a person on a dance floor, confronted with the choice of starting, or joining, or not joining, or breaking into, or leaving, a conga line.