The Sock Problem

A three-year-old can discover that socks followed by shoes produces a dressed foot while shoes followed by socks does not. The joke is algebraic: order matters.

Let $A$ mean “put on socks” and $B$ mean “put on shoes,” with products read right to left, as for functions: $BA$ means socks first. On a simplified state space, $BA$ is defined and reaches the intended state; $AB$ may be blocked or lead somewhere else. These are partial, state-changing operations, not group elements: they need not be invertible or defined on every state. “Non-abelian pre-schooler” is therefore analogy, not classification.

The analogy comes closest to group theory at bedtime: shoes off, then socks off, undoes $BA$, which is the pattern of the group identity $(BA)^{-1}=A^{-1}B^{-1}$.

The same idea appears more cleanly in rotations. Rotate a book around one axis and then another; reverse the order and its final orientation generally changes (Fig. 1). The operations are well-defined rotations, and in three dimensions they do not generally commute.

Figure 1. The same two quarter-turns in opposite orders leave the book in different orientations. The book (edges 3 : 2 : 0.6, arrow towards the top of the cover) starts flat and turns $90^\circ$, right-handed, about the fixed $x$ axis and then the fixed $y$ axis (upper row), or in the other order (lower row). Each book is drawn from the matrices $R_yR_x$ and $R_xR_y$, written out under “Matrices and Quaternions”, and viewed from the $(+x,-y,+z)$ direction.

What the Developmental Studies Show

Piaget’s concrete-operational stage concerns a cluster of abilities including logical operations and reversibility, not the claim that younger children know nothing about event order. His operations are reversible actions: an action and its inverse combine to “the identity operation, leaving the state unchanged” [[1]]. The definition uses the vocabulary of groups, inverse and identity, and it asks for more than knowing an order.

Later work by Bauer and Mandler shows that children younger than three can encode and reproduce causal or temporal sequences under specified tasks. Using elicited imitation with children aged 16 to 31 months, they found ordered recall best for familiar events and for novel events with causally connected steps, and concluded that “children as young as 16 months include temporal order information in their representations of both familiar and novel events” [[2]]. Klemfuss and colleagues asked 100 children aged 30 to 61 months about stories of five unrelated actions [[3]]. The commonest error on “before” questions was to choose (name or point to) the event after the target, “more frequent than all other error types combined”, which the authors read as an order-of-encoding bias.

Those results concern memory, causal structure, question form, and temporal order in children younger than three (Bauer and Mandler) and around three to five (Klemfuss and colleagues); neither study, as far as its published description goes, involved dressing.

They do not demonstrate that toddlers represent binary operations, test $AB=BA$, understand inverses, or anticipate Hilbert-space commutators. Nor does successful sock order refute Piaget’s account of reversibility: putting garments on in order is not undoing them. The pedagogical point is modest: learners have everyday experiences in which order changes an outcome, and those experiences can motivate an algebra lesson.


Matrices and Quaternions

Two operations commute when $AB=BA$. Matrix multiplication supplies a concrete counterexample:

$$A=\begin{pmatrix}1&2\\3&4\end{pmatrix},\qquad B=\begin{pmatrix}0&1\\1&0\end{pmatrix}.$$

Then

$$AB=\begin{pmatrix}2&1\\4&3\end{pmatrix},\qquad BA=\begin{pmatrix}3&4\\1&2\end{pmatrix}.$$

The products differ. Arthur Cayley’s 1858 memoir helped establish matrix algebra as a general theory, although matrices and related arrays had earlier uses. Cayley noted at the outset that “matrices are not in general convertible” [[4]], his word for commuting.

The book of Fig. 1 is a counterexample with a picture. Let $R_x$ and $R_y$ be right-handed quarter-turns about the fixed $x$ and $y$ axes, acting on column vectors:

$$R_x=\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix},\qquad R_y=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}.$$

Turning about $x$ first gives $R_yR_x$; turning about $y$ first gives $R_xR_y$:

$$R_yR_x=\begin{pmatrix}0&1&0\\0&0&-1\\-1&0&0\end{pmatrix}\neq R_xR_y=\begin{pmatrix}0&0&1\\1&0&0\\0&1&0\end{pmatrix}.$$

For turns about the book’s own axes, which move with it, the factors in each product swap places; the two sequences still disagree.

Hamilton’s quaternions give another famous relation:

$$i^2=j^2=k^2=ijk=-1,$$

from which $ij=k$ while $ji=-k$. Hamilton’s first paper on them lists both among its defining relations [[5]]. Their noncommutativity is useful in describing three-dimensional rotations. It is not the same algebra as the cyclic transposition action used in the Messiaen article, whose transpositions commute, $T_m\circ T_n=T_{m+n}=T_n\circ T_m$; adding inversion there gives a non-commuting dihedral group of order 24, which is still not the quaternions. In an earlier version of this post I linked the two as if they were one structure; they share only the language of groups.


Quantum Operators

In classical Hamiltonian mechanics, position and momentum are coordinates on phase space and their Poisson bracket satisfies $\{x,p\}=1$. In matrix and operator quantum mechanics, the canonical relation is

$$[\hat x,\hat p]=\hat x\hat p-\hat p\hat x=i\hbar I,$$

where $I$ is the identity operator. Heisenberg’s 1925 reformulation [[6]] and Born and Jordan’s matrix treatment [[7]] are central steps in that history. The products in the commutator are compositions of linear operators. They are not literally “measure position, then measure momentum” as two laboratory instructions; sequential quantum measurement requires an additional measurement model.

For a normalised state in the relevant operator domains, Robertson’s inequality [[8]] states

$$\Delta A\,\Delta B\ge \frac12\left|\langle[\hat A,\hat B]\rangle\right|,$$

where $\Delta A$ is the standard deviation of $\hat A$ in that state and $\langle\cdot\rangle$ an expectation value. With the canonical commutator this gives

$$\Delta x\,\Delta p\ge\frac{\hbar}{2}.$$

Noncommutativity is essential to this bound, but the relationship is not simply “every noncommuting pair has a fixed nonzero uncertainty.” The expectation of a commutator can vanish in some states, and domains matter for unbounded operators. Schrödinger’s 1930 relation [[9]] also adds a covariance term to Robertson’s commutator bound:

$$(\Delta A)^2(\Delta B)^2\ge \left(\tfrac12\langle\hat A\hat B+\hat B\hat A\rangle-\langle\hat A\rangle\langle\hat B\rangle\right)^2+ \left|\tfrac{1}{2i}\langle[\hat A,\hat B]\rangle\right|^2.$$

Dropping the first term recovers Robertson’s inequality, squared.

Angular-momentum components satisfy

$$[\hat L_x,\hat L_y]=i\hbar\hat L_z$$

and cyclic permutations. The resulting lower bound is state-dependent, for example $\Delta L_x\Delta L_y\ge(\hbar/2)|\langle\hat L_z\rangle|$. This is more precise than saying no two components can ever be simultaneously sharp without specifying the state and observable pair. In a state with orbital angular-momentum quantum number $\ell=0$, all three components are sharp, with value zero, and the bound reads $0\ge0$.

The sock example and the quantum relation therefore do not have the “same reason.” They share a formal warning: do not exchange operation order until the algebra says you may.


Noncommutative Geometry

Ordinary spaces can be studied through commutative algebras of functions. Noncommutative geometry generalises this strategy to noncommutative operator algebras [[10]]. A spectral triple $(\mathcal A,\mathcal H,D)$ consists, roughly, of an algebra represented on a Hilbert space and an operator carrying geometric information, subject to technical conditions omitted here.

Chamseddine and Connes developed spectral-action models whose chosen almost-commutative geometry yields a form of the Standard Model coupled to gravity [[11]]. The finite part of their algebra, $\mathbb C\oplus\mathbb H\oplus M_3(\mathbb C)$, contains Hamilton’s quaternions $\mathbb H$. The result depends on the algebra, representation, cutoff action, symmetry breaking, and parameter assumptions. It is a research programme, not a derivation showing that “space itself” is empirically noncommutative or that all Standard Model and gravitational physics follows without input.

That is already enough range for one idea: from finite matrices to quantum observables to a programme in geometry. The preschool anecdote is the door, not the evidence.


The Lesson

Students accustomed to scalar arithmetic may overgeneralise commutativity to matrices. An instructor can answer with a book rotation or socks and shoes, provided the analogy’s missing properties are stated. Everyday action order is familiar. Abstract closure, inverses, linearity, domains, states, and uncertainty bounds are new work.

The universe is not uniformly non-abelian, either. Integer addition commutes; spatial rotations generally do not; particular quantum observables may or may not commute. Algebra tells us which situation we are in.

The child knew which garment came first. Physics begins after we stop pretending that this alone proves the commutator.

Mathematics, physics, and developmental literature checked through 2026-10-25.


References

[1] Piaget, J. (1970). Genetic Epistemology (E. Duckworth, Trans.). Columbia University Press. Lectures given at Columbia University in 1968; quoted from the first lecture in Duckworth’s translation.

[2] Bauer, P. J., & Mandler, J. M. (1989). One thing follows another: Effects of temporal structure on 1- to 2-year-olds’ recall of events. Developmental Psychology, 25(2), 197–206. DOI: 10.1037/0012-1649.25.2.197

[3] Klemfuss, J. Z., McWilliams, K., Henderson, H. M., Olaguez, A. P., & Lyon, T. D. (2020). Order of encoding predicts young children’s responses to sequencing questions. Cognitive Development, 55, 100927. DOI: 10.1016/j.cogdev.2020.100927

[4] Cayley, A. (1858). A memoir on the theory of matrices. Philosophical Transactions of the Royal Society of London, 148, 17–37. DOI: 10.1098/rstl.1858.0002

[5] Hamilton, W. R. (1844). On a new species of imaginary quantities connected with a theory of quaternions. Proceedings of the Royal Irish Academy, 2, 424–434. Read 13 November 1843. Transcription by D. R. Wilkins

[6] Heisenberg, W. (1925). Über quantentheoretische Umdeutung kinematischer und mechanischer Beziehungen. Zeitschrift für Physik, 33, 879–893. DOI: 10.1007/BF01328377

[7] Born, M., & Jordan, P. (1925). Zur Quantenmechanik. Zeitschrift für Physik, 34, 858–888. DOI: 10.1007/BF01328531

[8] Robertson, H. P. (1929). The uncertainty principle. Physical Review, 34, 163–164. DOI: 10.1103/PhysRev.34.163

[9] Schrödinger, E. (1930). [On Heisenberg’s uncertainty relation.] Sitzungsberichte der Preußischen Akademie der Wissenschaften, Physikalisch-mathematische Klasse, 1930 (XIX), 296–303. English translation and annotation by A. Angelow and M.-C. Batoni, Bulgarian Journal of Physics, 26 (1999), 193–203. arXiv:quant-ph/9903100

[10] Connes, A. (1994). Noncommutative Geometry. Academic Press. Author’s PDF

[11] Chamseddine, A. H., & Connes, A. (1996). Universal formula for noncommutative geometry actions: Unification of gravity and the standard model. Physical Review Letters, 77(24), 4868–4871. DOI: 10.1103/PhysRevLett.77.4868


Changelog

  • 2026-02-03: Corrected the Klemfuss et al. age range and encoding-order result.
  • 2026-07-11: Recast socks and shoes as a partial-operation analogy rather than the cause of quantum uncertainty; bounded developmental evidence; corrected Robertson/angular-momentum scope; and narrowed noncommutative-geometry claims.
  • 2026-10-25: Added numbered references, including Piaget, Hamilton, Heisenberg and Schrödinger. Corrected Bauer and Mandler’s ages from “between one and two years old” to 16 to 31 months, added Klemfuss et al.’s 30 to 61 months, and noted that neither study, as published, involved dressing; the summary’s “infant” is now “early”. Quoted Piaget’s definition of a reversible operation and changed “formal reversibility” to “reversibility”. Linked the Messiaen article: its transpositions commute, and its dihedral group of order 24 is not the quaternions. Added Fig. 1 with its rotation matrices, the right-to-left product convention, the inverse rule for undressing, Cayley’s “not in general convertible”, the Schrödinger relation, definitions of $I$ and $\Delta A$, an $\ell=0$ example, and the quaternions in Chamseddine and Connes’s algebra $\mathbb C\oplus\mathbb H\oplus M_3(\mathbb C)$.