# Science Fiction Author Greg Egan as well as Anonymous Mathematics Whiz Advancement Permuta …

On September 16, 2011, an anime fan posted a math question to the online bulletin board 4chan about the cult classic television series *The Melancholy of Haruhi Suzumiya*. Season one of the show, which involves time travel, had originally aired in nonchronological order, and a re-broadcast and a DVD version had each further rearranged the episodes. Fans were arguing online about the best order to watch the episodes, and the 4chan poster wondered: If viewers wanted to see the series in every possible order, what is the shortest list of episodes theyâd have to watch?

In less than an hour, an anonymous person offered an answer â not a complete solution, but a lower bound on the number of episodes required. The argument, which covered series with any number of episodes, showed that for the 14-episode first season of *Haruhi*, viewers would have to watch at least 93,884,313,611 episodes to see all possible orderings. âPlease look over [the proof] for any loopholes I might have missed,â the anonymous poster wrote.

The proof slipped under the radar of the mathematics community for seven years â apparently only one professional mathematician spotted it at the time, and he didnât check it carefully. But in a plot twist last month, the Australian science fiction novelist Greg Egan proved a new upper bound on the number of episodes required. Eganâs discovery renewed interest in the problem and drew attention to the lower bound posted anonymously in 2011. Both proofs are now being hailed as significant advances on a puzzle mathematicians have been studying for at least 25 years.

Mathematicians quickly verified Eganâs upper bound, which, like the lower bound, applies to series of any length. Then Robin Houston, a mathematician at the data visualization firm Kiln, and Jay Pantone of Marquette University in Milwaukee independently verified the work of the anonymous 4chan poster. âIt took a lot of work to try to figure out whether or not it was correct,â Pantone said, since the key ideas hadnât been expressed particularly clearly.

Now, Houston and Pantone, joined by Vince Vatter of the University of Florida in Gainesville, have written up the formal argument. In their paper, they list the first author as âAnonymous 4chan Poster.â

âItâs a weird situation that this very elegant proof of something that wasnât previously known was posted in such an unlikely place,â Houston said.

## Permutation Cities

If a television series has just three episodes, there are six possible orders in which to view them: 123, 132, 213, 231, 312 and 321. You could string these six sequences together to give a list of 18 episodes that includes every ordering, but thereâs a much more efficient way to do it: 123121321. A sequence like this one that contains every possible rearrangement (or permutation) of a collection of *n* symbols is called a âsuperpermutation.â

In 1993, Daniel Ashlock and Jenett Tillotson observed that if you look at the shortest superpermutations for different values of *n*, a pattern quickly seems to emerge involving factorials â those numbers, written in the form *n*!, that involve multiplying together all the numbers up to *n* (for example, 4! = 4 Ã 3Â Ã 2 Ã 1).

If your series has just one episode, the shortest superpermutation has length 1! (also known as plain old 1). For a two-episode series, the shortest superpermutation (121) has length 2! + 1!. For three episodes (the example we looked at above), the length works out to 3! + 2! + 1!, and for four episodes (123412314231243121342132413214321), it is 4! + 3! + 2! + 1!. The factorial rule for superpermutations became conventional wisdom (even though no one could prove it was true for every value of *n*), and mathematicians later confirmed it for *nÂ *= 5.

Then in 2014, Houston startled mathematicians by showing that for *nÂ *= 6, the pattern breaks down. The factorial rule predicts that to watch six episodes in every possible order should require 873 episodes, but Houston found a way to do it in 872. And since there is a simple way to convert a short superpermutation on *n* symbols into a short superpermutation on *nÂ *+ 1 symbols, Houstonâs example meant that the factorial rule fails for every value of *n* above 6 too.

Houstonâs construction works by translating the superpermutation problem into the famous traveling salesman problem, which looks for the shortest route through a collection of cities. More specifically, superpermutations are connected to the âasymmetricâ traveling salesman problem, in which each path between two cities has a cost (which is not necessarily the same in both directions), and the goal is to find the least expensive route through all the cities.

The translation is simple: Think of each permutation as a âcityâ and imagine a path from each permutation to each other permutation. In the superpermutation problem, we want the shortest possible sequence of digits that lists all the permutations, so the goal is to travel through the permutations in a way that adds as few digits to the starting permutation as possible. So we declare the cost of each path to be simply the number of digits we have to attach to the end of the first permutation to get the second one. In the *nÂ *= 3 example, for instance, the path from 231 to 312 costs $1, since we just have to add a 2 to the end of 231 to get 312, while the path from 231 to 132 costs $2, since we have to add a 32. With this setup, the least-expensive path through the cities corresponds directly to the shortest superpermutation.

This translation meant that Houston could turn the power of traveling salesman algorithms on the superpermutation problem. The traveling salesman problem is famous as an NP-hard problem, meaning that thereâs no efficient algorithm that can solve all cases of it. But there are algorithms that can solve some cases efficiently, and other algorithms that produce good approximate solutions. Houston used one of the latter to produce his 872-digit superpermutation.

Since he produced only an approximate solution, it might not be the very best superpermutation. Mathematicians are now conducting a giant computer search for the shortest superpermutation on six symbols, Pantone said. âWe know our search will finish in finite time, but donât know if thatâs one week or a million years,â he said. âThereâs no progress bar.â

## The Wrong Order

By the time of Houstonâs work, the anonymous 4chan post had been sitting in its corner of the internet for nearly three years. One mathematician, Nathaniel Johnston of Mount Allison University, had noticed a copy of the post on a different website a few days after it was posted â not because he was an anime fan, but because he had typed an assortment of superpermutation-related search terms into Google.

Johnston read the argument and thought it seemed plausible, but he didnât invest much effort in checking it carefully. At the time, mathematicians believed that the factorial formula for superpermutations was probably correct, and when you think you know the exact answer to a question, a lower bound isnât very interesting. In other words, the superpermutation research episodes were playing out of order.

Johnston later mentioned the lower bound on a couple of websites, but âI donât think anyone really gave it any particular heed,â Houston said.

Then on September 26 of this year, the mathematician John Baez of the University of California, Riverside, posted on Twitter about Houstonâs 2014 finding, as part of a series of tweets about apparent mathematical patterns that fail. His tweet caught the eye of Egan, who was a mathematics major decades ago, before he launched an award-winning career as a science fiction novelist (his breakthrough 1994 novel, in a happy coincidence, was called *Permutation City*). âIâve never stopped being interested in [mathematics],â Egan wrote by email.

Egan wondered if it was possible to construct superpermutations even shorter than Houstonâs. He scoured the literature for papers on how to construct short paths through permutation networks, and after a few weeks found exactly what he needed. Within a day or two, he had come up with a new upper bound on the length of the shortest superpermutation for *n* symbols: *n*! + (*nÂ âÂ *1)! + (*nÂ âÂ *2)! + (*nÂ â*Â 3)! + *nÂ âÂ *3. Itâs similar to the old factorial formula, but with many terms removed.

âIt absolutely smashed the [previous] upper bound,â Houston said.

The anonymous 4chan posterâs lower bound, meanwhile, was tantalizingly close to the new upper bound: It works out to *n*! + (*nÂ âÂ *1)! + (*nÂ âÂ *2)! + *nÂ âÂ *3. When Eganâs result became public, Johnston reminded other mathematicians about the anonymous posterâs proof, and Houston and Pantone soon showed it was correct. As with Houstonâs work, the new lower and upper bounds both come at superpermutations via the traveling salesman problem: The lower bound shows that a route through all the cities must travel along some minimum number of paths that cost more than $1, while the upper bound constructs a specific route for each *n* that uses only $1 and $2 connections.

Researchers are now trying to bring the upper and lower bounds together to find a single formula that solves the superpermutation problem. âProbably people are eventually going to completely nail down this puzzle,â Baez predicted. âItâs looking good now.â

For *Haruhi* fans, Eganâs construction gives explicit instructions for how to watch all possible orderings of season one in just 93,924,230,411 episodes. Viewers could start binge-watching immediately, or they could wait and see whether mathematicians can whittle this number down. The anonymous posterâs lower bound proves that this whittling down couldnât possibly save more than about 40 million episodes â but thatâs enough to get a nice start on season two.

**GSS Search Replacement**