The 3rd annual π day anime and mathematics post: A symmetric group of friends of degree 5

「ふいにコネクト」/「ものくろあくたー。」

It’s that day of the year again.

Kokoro Connect’s premise made a lot of people raise their eyebrows, because really, what good can come from body-switching shenanigans? Well, let’s think about this for a second. We have a group of five kids and every once in a while, at random, they switch into the others’ bodies at random. What does that sound like? That’s right, a permutation!

Interestingly enough, the idea of connecting body-switching with permutations isn’t new. The Futurama writers did it and apparently got a new theorem out of it. What differs in the case of Kokoro Connect and Futurama is that in Futurama, the body-switching could only happen in twos. These are called transpositions. Obviously, this isn’t the case for Kokoro Connect. This doesn’t make too much of a difference since it turns out we can write out any permutation we want as a series of transpositions, but that wouldn’t be very fun for Heartseed.

We write permutations in the following way. If we let Taichi = 1, Iori = 2, Inaban = 3, Aoki = 4, and Yui = 5, we’ll have $(1 2 3 4 5)$ representing the identity permutation, when everyone’s in their own body. If Heartseed wanted to make Aoki and Yui switch places, he’d apply the following permutation
$$ \left( \begin{array}{ccccc} 1&2&3&4&5 \\ 1&2&3&5&4 \end{array} \right) $$
While it’s helpful for seeing exactly what goes where, especially when we start dealing with multiple permutations, this notation is a bit cumbersome, so we’ll only write the second line ($(12354)$) to specify a permutation.

For the purposes of this little exercise, we’ll consider applying a permutation as taking whoever’s currently in a given body. That is, say we permute Aoki and Taichi to get $(4 2 3 1 5)$. In order to get everyone back into their own bodies, we have to apply $(4 2 3 1 5)$ again, which takes Aoki, who’s in Taichi’s body, back into Aoki’s body.

So let’s begin with something simple. How many different ways are there for the characters to body switch? Both who is switched and who they switch with is entirely random. Again, since the switches aren’t necessarily transpositions, this means that we can end up with cycles like in episode 2, when Yui, Inaban, and Aoki all get switched at the same time. This can be written as $(1 2 4 5 3)$.

But this is just the number of permutations that can happen on a set of five elements, which is just 5! = 120. Of course, that includes the identity permutation, which just takes all elements to themselves, so the actual number of different ways the characters can be swapped is actually 119.

Anyhow, we can gather up all of these different permutations into a set and give it the function composition operation and it becomes a group. A group $(G,\cdot)$ is an algebraic structure that consists of a set $G$ and an operation $\cdot$ which satisfy the group axioms:

  • Closure: for every $a$ and $b$ in $G$, $a\cdot b$ is also in $G$
  • Associativity: for every $a$, $b$, and $c$ in $G$, $(a\cdot b)\cdot c = a\cdot (b\cdot c)$
  • Identity: there exists $e$ in $G$ such that for every $a$ in $G$, $e\cdot a = a \cdot e = a$
  • Inverse: for every $a$ in $G$, there exists $b$ in $G$ such that $a\cdot b = b\cdot a = e$

In this case, we can think of the permutations themselves as elements of a group and we take permutation composition as the group operation. Let’s go through these axioms.

Closure says that if have two different configurations of body swamps, say Taichi and Iori ($(2 1 3 4 5)$) and Iori and Yui ($(1 5 3 4 2)$), then we can apply them one after the other and we’d still have a body swap configuration: $(2 5 3 4 1)$. That is, we won’t end up with something that’s not a body swap. This seems like a weird distinction to make, but it’s possible to define a set that doesn’t qualify as a group. Say I want to take the integers under division as a group ($(\mathbb Z, \div)$). Well, it breaks closure because 1 is an integer and 2 is an integer but $1 \div 2$ is not an integer.

Associativity says that it doesn’t matter what order we choose to apply our operations in. If we have three swaps, say Taichi and Inaban ($(3 2 1 4 5)$), Aoki and Yui ($(1 2 3 5 4)$), and Iori and Yui $(1 5 3 4 2)$ and we want to apply them in that order. Then as long as they still happen in that order, it doesn’t matter which one we apply first. We’d have
$$((32145)(12354))(15342) = (32154)(15342) = (34152)$$
and
$$(32145)((12354)(15342)) = (32145)(14352) = (34152)$$

The identity means that there’s a configuration that we can apply and nothing will change. That’d be $(12345)$. And inverse means that there’s always a single body swap that we can make to get everyone back in their own bodies.

As it turns out, the group of all permutations on $n$ objects is a pretty fundamental group. These groups are called the symmetric groups and are denoted by $S_n$. So the particular group we’re working with is $S_5$.

So what’s so special about $S_5$? Well, as it turns out it’s the first symmetric group that’s not solvable, a result that’s from Galois theory and has a surprising consequence.

Évariste Galois was a cool dude, proving a bunch of neat stuff up until he was 20, when he got killed in a duel because of some drama which is speculated to be of the relationship kind, maybe not unlike Kokoro Connect (it probably wasn’t anything like Kokoro Connect at all). Among the things that he developed was the field that’s now known as Galois theory, which is named after him. What’s cool about Galois theory is that it connects two previously unrelated concepts in algebra: groups and fields.

One of the most interesting things that came out of Galois theory is related to the idea of solving polynomials. I’m sure we’re all familiar with the quadratic formula. Well, in case you aren’t, here it is:

$$x = \frac{-b \pm \sqrt{b^2 – 4ac}}{2a}$$

This neat little formula gives us an easy way to find the complex roots of any second degree polynomial. It’s not too difficult to derive. And we can do that for cubic polynomials too, which takes a bit more work to derive. And if we want to really get our hands dirty, we could try deriving the general form of roots for polynomials of degree four. And wait until you try to do it for degree five polynomials.

That’s because, eventually, you’ll give up. Why? Well, it’s not just hard, but it’s impossible. There is no general formula using radicals and standard arithmetic operations for the roots for any fifth degree (or higher!) polynomial. The reason behind this is because $S_5$ is the Galois group for the general polynomial of degree 5. Unfortunately, proving that fact is a bit of a challenge to do here since it took about 11 weeks of Galois theory and group theory to get all the machinery in place, so we’ll have to leave it at that.

Low energy 2012 reflection

「「私、気になります!」」/「Mirunai」

You can see my 12 Days posts as sort of the most interesting things I’ve seen or read over the year. And so you can probably infer the following.

The best anime of 2012 was Hyouka.

Why? There’s a lot of reasons, but basically, it was the show I was most sad to see end. Oh and I guess there’s this too:

More generally, I think the highlights of my 2012 have been meeting up with people, something that I’ve begun to look forward to after being exiled in London. Of course, there’s the good old meetups with old university friends, some of which involved riichi mahjong. But this was the year that I got to meet some of the Toronto-area cartoon heads that I’ve been talking to on twitter for a while and it was great. And even the non-cartoon head Toronto council watchers were cool too, which is unsurprising, since Toronto City Council is the secret best anime.

Hopefully 2013 gives me some more chances to ruin your impressions of me IRL.

12 Days IX: Socially awkward monster-kun

「となりの怪物くん」/「アン」

Tonari no Kaibutsu-kun is about socially awkward people. Our main couple is made up of a girl who knows everything and a boy who knows nothing. Shizuku is relentless and ruthless in her pursuit of knowledge and success. Haru is sharp but literally does not know how to interact with people. So you put them together and you’ve got two kids who don’t know how to deal with the other. Misunderstandings, the grease that keeps shoujo manga moving, happen because they actually misunderstand each other and not because they dance around trying to avoid each other for no reason. When they meet, they clash, but things work out quickly. And toss in a whole crew of other socially awkward people and the whole thing becomes a whole barrel of shenanigans with well-intentioned kids trying to deal with one another.

12 Days VII: Janken Pretty Cure

「夏服(スマプリ♯11)」/「とろみ中華」

This was my second Precure and let’s just say Heartcatch was a tough act to follow. And well, it’s a good thing that Smile doesn’t try to out-Heartcatch Heartcatch. It’s certainly fun and everyone has fun. Even the villains don’t seem to be trying very hard sometimes, almost as if they knew what show they were in. So it’s not as punch-kicking, but it still knows how to entertain. Of course, it does get serious on occasion and the fun that we’ve had for the weeks beforehand don’t seem to detract from it. But really, it’s the best when it goes all out with its ridiculousness.

12 Days VI: The Hax Swordsman

「二十分で色のせた」/「キサラしぃ」

A lot of people love Sword Art Online. A lot of people hate it, too. Yeah, Kirito is pretty hax, but I’ve been enjoying it largely because of that. It’s kind of like back when I had a playable version of Jedi Knight 2, sometimes, I’d just start it up and turn on cheats and go wreck things. I was also fairly hopeful that Asuna would be interesting, but that didn’t pan out as well as I’d hoped in later volumes. But after all that, I’ve kept reading it because in the end, I just want to see Kirito and Asuna be happy together (´・ω・`).