icon

Juggling, maths and a beautiful mind

Burkard Polster Share this page
September 2009

The movie A Beautiful Mind contains a memorable transition: the mathematician John Nash (played by Russell Crowe) rides his bicycle in an infinity sign, which slowly solidifies into part of a mathematical formula from the next scene.

Watching the movie the other day, there occurred to me another way to effect this transition. Imagine John juggling the basic three ball pattern. Then the balls in this pattern automatically trace an infinity sign...

Burkard juggling

Hit your escape key if you are sick of seeing me juggle (Firefox and IE).

It would have been natural for John Nash to be attracted to juggling: in real life many mathematically inclined people find the pure and tight patterns of juggling as irresistible as those of mathematics. In fact, it is likely that the majority of readers of Plus magazine know how to juggle three balls, and that quite a few can juggle at a semi-professional level.

As with any real mathematician, John sees mathematics everywhere. We see him drawing on library windows, and trying to capture the mathematics of real-life scenarios: the feeding patterns of pigeons; a mugging; dating. Let's imagine what John might have discovered about juggling if observing that infinity had led him to ponder further.

Juggling numbers

John juggles to a regular beat, with his left and right hands taking turns catching and tossing at most one ball on a given beat. Each tossed ball travels for a certain number of beats before returning to hand. Then, since juggling patterns eventually repeat, recording these beat numbers produces a periodic sequence. For example, the basic three ball pattern above has sequence ... 3,3,3,3,3 ..., or simply 3. By comparison, three balls juggled in a circle has sequence ... 5,1,5,1,5,1,5,1 ..., or simply 5,1. Mathematical jugglers refer to strings of numbers such as 3 and 5,1 as juggling sequences or site swaps. Juggling sequences are for juggling what musical scores are for music.

Back to John, who's trying to figure out whether his favourite sequence 5,0,1 is a juggling sequence ("favourite" because John is also a "501 darts" fan). To do this he draws a diagram — on a library window, of course. This diagram consists of a row of equally spaced dots, representing the beats on a timeline, and labelled with the corresponding throw durations. A dot labelled with 0 means no ball is thrown on that beat. From each dot with a positive number he draws an arc, extending that number of dots to the right.

Diagram

This is a juggling sequence.

There is now a simple test of whether the diagrammed sequence is a juggling sequence: on every beat either nothing happens, or exactly one ball lands and is then tossed again immediately. Also, for a juggling sequence, the arcs join to form exactly as many curves as there are balls being juggled. This all tells us, for example, that 5,0,1 is jugglable and that we need two balls to juggle it.

Next, John checks whether 1,2 is jugglable.

Diagram

This is not a juggling sequence.

In order to juggle 1,2, John would have to catch two incoming balls in one hand on every second beat. Moreover, John would need to have balls mysteriously materialise and vanish. None of this is possible within our simple juggling formulation, and therefore 1,2 is not a juggling sequence.

An algebraic juggling detector

Is 100000,1,1 a juggling sequence? Fancy drawing gazillions of dots and arcs? Obviously, nobody but a mathematician such as John would really care whether this monster sequence can (in theory) be juggled. However, there is a very good point to asking this kind of question. By taking things to extremes it is often possible to uncover shortcomings in ones understanding of what is going on. In this case, John's graphical method turns out to be inadequate for dealing with extreme sequences. Not satisfied, he digs deeper and succeeds in distilling the essence of his graphical method into a very simple algorithm.

Suppose we want to determine whether 4,4,1,3 is jugglable. We create a second sequence, by adding 0,1,2,3 to the elements of the first sequence. This gives 4, 5, 3, 6. Then (buckle your seat belts), we form a third sequence whose elements are the remainders of the elements of the second sequence when divided by the length of the original sequence. Our sequence has length 4, and so the new sequence is 0,1,3,2. It turns out that the original sequence is a juggling sequence exactly if this final sequence consists of distinct numbers. That is true for the sequence 0,1,3,2, and so 4,4,1,3 really is a juggling sequence. The monster 100000,1,1 is as well, as you can check. (You can find out why this works in the articles and books listed below).

Also, it turns out that the number of balls necessary for juggling a sequence is simply its average. So, we need (4+4+1+3)/4 = 3 balls to juggle 4,4,1,3, and it takes 3334 balls to juggle the monster.

Usually jugglers write 4413 instead of 4,4,1,3. This makes sense, as long as it is understood that all the digits stand for different throws. To be able to record throws of greater than nine beats it is common to let A stands for 10, B for 11, and so on. Of course, to a playful mathematical mind this immediately invites one to check whether their name is jugglable. In fact, people have checked all the words in the dictionary for jugglability. It turns out that very few real words are jugglable, though curiously both "theorem" and "proof" are. Which do you think is harder, to come up with a conjecture for a theorem or to prove it? Well, our virtual juggler thinks that "proof" is harder than "theorem", because it takes 23 balls to juggle the first word, whereas "only" 21 are required to juggle the second.

A graphical juggling generator

After making these discoveries (and cursing fate that his name is not jugglable), John has been spending countless hours practising, and analysing juggling patterns. He can now juggle any three ball sequence, as long as it only contains throws of at most 5 beats. He has also figured out a neat way to generate all of these sequences, based on the following "simple" (for him) juggling state diagram. Time for some more graffiti on those remaining library windows...
Diagram

A juggling state diagram.

The diagram above contains all three ball juggling sequences with throws that last at most 5 beats. Here is how we extract them. Starting at any of the rectangles, we follow any path of arrows, recording the numbers in the orange circles along the way. Once we return to the beginning rectangle, the string of recorded numbers is a juggling sequence.

Diagram

For example, beginning at the brown rectangle and walking along the red, green, and purple loops produces the juggling sequences 3 and 4,4,1 and 5,5,1,5,0,5,3,0. We can also combine the red and green loops into a longer loop that visits the brown rectangle twice, giving the juggling sequences 4,4,1,3. Importantly, even if you are familiar with the two patterns 4,4,1 and 3, the combined pattern 4,4,1,3 will look and feel completely different.

Peeking into a beautiful mind

Why does this work? Let's rewind, to the moment when John gains the inspiration for his diagram. We see him practising an incredibly complicated three ball pattern, when suddenly a heckler shouts "Is that all you can do?" This triggers a brainstorm similar to the one in A Beautiful Mind, when the beautiful blonde enters the bar. Time stands still, in between two beats, and we see the three balls suspended in the air. With the balls suspended, John is muttering to himself, trying to determine his throw options for the next beat.

"There are three balls in the air, and they are scheduled to land in 1, 3, and 4 beats from now. This means that on the next five beats there are scheduled to be 1, 0, 1, 1, 0 balls landing. So, I am currently in the juggling state 10110."

Diagram

"On the next beat I catch the red ball, corresponding to the first 1. This means that on the following five beats there are 0, 1, 1, 0, 0 balls scheduled to land. Consequently, if I want to avoid collisions, I can only choose between throws of 1, 4, and 5 beats duration, corresponding to the positions of the 0s in this last sequence. If I decide on a 4 beat throw, then I have to replace the 0 in the fourth position by a 1 and my new juggling state becomes 01110. If I go for a 1 beat throw, my juggling state changes to 11100, and if I perform a 5 beat throw my state becomes 01101."

Diagram

Brilliant! This calculation demonstrates the connection between the original state 10110 and the three arrows leading from it to the states 01101, 11100 and 01110. Repeating the same for all possible states gives the complete juggling state graph. It should be clear that by juggling along the arrows of this juggling state graph, on each beat either nothing happens or exactly one ball lands and is immediately tossed again. This is exactly what we want to ensure. Only if we complete a loop, can we be sure that we can repeat the numbers we come across over and over again, which is necessary for a sequence of numbers to be jugglable. In fact, it is fairly easy to see that all the three ball juggling sequences that John can juggle correspond to loops in his state graph.

So, constructing the state graph for a given number of balls and given limits on the duration of throws is a completely automatic task and can be performed easily by a computer. Similarly, finding loops in graphs is a routine exercise for a computer.

To infinity and beyond

What John has discovered so far is all he'll ever need to recognise juggling patterns, communicate juggling patterns effectively, come up with complete lists of juggling patterns satisfying various real-life constraints, and even program one of these amazing juggling simulators. So, does he stop here? No, for our mathematician there still remain many intricate and unanswered questions, going well beyond the immediately applicable. Let's see what might happen if he follows his mathematical nose.

Consider John's three ball jugging diagram above. There are infinitely many ways to choose a loopy journey in the diagram, corresponding to infinitely many ways of juggling three balls. However, there are only 26 loops that visit no rectangle more than once. Examples are the red, green and purple loops highlighted earlier. Similar to the manner in which numbers factor into primes, all possible loopy journeys are composed from these 26 prime loops. For example, the juggling sequences 3, and 441 are prime, but 4413 is not.

In the later part of A Beautiful Mind, John Nash is working on the Riemann hypothesis which is one of the greatest unsolved problems in mathematics today. It is all about the distribution of prime numbers. It would have been great fun if the film makers had John make progress towards this difficult problem, by discovering a connection between prime numbers and prime juggling sequences.

This is not as far-fetched as it may sound. It turns out that the mathematics of juggling really has many exciting connections with other areas of mathematics. This includes the theory of knots, combinatorics, linear algebra, and permutation groups.

Back on Earth

At this point we leave our fictitious hero John to his musings and wrap up with a few remarks that connect our story with juggling reality.

The earliest historical evidence of juggling is a 4000 year old wall painting in an ancient Egyptian tomb. In real life, juggling sequences were developed independently by at least three groups around 1985. Juggling state graphs were discovered in 1988 by Jack Boyce who is also the author of Juggling Lab featured above.

This article is only intended to be an introduction to the basics of the mathematics of juggling. In particular, there are ways of juggling multiple objects with one hand, and with both hands simultaneously. It is even possible for a number of jugglers to pass props back and forth between them. They can even juggle themselves while they are doing so, by moving around in intricate patterns. All these more complicated scenarios can be investigated with extensions to the simple mathematical model presented here.

My book, The mathematics of juggling.


About the author

Burkard Polster is Monash University's mathematical juggler, origami expert, bubble-master, shoelace charmer, and Count von Count impersonator. He is the author of a number of books, including The Mathematics of Juggling (see below), Q.E.D: Beauty in Mathematical Proof, The Shoelace Book (which has been reviewed in Plus) and Eye Twisters (a book on ambigrams). When Burkard is not playing with mathematics he has fun investigating perfect mathematical universes and turning his uni students into maths demons.

Burkard and his colleague Marty Ross are Australia's tag team of mathematics. They write the ,Maths Masters column for the Melbourne Age and the Sydney Morning Herald. For many years they have been delivering the mathematics lecture series at the Melbourne Museum, visiting schools and touring the country with their Mathematical Mystery Tour.

Check out what else Burkard is up to at www.QEDcat.com.


You can buy the book and help Plus at the same time by clicking on the link on the left to purchase from amazon.co.uk, and the link to the right to purchase from amazon.com. Plus will earn a small commission from your purchase.