What is the radius of the smallest ball that can contain three unit cubes?
In 2018, I wrote a math exam and left this as a bonus problem.
Arrange three unit cubes so that their interiors do not overlap. They may float freely in space. What is the smallest radius of a ball that can contain all three?
Back then, I suspected the optimal arrangement was T-shaped, but I couldn't prove it. Eight years later, GPT-6.2 Astra finally confirmed it.
The problem
As stated above, we want to fit three cubes of side length 1 inside the smallest possible ball. The rules are simple.
- The cubes can sit anywhere in space. Their vertices do not have to lie on an integer grid.
- Each cube can be rotated independently.
- The cubes may float in space. Only their interiors must be disjoint.
Find the minimum radius of a ball that contains all three cubes.
For a single cube, the answer is half its space diagonal,
Things get more interesting when

Its radius is
Solving gives
I had no proof that this was optimal, so I put it on the exam as a bonus question and scored it as follows.
Give enough information to determine the positions of the three cubes, such as the coordinates of four noncoplanar points, together with the center and radius of the ball. After checking which solutions are valid, rank them from smallest to largest radius and award points according to
In other words, first place gets 10 points, second place 5, third place 2.5, and so on.
As for how the scoring worked in practice, there wasn't a single submission. Ninth grade was around the corner, and even the distance between two points in space was outside the syllabus. Nobody felt like taking on my bonus problem.
Back to the problem. Here's how it was solved eight years later.
The case n = 2
The obvious candidate is the
The ball's center cannot be in the interior of both cubes, so choose a cube whose interior excludes it. In that cube's own coordinate system, at least one coordinate differs from the ball's center by a distance
For each of the other two coordinates, take the
Vu-Le's breakthrough for three squares in the plane
An important breakthrough came this September. The-Anh Vu-Le formalized the optimal packing of three unit squares in a disk in Lean 4 and published the main results and an outline of the proof on his website.
Here's the idea. As in three dimensions, the T-shaped arrangement is the candidate for the optimum. Its enclosing radius is
Draw a circle of radius
The proof shows that if three unit squares fit in a disk of radius
- The center of the disk lies outside the interior of each square.
- Each square covers at least
of the auxiliary circle's circumference.
Together, these conditions force equality. Analyzing the equality case shows that the T-shaped configuration is unique. For the details, see The-Anh's original proof.
When I brought the problem back to GPT in November, GPT-6.2 Astra used this proof as a building block. Given what I'd seen of Astra's reasoning, I doubt my paper would exist without The-Anh's proof. I wrote to thank him.
Dear Vu-Le,
I recently came across your Lean formalization of optimal packings of unit squares in a disk, and I would like to express my sincere gratitude for your work.
I have been interested in the problem of finding the smallest ball containing three unit cubes since 2018, when I was in middle school.
I recently established an exact reduction from the three-dimensional cube packing problem to its planar counterpart. Your formalization of the optimal radius and equality cases for three unit squares provided the final ingredient in proving the conjecture posed by Gensane and Ryckelynck in 2008, as well as in characterizing all optimal spatial configurations.
My manuscript is now publicly available on Zenodo:
https://zenodo.org/records/24488342
Your work helped bring a mathematical question that I had carried with me for eight years to a conclusion.
Thank you again for making your formalization publicly available.
Best regards,
Junyu Zhou
He replied in less than half an hour.
Hi Junyu,
Great work! Congratulations! Glad to know that my work helped you.
Best,
The-Anh
Proof outline for n = 3
Back to three dimensions. The main result (Theorem 1) relates the optimal radius
This gives
1. Proving the upper bound
Take a disk of optimal radius for
This proves
2. Describing the positions of the cubes with separating planes
In high school, we learned to write the equation of a plane in space as follows.
Here
The plane divides space into two sides. On the side the normal points toward,
Here we also take
This notation denotes a norm. The subscript 2 gives Euclidean distance, and 1 gives Manhattan distance (think of moving only along the coordinate axes). For a real exponent
, the general formula is
Since
Why describe planes this way? We want to turn geometric conditions we can picture into precise algebraic inequalities we can use in the proof. First, though, we need one more tool, the separating hyperplane theorem.
A set is convex if the entire line segment joining any two of its points lies in the set. A cube is convex.
The figure shows a convex set on the left and a nonconvex set on the right.
In our setting, the separating hyperplane theorem says that if two cubes have disjoint interiors, there is a plane with one cube on each side. Either cube may touch the plane.
For the three cubes
Here
We also have
We know how to describe planes algebraically. To do the same for a cube
-
Cartesian products. Think of
as the segment from to on the number line. The product describes a square with vertices . As with scalar powers, we can write this product as . Likewise, is the cube whose vertices are . -
Rotation matrices. Consider
in two dimensions first. Rotating a point 90° counterclockwise sends its coordinates to . In matrix form, Here the matrix [0 -1, 1 0] is one specific two-dimensional example of
. The rotation matrix has two defining properties, and .
We can now write any unit cube in three-dimensional space as
Here
Define
Now let's work out the formula. With
Geometrically, this aligns the cube with the coordinate axes, as shown below.
The next step is fairly direct. Write
Then
The other two terms work the same way, so
We also have
This gives our first useful formula.
Back in middle school I already had the candidate bound
Solving yields
A unit cube contains a ball of radius
Since
Swapping
3. Projecting the three cubes separately
Extending the planar result to three dimensions runs into a problem. A packing with disjoint interiors in space can overlap after projection. For example, look straight down at two cubes stacked into a
So projecting all three cubes directly won't work. Instead, we'll use the algebraic relationships from the previous section. Here is what they look like for three cubes.
By the definition of the separating planes, points in
Take the two normals
Take a point
We've now reduced the three-dimensional inequalities to two-dimensional ones.
4. Finding a unit square in each projection
So far we've projected one point at a time. Project every point in the cube
We call
Let's put aside the relationships between the three cubes for a moment and look at the projection of a single unit cube. To keep the notation light, write
What does the projection of a cube
- If you're lucky and the light shines straight down on a face, you get a square.
- If exactly four cube edges are parallel to
, you get a rectangle. - In the usual case, you get a hexagon with parallel opposite sides. The three pairs need not have equal lengths.
Here's the real question. Whatever the projection looks like, can we always find a square of side length 1 inside it?
The first two cases are straightforward, so let's look at the hexagon. Before getting into the details, here's a more basic question.
If we fix the cube's position and orientation, what determines the shape of its projected hexagon?
It depends on the tilt of the projection plane relative to the cube. Take the coordinate axes parallel to the three sets of cube edges and keep the ball's center as the origin. Section 2 described a plane using a unit normal and a constant. Since
A unit vector
in three dimensions can be described by two angles . The angle is measured from the -axis. To get , project the vector onto the plane and measure its angle from the -axis, as shown below.
Thus
. The geometry explains why the vector has unit length, and you can also check algebraically that the sum of the three squared coordinates is 1.
For shorthand, set
We have
Let
The hexagonal case also gives
A normal of length
There's another observation. Because
Projecting the unit vector
To set up orthogonal coordinates on
- Start with the
component. Let the angle between and be . In high school we learned the dot-product formula . It gives the signed length of the projection of along . Since is a unit vector, multiplying by gives the projection vector . Using , we can write the component along in matrix notation as . - The
component is simpler. Because and are orthogonal, subtract the first component to get .
Recall that the
This gives the compression matrix used in the paper.
That settles the projection of vectors in the horizontal plane. For example, if
The extension is simple. Given a point in space,
Handle the
Now that we can project any point in three dimensions, we can return to projecting the cube onto
For two sets
, define . For example, if , then . The same definition applies to vectors, using vector addition.
You may see what's coming. Think of the cube as a stack of planar slices, project each slice, and combine the projections with a Minkowski sum.
First, set aside the cube's position by taking a unit cube
Taking the cube to be centered at the origin is enough to show that its projection contains a unit square. We'll bring the center back when we study the radius bound.
We can now express the claim in this section's title as follows.
At last, the proof. For every
Thus
Because
But we have
The inequality follows, so every hexagonal projection contains a unit square. Adding the first two cases proves the claim. Whatever the projection direction, the projected shape contains a unit square.
5. Bounding the enclosing radius of the unit square
In the previous section, we centered the cube at the origin to study the shape of its projection. Now restore its actual center
Translating the cube does not change the shape of its projection, so the unit square from the previous section still exists. But now we have a different question. Can we find a unit square whose placement also keeps it close enough to the origin?
More precisely, take any plane
This is Lemma 2 of the paper. Recall the Rubik's cube experiment from Section 4. There are three cases.
| Projection shape | Condition |
|---|---|
| Square | |
| Rectangle | |
| Hexagon |
In the square case, of the top and bottom faces, at least one lies at distance from the
Now take
For the first part, let
Proof. For any
, since , we have
For every
, substitute and add to both sides to obtain the identity
We also have
This proves the inclusion.
Geometrically, we've shown that the square has room to move along
Recall the projection formula
Remember that translating a cube moves its projection without changing its shape. For a cube anywhere in space, shift the boxed inclusion for
For the second part, choose a center from the range on the left. Take
The paper takes the number of smallest absolute value in
The two vectors are the orthogonal projections of the cube's center onto the
Now that we know where the center is, we need to account for the whole square. The goal is to find the distance from the origin to the square's farthest point. In Section 2, we derived the corresponding formula for the cube.
In Section 4 we already aligned the axes with the cube's edges, so the rotation matrix
The same calculation as in Section 2 gives the two-dimensional formula.
Plug
We know
6. Adjusting the separating directions so the three planes can be aligned
It's time to return to how the three cubes relate to each other. Bring back the indexed notation
The rest of the proof uses these three properties.
In Section 1 we proved
We need a geometric transformation that puts the squares in a position where
- They lie in a single plane.
- Their distances from the origin do not increase, preserving the radius bound from Section 5.
- Their interiors remain disjoint.
There's good news and bad news. We can satisfy the first two by rotating about the origin. Keeping the interiors disjoint takes more care, and that's the problem in this section.
In Section 2, we introduced separating planes to express disjoint interiors as inequalities. The constructions in Sections 3–5 carry those inequalities over to the squares. Take
Using
If the two squares are already coplanar, these inequalities put them on opposite sides of the same line. So all we need to do is preserve their separation.
If you've read this far, you've probably noticed the same idea running through the preceding sections. We start with a geometric question about overlap, put it into algebraic language, and turn it into precise inequalities that we can prove. This is one of the reasons to learn linear algebra in the first place.
What happens to these separating relationships when we rotate the three planes?
Before we go on, here's what I mean by rotation. In three dimensions we can pick any line through the origin and rotate the entire shape around it. We can then choose a different axis for the next rotation. Try this with a Rubik's cube if you have one handy.
From Section 2, each rotation corresponds to a matrix
. Two successive rotations give the product , itself a rotation matrix. Any sequence of rotations preserves the shape, its size, distances from the origin, and angles between vectors.
Rotate
The catch is that we rotate the three planes separately. Two normals that originally satisfied
Start with just two planes. Both
Use that line as the axis and rotate
Recall from Section 3 that
If the planes already coincide, there's no rotation to make. That settles the two-plane case.
Now suppose
Next rotate about the axis
We now have
Why might the last pair fail to match? Rotating a plane preserves the angle between its two normals. For later use, define
This is the angle between the two separating normals in a plane. In particular,
Angles satisfy a triangle inequality, much like absolute values. Take three unit vectors
We want to prove
Proof. If
, the result follows immediately from . So suppose . As in Section 4, decompose
into components parallel to and components perpendicular to . By the Pythagorean theorem,
Now take the dot product. The cross terms vanish by orthogonality, and Cauchy–Schwarz gives
Cosine decreases on
, so This proves the inequality.
Back to our goal. A sufficient condition for all three pairs of unit normals to point in opposite directions is
On the other hand, using equality of vertical angles, the triangle inequality, and
So we want the three angles to sum to
Rotating an entire plane preserves the angle between its two normals. We need to do something else. Keep each square fixed and adjust the directions of the separating normals while preserving the inequalities. This is the job of Lemma 3.
As in Sections 4 and 5, focus on a single square
Suppose the following three conditions hold.
is a unit square, and every point in it is within of the origin. . - At least one of
is nonnegative.
Then for any
That's the main statement of Lemma 3. Picture keeping the square fixed and turning both separating lines so the angle between their normals shrinks. The square stays on the required side of each line throughout. You can make the angle as small as you like, all the way down to zero.
Let's prove it. Since we're looking at one square, we can align the axes with its edges without moving the origin, just as we did for the cube in Section 4. Write the center as
The first hypothesis of Lemma 3 gives
By the third hypothesis,
Substitute
To tell which normals satisfy the separating inequalities, define
Now compute
Since
Now consider which values of
Substituting our bounds
The second hypothesis of Lemma 3 is
- For
, we have . The earlier bounds give . Since decreases and increases, the whole expression is nonincreasing. - For
, we have . Both and increase, so the whole expression is nondecreasing.
This gives the observation we need. Turning a separating normal toward the positive
We can now tune the angle between the normals to any value we want. Let the directed angles of
Write the two normals during this rotation as follows.
Both
Now define
We have
Since
is continuous on , for every there is at least one
with .
By the monotonicity of
Take
A careful reader may have noticed that because the angles shrink linearly,
. So we don't even need the intermediate value theorem here.
Now we can apply the lemma to the three original squares. Bring back the indexed notation
is a unit square, and every point in it is within of the origin. . - At least one of
is nonnegative.
Once again, there's good news and bad news.
- The bad news is that Section 5 (see also the second property at the start of Section 6) and Section 2 give us the first two hypotheses, respectively, as long as the enclosing ball has radius at most
. The third may fail. - The good news is that the third hypothesis can fail for at most one of the three squares.
The proof is short. Suppose without loss of generality that both
and fail the third hypothesis. Then But
, and two opposite real numbers cannot both be negative. This is a contradiction.
Recall that
There are two cases.
- If all three squares satisfy Lemma 3, all three angles can shrink as needed. Multiply each by
. - Otherwise, assume without loss of generality that
fails the lemma's hypotheses. Since , we can multiply the other two angles by . If , then , and the sum is already .
In either case, apply Lemma 3 to every square whose angle needs to change.
Denote the adjusted separating normals by
The original separating inequalities still hold.
At the same time,
The three local angles now sum to
7. Fitting the three squares into one disk
At the beginning of Section 6 we tried rotating the three planes into one, but we couldn't ensure that the last pair of normals would point in opposite directions. Here's the full stack of subproblems we worked through.
Prove the lower bound for the 3D packing radius
└── Fit the three squares into one disk
└── Rotate the three local planes until they coincide
└── Keep the interiors of the three squares disjoint
└── Make each pair of separating normals point in opposite directions
└── Make the three local angles sum to π
├── Show that the original angles sum to at least π
│ └── Prove the triangle inequality for angles
├── Show that angles can shrink while preserving the separation inequalities
│ └── Lemma 3
│ ├── Bound the coordinates of the square's center
│ ├── Define and compute the minimum projection M(φ)
│ ├── Rule out normals pointing into the left half-plane
│ ├── Prove monotonicity of M(φ)
│ └── Construct a continuous way to shrink the angle
├── Handle a square that fails the hypotheses of Lemma 3
└── Choose the three new angles
We've solved the innermost subproblems, so we can work our way back up the stack to rotating the planes.
Prove the lower bound for the 3D packing radius
└── Fit the three squares into one disk
└── Rotate the three local planes until they coincide
└── Keep the interiors of the three squares disjoint
└── Make each pair of separating normals point in opposite directions ← You are here
└── Make the three local angles sum to π [Solved]
Keep
Once the planes coincide, we can still rotate by
The preceding section gave
Now consider
Repeat the procedure we used for
Prove the lower bound for the 3D packing radius
└── Fit the three squares into one disk
└── Rotate the three local planes until they coincide
└── Keep the interiors of the three squares disjoint ← You are here
└── Make each pair of separating normals point in opposite directions [Solved]
Back up another level. A rotation preserves the dot product, so the rotated squares still satisfy the separating inequalities. For example, rotate
Our rotations give
The two squares lie on opposite sides of a single separating line. The same argument applies to the other two pairs. We finally have three coplanar unit squares with disjoint interiors.
Prove the lower bound for the 3D packing radius
└── Fit the three squares into one disk ← You are here
└── Rotate the three local planes until they coincide [Solved]
└── Keep the interiors of the three squares disjoint [Solved]
One level up, how large a disk do we need to contain these three squares?
Rotation about the origin preserves distances from it, so the radius bound from Section 5 still holds. Since
Suppose the original three cubes fit in a ball of radius
This reduces packing three unit cubes in a ball of radius
Prove the lower bound for the 3D packing radius ← You are here
└── Fit the three squares into one disk [Solved]
By definition of
Squaring both sides and rearranging gives
Recall from Section 2 that our argument assumed
So the lower bound holds for the enclosing radius
And that's the last item off the stack.
8. Putting the bounds together
Sections 2–7 gave
Substitute The-Anh's planar optimum
This settles the conjecture Gensane and Ryckelynck posed 18 years ago.
There is some freedom even at the optimum. With the three centers of the original T-shaped arrangement fixed, a horizontal rotation of the top cube can still attain the optimal radius
Afterword
That summer in 2018, I got
On December 4, 2026, I finally knew.
There wasn't any special reason I was still willing to spend this much time on the problem eight years later, or to write this long a post about it.
I never felt I needed to find a better reason.
I just wanted to know.
The last bonus question on my 2018 math exam finally has a solution.
References
- T. Gensane and P. Ryckelynck, Producing dense packings of cubes. Discrete Mathematics, 308(22), 5230–5245, 2008.
- T. Montanher, A. Neumaier, M. C. Markót, F. Domes and H. Schichl, Rigorous packing of unit squares into a circle. Journal of Global Optimization, 73, 547–565, 2019.
- T.-A. Vu-Le, Optimal packings of one to seven unit squares in a disk. Lean 4 formalization, Palomar Registry, PALOMAR-2026-10-02-000002, 2026.
- J. Zhou, The smallest ball containing three unit cubes. Zenodo, 2026.