Most familiar number systems are **associative**, which means that the way you group things together when multiplying makes no difference to the result:

a(bc) = (ab)c

The real numbers, the complex numbers, and even the quaternions (which are not **commutative**, so
it’s not always true that *a**b* = *b**a*) have this property.
But the 8-dimensional numbers known as the octonions are **not** associative. If we define a trilinear function called the **associator** as:

[a,b,c] =a(bc) – (ab)c

then it will not be equal to zero for a generic triple of octonions *a*, *b*, *c*.

Can we quantify this nonassociativity somehow? What if we pick our triple of octonions uniformly at random from the unit sphere in *R*^{8}, and take the average of |[*a*, *b*, *c*]|, the norm of the associator?
This idea comes from John D. Cook, who estimated the result numerically:

John D. Cook, “How close is octonion multiplication to being associative?”

The estimate he obtained for the mean of |[*a*, *b*, *c*]| was 1.095, but it might be fun (for some definition of fun) to try to obtain an exact result in closed form.

At first glance, the prospect of integrating over three 7-spheres to perform a 21-dimensional integral of an integrand that depends on octonion multiplication sounds a bit terrifying. But there are a lot of tricks we can use to whittle this down, to the point where we really just have to multiply together a few fairly easy 1-dimensional integrals. So this is the kind of thing someone like Graves, Cayley or Hamilton could probably have computed on a quiet Sunday afternoon.

To start with, we note that the associator is completely unchanged if we add an arbitrary real number *r* to any of its arguments. For example:

[a+r,b,c] =a(bc)–(ab)c+r(bc)–(rb)c= [a,b,c]

So |[*a*, *b*, *c*]| depends only on the imaginary parts of *a*, *b* and *c*. This means that a slightly simpler and still very pertinent question would have been to ask for the average of |[*x*, *y*, *z*]| when *x*, *y*, *z* are unit-norm **imaginary** octonions. We *will* actually calculate that, but first let’s see how the two averages are related.

Suppose *J* is the average of |[*x*, *y*, *z*]| over all triples of unit-norm **imaginary** octonions. If we integrate over **all** unit-norm octonions, on the 6-dimensional slice through the 7-sphere at an angle of θ from the vector *e*_{0} that we are treating as the purely real octonion 1, the norm of the imaginary part will be sin(θ), and the real part will be irrelevant.
So we can think of this larger integral as involving three scaled copies of the unit-norm imaginary octonions,
and we can pull out the common factor of *J* and just integrate over the three scaling factors:

A= average |[a,b,c]| over unit-norm octonionsa,b,c

=J× [∫_{ 0}^{π}sph(6, sin(θ)) sin(θ) dθ / sph(7, 1)]^{3}

where sph(*n*, *r*) is the *n*-volume of an *n*-sphere of radius *r*,
i.e. the set of all points at a distance of exactly *r* from the origin in *R*^{n+1}:

Whennis even, sph(n,r) = 2^{n+1}(n/2)! π^{n/2}r^{n}/n!

Whennis odd, sph(n,r) = (n+1) π^{(n+1)/2}r^{n}/ ((n+1)/2)!

So we have some constant factors times the cube of an integral of (sin θ)^{7} from 0 to π, which can easily be computed with any symbolic mathematics software, but could also be found in any decent book of mathematical tables.

The upshot is that:

A= (134217728J) / (5359375 π^{3}) ≈ 0.807693J

Now we can move on to calculating *J*, the average of |[*x*, *y*, *z*]| over all triples of unit-norm **imaginary** octonions.

Each sphere of unit-norm imaginary octonions is a 6-sphere, but we can shrink the dimensions of the overall integral from 18 down to just 4, by exploiting the action of the 14-dimensional group *G*_{2} of automorphisms of the octonions.

An **automorphism** of the octonions is just a 1-1 map from the octonions to themselves that preserves their algebraic and vector-space structure. So any element of *G*_{2} will be a real-linear map *T* that preserves the identity:

T(1)=1

and satisfies:

T(ab) =T(a)T(b) for all octonionsa,b.

Suppose we pick two orthogonal unit-norm imaginary octonions, say *e*_{1} and *e*_{2}, and a third one, say *e*_{3}, that is orthogonal to *e*_{1}, *e*_{2} and *e*_{1} *e*_{2}. (In one standard way of numbering the seven orthogonal imaginary octonions, *e*_{1} *e*_{2} = *e*_{4}.) Then if we pick **any other** three unit-norm imaginary octonions with the same properties, we can find an element of *G*_{2} that maps the first triple into the second triple, or vice versa.
This is described in more detail in section 4.1 of this paper:

John Baez, “The Octonions”

Suppose that *x*, *y*, *z* are a generic triple of unit-norm imaginary octonions. They will not be orthogonal, but we can find a unit-norm imaginary octonion *p* that is orthogonal to *x*, such that *y* lies in the plane spanned by *x* and *p*:

y=xcos α +psin α

And we can also find a unit-norm imaginary octonion *q* that is orthogonal to *x*, *p* and *x**p*, such that *z* lies in the 4-space spanned by these unit vectors:

z=xsin β cos θ +psin β sin θ cos φ +qcos β + (xp) sin β sin θ sin φ

where we have written *z* as a generic unit vector in 4-dimensional polar coordinates in the 4-space.

Because *x*, *p* and *q* are unit-norm imaginary octonions that are orthogonal to each other, and *q* is orthogonal to *x**p*, we can find an element *T* of *G*_{2} such that:

T(x) =e_{1}

T(p) =e_{2}

T(q) =e_{3}

from which it follows that:

T(xp) =e_{1}e_{2}=e_{4}

T(y) =e_{1}cos α +e_{2}sin α

T(z) =e_{1}sin β cos θ +e_{2}sin β sin θ cos φ +e_{3}cos β +e_{4}sin β sin θ sin φ

We then have:

|[x,y,z]| = |[T(x),T(y),T(z)]| = 2 |cos β sin α|

Why is this associator so simple? Because anything involving *just* *e*_{1}, *e*_{2} and *e*_{4}=*e*_{1} *e*_{2} will belong to a subalgebra of the octonions isomorphic to the quaternions, which are associative. We must have three distinct *e*_{j} involved, and one of them must be *e*_{3}, so only the *e*_{3} term of *T*(*z*) matters, and since *T*(*x*)=*e*_{1}, only the *e*_{2} term of *T*(*y*) matters. The factor of two arises because we have *x*(*y**z*) – (*x**y*)*z*, and the second product, in this case, is just the opposite of the first.

So, we can obtain the average of |[*x*, *y*, *z*]| by a suitably weighted integral of 2 |cos β sin α| over the four angular coordinates α, β, θ and φ.

Since every *x* on the first copy of the sphere of unit-norm imaginary octonions can be mapped to *e*_{1}, there is no need to integrate over the first sphere at all; we just treat *x* as being fixed at *e*_{1}.

The second vector, *y*, must lie at an angle of α from *e*_{1}, so we need a weight of sph(5, sin α)/sph(6, 1) when we integrate over α, to account for the whole 5-spheres of vectors that lie at that angle.

The third vector, *z*, is a bit trickier. We need to account for a whole 3-sphere of unit-norm vectors that simultaneously have dot products:

d_{1}= sin β cos θ, withT(x) =e_{1}

d_{2}= sin β (cos α cos θ + sin α sin θ cos φ), withT(y) =e_{1}cos α +e_{2}sin α

d_{3}= sin β sin α sin θ sin φ, withT(xy) = –e_{0}cos α +e_{4}sin α

and are purely imaginary, i.e. have dot product of 0 with the vector *e*_{0} = 1.

We can find the centre of this 3-sphere with some simple linear algebra; it lies at:

c= sin β (e_{1}cos θ +e_{2}sin θ cos φ +e_{4}sin θ sin φ)

Now |*c*| = |sin β|, which means the radius of the 3-sphere is |cos β|, so we need a weight of sph(3, |cos β|)/sph(6, 1).
But we are decomposing the 6-sphere for *z* into a whole family of 3-spheres, each of radius |cos β|,
where the parameters β, θ and φ describing the family will themselves range over a *half*-3-sphere.
This is a bit like decomposing the surface of the Earth, a 2-sphere, into a family of complete circles of latitude,
where the latitude parameter ranges over the *half*-circle of a meridian.
So we also need the standard polar coordinate measure on a (half)-3-sphere whose coordinates are β, θ and φ, which is (sin β)^{2} sin θ.

We obtain *J* by integrating:

2 |cos β sin α| sph(5, sin α) sph(3, |cos β|) (sin β)^{2}sin θ / sph(6, 1)^{2}

= (225 /(64 π)) (cos β)^{4}(sin β)^{2}(sin α)^{6}sin θ

with α from 0 to π, β from 0 to π, θ from 0 to π/2 (rather than π, because this is a half-3-sphere), and φ from 0 to 2π. We can check that these are the correct coordinate ranges by removing the associator norm we’re averaging, and seeing that we get an integral of 1.

The result is:

J= 1125 π^{2}/ 8192

which in turn means:

A= 147456 / (42875 π) ≈ 1.0947336

which reassuringly agrees with John Cook’s numerical estimate.

Thanks to Arnaud Chéritat for suggesting the title “Peeling the Octonions” after I posted an earlier version of this page on the now-defunct site Google Plus.