### Irish mathematics for St. Patrick’s Day The plaque on Brougham Bridge in Dublin, Ireland commemorating the discovery of quaternions by William Rowan Hamilton. [Credit: Geograph.org.uk ]

With so many websites celebrating the science of beer on St. Patrick’s Day, I thought I’d focus on something completely different: Ireland’s greatest mathematician and one of his great discoveries. On October 16, 1843, the great Irish mathematician William Rowan Hamilton was walking along the Royal Canal in Dublin. He had been pondering for a long time whether complex numbers could be extended to higher dimensions. During his perambulation, he realized the answer was “yes”, and carved his solution on the Brougham Bridge. The plaque shown on the right commemorates the discovery. (For physics enthusiasts: Hamilton is the same man who discovered Hamiltonian dynamics, which in turn underlies quantum mechanics and much of chaos theory.) The equation he carved was To understand Hamilton’s solution, recall that an imaginary number is the square root of a negative real number. (A real number, in turn, includes all the counting numbers, negative numbers, ratios, and irrational numbers: numbers like π that can’t be expressed as fractions.) The imaginary unit is the square root of -1:  Illustration of the complex plane: the connection between complex numbers and points in two dimensions. Four points are plotted so you can see the correspondence between x and y coordinates and the real and imaginary parts of the complex numbers.

Complex numbers are the sum of a real number and an imaginary number. Just as you can place a real number on the number line, you can place a complex number on the complex plane: the x coordinate is the real part, while the y coordinate is the imaginary part. This means complex numbers are a very simple way to represent two-dimensional quantities (location on a map, for example). There is also a very deep connection between points on the surface of a sphere and complex numbers, but that’s a subject for another day.

The math of complex numbers is very rich, but they also play many roles in quantum physics and engineering, as I’ve noted in several posts in the past. (See in particular “Imaginary Numbers are Real“, which includes a really cool quantum mechanics application.) Instead, let’s focus on one particular case: representing rotations in two dimensions.

As far as I can tell from my historical readings, Hamilton wasn’t thinking about applications to science particularly when he started trying to generalize complex numbers to higher dimensions: he just wanted to see if he could discover a system of numbers with two imaginary units, i and j, which might represent points in three dimensions. But he couldn’t find one that was consistent. What he realized during that walk on October 16, 1843 is that he could do it with three different imaginary numbers i, j, and k , making a four-dimensional set called quaternions — but with a crucial new concept. Ordinary numbers can be multiplied in any order without changing the result: 4 × 2 = 2 × 4 ; complex numbers also behave this way, so for example This is called commutativity: the order of multiplication doesn’t affect the answer.

Hamilton’s quaternions don’t work that way — changing the order of multiplication changes the result! Here are a few of the multiplications of the quaternion imaginary units with each other: It might look like reversing the order of multiplication just gives you the negative, but that’s not going to be true in general because of all the different imaginary units. (More details about quaternion algebra are down at the bottom of this post, for those who are interested.)

This may sound incredibly complicated, but it’s less so if you think about language rather than algebra. The order of words in a sentence makes a big difference; words order sentence a The big of in makes difference a. It’s even more dramatic if you let the letters themselves be scrambled. We’re used to the arrangement of things being important, so the fact that multiplication of real or complex numbers doesn’t have that property is more a special case than anything. We just have to rethink what multiplication means if we’re expanding our ideas of what numbers are. Rotations around two different axes don’t commute with each other – the order makes a big difference. In this case, the axes point toward you (z axis) and toward me in the photo (x axis). In the first row, I rotated the book by 90° around the x-axis, then 90° around the z-axis; the second row shows what happens if you do the same rotations in reverse. (The book is Symmetry by Hermann Weyl; the t-shirt is “Math is Delicious” by Jeph Jacques.)

In fact, you already have a pretty clear notion of non-commutativity in a physical context: take a book and perform the rotations shown in the photos above. The two end results aren’t the same; the order of rotations matters. In two dimensions, the order is irrelevant, since there’s only two directions to go: clockwise or counter-clockwise. With three dimensions to work with, you have a lot of choices of directions for rotation, so order means a lot, as anyone who has tried carrying a sofa-bed up a narrow staircase can attest. In fact, we can think about rotations using multiplication of quaternions.

Hamilton’s quaternions look like they need four coordinates (real part, plus three imaginary parts) to plot, so we can’t draw them on a piece of paper. However, if you assign the three coordinates of space (x, y, and z) to the imaginary parts of the quaternion (leaving out the real bit), you can draw that. In fact, those of you who have taken introductory physics or certain math classes may recognize the (i, j, k) notation has been adopted for unit vectors, mathematical constructs corresponding to the simplest perpendicular directions in three-dimensional space. Quaternions are even more powerful than that: you can represent both directions (using just the imaginary parts) and rotations (using the whole quaternion).

In other words, though quaternions may be a little more complicated than the algebra you learned in high school, they are a very convenient way to represent real-world phenomena. Aerospace and robotics engineers use quaternions to model the positions and orientations of planes and robots. To cite one example: the people controlling the Mars rovers use quaternions to describe the orientation of the robots.

The later mathematical work of Hermann Grassmann, William Kingdon Clifford, and many others arose thanks to Hamilton’s efforts. It’s not terribly far-fetched to say that quaternions paved the way to much of the math underlying modern physics, including the theory of the Higgs boson. And though I hardly need to say it, there’s a lot more to Ireland than green clothing (which nobody I know from Ireland wears), green beer (which nobody I know from Ireland would drink), or the “Londonderry Air”.

Now it’s time for me to take a little walk.

[This post is adapted from “Why Quaternions Matter“, which first appeared on this blog on October 17, 2011.]

### Appendix: A Bit More About Quaternion Algebra

Skip over this part if you don’t want to see a lot of equations.

Here are the basic multiplication rules for quaternions: So let’s take two simple quaternions and multiply them together both possible ways: The only difference between Q×R and R×Q is whether 4k is positive or negative, but that’s enough that the results aren’t equal, or simply negatives of each other. I’ll spare you more complicated examples, since you probably can see where they would go.

Now how to represent rotations? Let’s go back to the book picture from above. The spine of the book is oriented along the y-axis, which isn’t shown, and we have two rotations, around the x– and z-axes to content with. Here are these three things, represented with quaternions: (The fraction in front is to make numbers work out. Don’t sweat its meaning.) We also need something known as the quaternion conjugate, which swaps the signs of the imaginary units, but leaves the real parts alone: Now let’s rotate from the first frame to the second: leaving the book’s spine along the z-axis, but facing away from me. The second rotation works in a similar way, but since the spine is already lined up along the z-axis, the rotation won’t affect it at all: (I chose the spine arbitrarily; you could also pick a line along the bottom of the book. This is a simple example, after all.)

Now let’s do the bottom row, starting again with the book’s spine facing up along the y-axis. The first rotation is around the z-axis: leaving the spine facing away from you. The final rotation is around the x-axis, so it won’t affect which way the spine points, just how the cover faces: Now all that might seem like a lot of work, but it’s not once you’re used to it. It’s also very easy to program a computer to do these types of manipulations, including ones for weird axes and angles other than 90°. Computers don’t make algebra mistakes, and don’t mind doing the same kinds of calculations over and over and over again (which you and I do), so this bit of 19th century mathematics is very relevant to modern computer simulations!

#### 5 Responses to “Irish mathematics for St. Patrick’s Day”

1. 1 Kudzu March 17, 2013 at 21:23

Is there a special name for numbers like root(i) or root(i)^3? Do these have any application or are they just trivial?

• 2 Matthew R. Francis March 18, 2013 at 07:49

The roots of complex numbers are still complex numbers, which can be written in the usual “real + imaginary” way. They’re a little harder to get at (you have to define them according to something called a “series expansion”), and just like the x2 = 4 has two solutions (x=2 and x=-2), the equation x2 = i has more than one solution. A lot more, in fact! However, it’s all still complex numbers: we don’t need new mathematical language to understand them.

1. 1 Celebrating Irish contributions – Beyond St. Pádraig’s Day | Words Words Words Trackback on March 17, 2013 at 19:03
2. 2 Other topics | Pearltrees Trackback on March 17, 2013 at 21:18
3. 3 Talk mathy to me: what’s the square root of i? | Galileo's Pendulum Trackback on April 9, 2013 at 10:55
Comments are currently closed.

## DrMRFrancis on Twitter

• @tauriqmoosa it'll be interesting if they ever make a show out of Silmarillion, because she starts off being one of the bad guys 13 minutes ago
• RT @elakdawalla: Thar they are! Right now Dimorphos and Didymos are both this bright dot of light. They’ll separate into two dots in a litt… 16 minutes ago
• I'm not saying I want my remains to be crashed into an asteroid, but I'm not not saying that either 16 minutes ago
• watch along with me and all the other space nerds twitter.com/JPMajor/status… 18 minutes ago
• oh hey I need to eat a little early so I can watch/livetweet a the DART spacecraft CRASHING INTO A FRIGGIN' ASTEROID yeaahhhhhhhh 19 minutes ago