**Way back in 2006, an unusual anime began airing on Japanese television. Although the series was about aliens, time travel and other supernatural events, no one could have predicted the strange effects that The Melancholy of Haruhi Suzumia would have on the world of mathematics.**

## All mixed up

As the show aired, people began to notice the episodes seemed out of order. Some of the earliest episodes clearly showed events that happened after later episodes. When the series finished, fans pieced together the timeline and came up with the chronological (time-based) order for the episodes.

When the series came out on DVD, the episodes were in a third order. Fans began joking that maybe they should watch the series in every possible order. But with 14 episodes in the first series, how long would it take to do that?

## An epic TV marathon

We can calculate that! Given 14 episodes, with each episode being a bit over 20 minutes long, it takes about five hours to watch that series once. And the possible number of orders is staggering – there are 14 episodes you could watch first, 13 you could watch second, 12 you could watch third and so on, for a grand total of 14 x 13 x 12 x … x 2 x 1 = 87 178 291 200 different orders, with a total of 1 220 496 076 800 episodes watched, and a total run time of approximately fifty million years.

Fans also noticed a loophole that could cut that time down. If you watch episodes 1–14 in that order and then watch episode 1 again, you’re actually completing two possible orders – the original order, and also the order 2, 3, 4, … 13, 14, 1. This saves a repeat watching of 13 episodes! You can extend this trick even further, and save a heap of time, but it also makes it a lot more difficult to find the best answer.

## Enter the mathematicians

In the world of maths, this ordering of episodes is an example of the unsolved minimal superpermutation problem. Surprisingly, some of the best research on the topic isn’t coming from professional mathematicians.

Currently, the best known solution was devised by Greg Egan, an Australian Science Fiction writer. His method requires watching just 93 924 230 411 episodes, which takes about four million years.

There might be better solutions out there, but not much better. Back in 2011, on an internet forum discussing Japanese animation, an anonymous poster showed it was impossible to find an answer with fewer than 93 884 313 611 episodes watched.

The forum post, which included some working, was recently discovered by a team of mathematicians. The team wrote up and clarified the ideas, then made them available on the internet for other mathematicians.

So what’s the actual answer? Mathematicians reckon it’s somewhere between these two solutions. It might be possible to do better than Greg’s answer, but probably not manage a number as low as that given by the anonymous poster. Either way, it’s going to take a lot more maths to figure it out!

*If you’re after more science news for kids, subscribe to Double Helix magazine!*

## Leave a Reply