Dudeney’s four-piece dissection transforms an equilateral triangle into a square. Its optimality for polygonal pieces rearranged without turning them over was established by Demaine, Kamata and Uehara in *Dudeney’s Dissection Is Optimal* (2026), https://doi.org/10.4230/LIPIcs.ITCS.2026.47 . This article traces the puzzle’s history and “inside-out” geometry, then develops an exact three-dimensional motion that preserves all four connections as a closed loop. Wolfram Language derives the required pivot displacement symbolically and verifies rigidity, loop closure, and exact square reassembly. An interactive animation combines the classical planar motion with the spatial return.

Historical notes

The Haberdasher’s problem asks how few pieces are needed to turn an equilateral triangle into a square of the same area. Henry Ernest Dudeney posed it in the Weekly Dispatch on 6 April 1902 and published the familiar four-piece solution four weeks later, crediting reader C. W. McElroy with a four-piece solution. It became puzzle 26 in The Canterbury Puzzles (1907), where a fictional haberdasher challenges his fellow pilgrims to square a triangular piece of cloth. Dudeney also described a polished mahogany model with brass hinges, whose pieces remained connected as they swung between the two shapes. He exhibited the puzzle before the Royal Society in 1905. [1, 2]
Four pieces worked, but could three suffice? That question remained open for 122 years. In December 2024, Erik Demaine, Tonan Kamata and Ryuhei Uehara released the proof subsequently published as Dudeney’s Dissection Is Optimal in January 2026. They ruled out every dissection into three or fewer polygonal pieces rearranged by translations and rotations, without turning pieces over. The breakthrough established the minimum number of pieces; whether the familiar four-piece dissection is the only one remains an open question. [2]
The puzzle belongs to the broader mathematics of dissection. The Wallace–Bolyai–Gerwien theorem guarantees that any two polygons of equal area can be cut into finitely many pieces and reassembled into one another. A much later result, Hinged Dissections Exist, established that the pieces can also remain connected in a chain and move continuously in the plane without intersecting. Such general constructions may require many more pieces than Dudeney’s four. [3]
Dudeney’s construction has a further property: the triangle’s outside boundary becomes internal seams in the square, while its internal cuts become the square’s outside boundary. This exchange gives “inside out” a precise meaning. It is an example of a reversible hinged dissection, a subject developed by Akiyama and collaborators and connected to different unfoldings of polyhedra. In the classical planar motion, three hinges keep the four pieces connected; the two ends of the chain meet in both finished shapes. Preserving that fourth connection throughout the motion introduces an additional constraint. [4, 5]
Frederickson’s 2010 survey includes a seven-piece triangle–square dissection with twisting hinges. Walser’s 2019 study, crediting an idea by Patrik Wiesner, describes a closed loop of the four classical pieces arranged in parallel layers so they can pass over one another. [6, 7]
The construction here takes Sándor Kabai’s triangle–rectangle animation as its starting point. [8] Applying the fixed-pivot rotation pattern considered here to the classical triangle–square cuts leaves small gaps. An exact, continuous displacement added to the rotations preserves all four connections and produces the correct square while keeping every piece rigid. For this rotation pattern, the additional translation never exceeds approximately 0.90% of the triangle’s side length.
The symbolic calculation below derives that displacement from the requirement that connected corners remain together, then verifies rigidity, closure of the loop, and agreement with the classical square arrangement. The animation combines the planar triangle-to-square motion with the spatial return, preserving the fourth connection throughout the spatial part.

Construction

In[]:=
Clear[q,u,v,w,dx,dy,dz,vx,vy,vz];
Symbolic hinge positions
d={0,0,0};​​e={w,0,0};​​j={u,v,0};​​k=j+e;​​rx=RotationMatrix[q,{1,0,0}];​​ry=RotationMatrix[q,{0,1,0}];​​delta={dx,dy,dz};
Derive the shift from both joint connections
In[]:=
shift=FullSimplify[delta/.First@Solve[Thread[Join[j+delta,k+delta]==Join[ry.j,e+ry.(k-e)]],delta]]
Out[]=
{u(-1+Cos[q]),0,-uSin[q]}
Transformation in 3D
f={rx.ry.#&,#&,rx.(j+rx.(#-j)+shift)&,e+rx.ry.(#-e)&};
In[]:=
p={vx,vy,vz};​​r=DiagonalMatrix[{-1,-1,1}];
In[]:=
checks=FullSimplify[{Transpose[rx].rx==IdentityMatrix[3]&&Transpose[ry].ry==IdentityMatrix[3],{f[[1]][d],f[[2]][e],f[[4]][k],f[[3]][j]}=={f[[2]][d],f[[4]][e],f[[3]][k],f[[1]][j]},((#[p]&/@f)/.q->Pi)=={r.p,p,p+2(e-k),e+r.(p-e)}},Element[q,Reals]]
Out[]=
{True,True,True}
Substitute the exact classical geometry
h=Sqrt[4Sqrt[3]-3];​​values={u->(2-h)/2,v->-Sqrt[3]/2,w->1}
Out[]=
u
1
2
2-
-3+4
3
,v-
3
2
,w1
In[]:=
<|"Symbolic shift"->shift,"Classical shift"->FullSimplify[shift/.values],"Checks"->checks|>
Out[]=
Symbolic shift{u(-1+Cos[q]),0,-uSin[q]},Classical shift-2+
-3+4
3

2
Sin
q
2

,0,
1
2
-2+
-3+4
3
Sin[q],Checks{True,True,True}

Animation

Manipulate​​Module{t=1-Abs[1-s],q,h=Sqrt[4Sqrt[3]-3],a,b,c,d,​​e,j,k,l,m,p,shift,x={1,0,0},y={0,1,0},​​z={0,0,1},​​range={{-.8,3.1},{-1,2.3},{-2,2}}},{a,b,​​c}={{0,0,0},{1,Sqrt[3],0},{2,0,0}};​​{d,e}={a+b,b+c}2;​​j={(3-h)/2,0,0};​​k=j+x;​​l={2+Sqrt[3],2Sqrt[3]-h,0}4;​​m={10-Sqrt[3]-2h,h,0}4;​​q=Pit;​​shift=RotationTransform[q,y,d][j]-j;​​p={{{RGBColor[.9,.42,.17],Polygon[{a,d,l,j}]},​​Sphere[j,.04]},{{RGBColor[.49,0,0],Polygon[{b,d,l,e}]},​​Sphere[d,.04],Sphere[e,.04]},{RGBColor[.88,.63,.23],​​Polygon[{j,m,k}]},{{RGBColor[.48,.11,.56],​​Polygon[{c,e,m,k}]},Sphere[k,.04]}};​​Graphics3D{GrayLevel[.2],EdgeForm[Thin],​​Rotate[If[​​s<=1,{Rotate[p[[1]],-q,z,d],p[[2]],​​Translate[Rotate[p[[3]],2q,z,k],​​RotationTransform[q,z,e][k]-k],Rotate[p[[4]],q,z,e]},​​Rotate[{Rotate[p[[1]],q,y,d],Rotate[p[[2]],-q,x,d],​​Translate[Rotate[p[[3]],q,x,j],shift],​​Rotate[p[[4]],q,y,e]},q,x,d]],-t/1.4,z,b]},​​
,​​{{s,0,"cycle"},0,2},​​SaveDefinitions->True
Out[]=
​
cycle

Understanding the 3D motion

The previous animation performed the individual piece rotations and the rotation of the whole assembly simultaneously. This version separates those motions so we can see what each one does. The slider moves forward through three stages:
1
.
Individual 3D turns: 0 → 0.5.​
Each of the four pieces rotates 180°, following the half-turn idea in Sándor’s example. The yellow piece also translates slightly as it rotates. This additional adjustment keeps its two joints connected to the neighboring pieces, closing the gaps throughout the motion. Every piece retains its shape, and the connected loop becomes a square.
2
.
Whole-square alignment: 0.5 → 1.​
We have a square, but its colored pieces form a mirror image of the arrangement produced by the planar transformation. Sliding or rotating the square within the plane cannot make those arrangements match. We therefore turn the entire square over by 180° in 3D and rotate it within the plane into the required position. During this step, the pieces move together as one rigid assembly; all joints remain connected.
3
.
Planar return: 1 → 2.​
The square now matches the endpoint of the earlier 2D transformation, piece for piece. Running that transformation backward returns it to the starting triangle. One connection opens during this planar motion and closes again at the end, completing the animation cycle.
This also explains why the brown piece stayed flat in the previous animation. Its individual rotation and the whole-assembly rotation were equal and opposite, canceling at every moment. Here, the brown piece completes its own half-turn first, then turns again with the assembled square. The same component rotations become visible separately.
In[]:=
Manipulate[​​ Module[{t, q, u, h = Sqrt[4 Sqrt[3] - 3],​​ a, b, c, d, e, j, k, l, m, p, shift,​​ x = {1, 0, 0}, y = {0, 1, 0}, z = {0, 0, 1},​​ range = {{-.8, 3.1}, {-1, 2.3}, {-2, 2}}},​​​​ (* 0 to 1/2: individual 180-degree turns with yellow translation.​​ 1/2 to 1: whole-square flip and in-plane alignment.​​ 1 to 2: planar return to the triangle. *)​​​​ t = If[s <= 1, Min[2 s, 1], 2 - s];​​ u = If[s <= 1, Max[0, 2 s - 1], 2 - s];​​ q = Pi t;​​​​ {a, b, c} = {{0, 0, 0}, {1, Sqrt[3], 0}, {2, 0, 0}};​​ {d, e} = {a + b, b + c}/2;​​ j = {(3 - h)/2, 0, 0};​​ k = j + x;​​ l = {2 + Sqrt[3], 2 Sqrt[3] - h, 0}/4;​​ m = {10 - Sqrt[3] - 2 h, h, 0}/4;​​​​ (* Yellow-piece translation keeps both joints connected. *)​​ shift = RotationTransform[q, y, d][j] - j;​​​​ p = {​​ {{RGBColor[.9, .42, .17], Polygon[{a, d, l, j}]},​​ Sphere[j, .04]},​​ {{RGBColor[.49, 0, 0], Polygon[{b, d, l, e}]},​​ Sphere[d, .04], Sphere[e, .04]},​​ {RGBColor[.88, .63, .23], Polygon[{j, m, k}]},​​ {{RGBColor[.48, .11, .56], Polygon[{c, e, m, k}]},​​ Sphere[k, .04]}​​ };​​​​ Graphics3D[​​ {GrayLevel[.2], EdgeForm[Thin],​​ Rotate[​​ If[s < 1,​​​​ (* 3D triangle -> square *)​​ Rotate[​​ {​​ Rotate[p[[1]], q, y, d],​​ Rotate[p[[2]], -q, x, d],​​ Translate[Rotate[p[[3]], q, x, j], shift],​​ Rotate[p[[4]], q, y, e]​​ },​​ Pi u, x, d],​​​​ (* 2D square -> triangle *)​​ {​​ Rotate[p[[1]], -q, z, d],​​ p[[2]],​​ Translate[Rotate[p[[3]], 2 q, z, k],​​ RotationTransform[q, z, e][k] - k],​​ Rotate[p[[4]], q, z, e]​​ }​​ ],​​ -u/1.4, z, b]},​​ ViewMatrix -> {​​ TransformationMatrix[RescalingTransform[range]],​​ DiagonalMatrix[{1, 1, -1, 1}]},​​ PlotRange -> range,​​ AspectRatio -> 11/13,​​ Boxed -> False]​​ ],​​ {{s, 0, "cycle"}, 0, 2,​​ ControlType -> Animator,​​ AnimationDirection -> Forward,​​ AnimationRepetitions -> Infinity,​​ AnimationRate -> .2,​​ AnimationRunning -> False},​​ SaveDefinitions -> True​​ ]

References

1
.
Dudeney, H. E. (1919). The Canterbury Puzzles and Other Curious Problems, second edition. Thomas Nelson and Sons. Puzzle 26 and its solution; first edition published in 1907.
2
.
Demaine, E. D., Kamata, T., and Uehara, R. (2026). “Dudeney’s Dissection Is Optimal.” 17th Innovations in Theoretical Computer Science Conference (ITCS 2026), LIPIcs 362, 47:1–47:22. Preprint first posted 5 December 2024.
3
.
Abbott, T. G., Abel, Z., Charlton, D., Demaine, E. D., Demaine, M. L., and Kominers, S. D. (2012). “Hinged Dissections Exist.” Discrete & Computational Geometry 47(1), 150–186. DOI: 10.1007/s00454-010-9305-9. Conference version published in 2008.
4
.
Akiyama, J., Demaine, E. D., and Langerman, S. (2020). “Polyhedral Characterization of Reversible Hinged Dissections.” Graphs and Combinatorics 36(2), 221–229. DOI: 10.1007/s00373-019-02041-2.
5
.
Akiyama, J., Langerman, S., and Matsunaga, K. (2026). “Unveil the Secret Hidden in the Haberdasher’s Puzzle—Survey on Reversibility.” In J. Akiyama, H. Ito, and T. Sakai (eds.), Discrete and Computational Geometry, Graphs, and Games, LNCS 14364, 64–82. Springer. First published online 11 August 2025.
6
.
Frederickson, G. N. (2010). “Hugo Hadwiger’s Influence on Geometric Dissections with Special Properties.” Elemente der Mathematik 65(4), 154–164. DOI: 10.4171/EM/155.
7
.
Walser, H. (2019; revised 2020). “Dudeney.” Geometric study and animations, crediting an idea by Patrik G. K. Wiesner.
8
.
Kabai, S. (2021). “Wallace-Bolyai-Gerwien theorem for triangles and rectangles.” Wolfram Community, 21 April 2021.

CITE THIS NOTEBOOK

Triangle inside-out is a square: looped 2D-3D transform for optimal Dudeney's dissection​
by Vitaliy Kaurov​
Wolfram Community, STAFF PICKS, October 6, 2026
​https://community.wolfram.com/t/28274