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:

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.

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 4*k* 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”

[…] And for science and mathematics, there is Sir William Hamilton, who made enormous contributions to modern physics and mathematics. (With this nice St. Pádraig’s Day tribute on Galileo’s Pendulum). […]

[…] Irish mathematics for St. Patrick’s Day | Galileo's Pendulum […]

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

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 x

^{2}= 4 has two solutions (x=2 and x=-2), the equation x^{2}= i has more than one solution. Alotmore, in fact! However, it’s all still complex numbers: we don’t need new mathematical language to understand them.[…] usual sense. For hints on how to define rotations in a more rigorous way, see my earlier posts on quaternions, Clifford algebras, and complex numbers. I was attempting to use an analogy to clarify how we can […]