Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 4

Can You Tile the Hexagon?

↓ Download PDF handout

I am relaying my kitchen floor. The floor is marked out as 2424 small equilateral triangles, fitted together into a regular hexagon with two triangles along each side. My tiles are rhombuses, each one made of two of those triangles joined along a shared edge, and a tile may be laid in any of its orientations. In how many distinct ways can I cover the hexagon with these rhombuses, leaving no gaps and no overlaps?

For extra credit, my patio is a larger regular hexagon of the same kind, this time 5454 triangles, three to a side. In how many distinct ways can I tile that one?

The Fiddler, Zach Wissner-Gross, June 26, 2026(original post)

The kitchen floor: 2424 triangles in a regular hexagon of side 22, with one rhombus tile shown in blue. Figure from the source post.

Solution

A rhombus built from two triangles can lie in three orientations, one for each direction its shared edge can take. Colour those three orientations differently and something happens to any finished tiling: it stops looking flat. The hexagon reads as the inside corner of a room, and the rhombuses become the top and two visible walls of little cubes stacked into that corner (Figure 4.2). This is not a trick of the eye. It is a genuine correspondence, and it is the whole puzzle.

Here is the correspondence stated plainly. Seen corner-on, a heap of unit cubes packed into an n×n×nn \times n \times n box projects to exactly one rhombus tiling of the regular hexagon of side nn, and every tiling of that hexagon comes from exactly one heap. The heap has to be stable, with no cube left floating: reading the cube heights off the floor of the box as an n×nn \times n grid, the heights can only fall as you move away from the back corner, never rise. An array of heights that is weakly decreasing along both directions, with each entry between 00 and nn, is what combinatorialists call a plane partition in the box. Tilings, stable heaps, and plane partitions are three names for one set of objects, so to count the tilings it is enough to count the plane partitions.

That count was settled by MacMahon a century ago. The number of plane partitions fitting in an a×b×ca \times b \times c box is the product M(a,b,c)=i=1aj=1bk=1ci+j+k1i+j+k2.M(a,b,c) = \prod_{i=1}^{a}\prod_{j=1}^{b}\prod_{k=1}^{c} \frac{i+j+k-1}{i+j+k-2}. For the kitchen floor the box is 2×2×22 \times 2 \times 2. Grouping the eight factors by the value of i+j+ki+j+k, which runs from 33 to 66, the product unrolls into a short cascade, M(2,2,2)=21(32) ⁣3 ⁣(43) ⁣354=2278642754=20.M(2,2,2) = \frac{2}{1}\cdot\left(\frac{3}{2}\right)^{\!3}\!\left(\frac{4}{3}\right)^{\!3}\cdot\frac{5}{4} = 2 \cdot \frac{27}{8}\cdot\frac{64}{27}\cdot\frac{5}{4} = \boxed{\,20\,}. The outlined floor is nailed to one spot, so all 2020 of these heaps are genuinely different layouts. Only if you agreed to treat two layouts as the same whenever one is a rotation or reflection of the other would the 2020 collapse, and then into 66 essentially different tilings.

One tiling of each hexagon, with the three rhombus orientations shaded as the three faces of a cube. Every tiling is a stable heap of cubes stacked into a corner, so counting tilings is counting the heaps. Left: the 2×2×22\times2\times2 box, 2020 heaps. Right: the 3×3×33\times3\times3 box, 980980.

Extra credit

Nothing changes for the patio except the size of the room. A regular hexagon of side 33 is the corner-on view of a 3×3×33 \times 3 \times 3 box, so the same formula applies with the sum i+j+ki+j+k now running from 33 to 99, M(3,3,3)=21(32) ⁣3 ⁣(43) ⁣6 ⁣(54) ⁣7 ⁣(65) ⁣6 ⁣(76) ⁣387=980.M(3,3,3) = \frac{2}{1}\left(\frac{3}{2}\right)^{\!3}\!\left(\frac{4}{3}\right)^{\!6}\!\left(\frac{5}{4}\right)^{\!7}\!\left(\frac{6}{5}\right)^{\!6}\!\left(\frac{7}{6}\right)^{\!3}\frac{8}{7} = \boxed{\,980\,}. The exponents are the numbers of ways to hit each sum with three parts from 11 to 33, namely 1,3,6,7,6,3,11,3,6,7,6,3,1, and the cascade telescopes to 980980. Up to the hexagon’s rotations and reflections these 980980 heaps fall into 113113 classes.

The patio: 5454 triangles in a regular hexagon of side 33. Figure from the source post.

The computation

The formula leans on the cube correspondence, so the honest check throws it away and counts the tilings the way the puzzle poses them, as rhombuses dropped onto triangles. Model the hexagon as its set of unit triangles; two triangles that share an edge can be capped by a single rhombus; and a full tiling is a way to pair off every triangle with such a neighbour. That is a perfect matching of the triangle-adjacency graph, and each matching is one tiling.

  1. Build the side-nn hexagon as the 2n×2n2n \times 2n lattice rhombus with its two opposite corners cut off, keeping every unit triangle whose three vertices survive the cut.

  2. Join two triangles whenever they share exactly two vertices, that is, an edge.

  3. Backtrack: take the first triangle not yet covered, pair it with each still-free neighbour in turn, recurse, and count the pairings that cover everything.

from fractions import Fraction

# Regular hexagon of side n = the 2n x 2n lattice rhombus with its two opposite
# corners cut. Vertex (p,q) is IN iff 0<=p<=2n, 0<=q<=2n, n<=p+q<=3n.
# Up-triangle U(p,q): (p,q),(p+1,q),(p,q+1);  Down D(p,q): (p+1,q),(p,q+1),(p+1,q+1).
def hexagon(n):
    inside = lambda v: 0 <= v[0] <= 2*n and 0 <= v[1] <= 2*n and n <= v[0]+v[1] <= 3*n
    tris = []
    for p in range(2*n+1):
        for q in range(2*n+1):
            for vs in [((p,q),(p+1,q),(p,q+1)), ((p+1,q),(p,q+1),(p+1,q+1))]:
                if all(inside(v) for v in vs):
                    tris.append(frozenset(vs))
    return tris

def count_tilings(n):
    tris = hexagon(n); N = len(tris)
    adj = [[] for _ in range(N)]
    for i in range(N):                       # neighbours share exactly one edge (2 vertices)
        for j in range(i+1, N):
            if len(tris[i] & tris[j]) == 2:
                adj[i].append(j); adj[j].append(i)
    covered = [False]*N
    def rec():                               # perfect matchings = rhombus tilings
        u = next((k for k in range(N) if not covered[k]), -1)
        if u == -1:
            return 1
        total = 0; covered[u] = True
        for v in adj[u]:
            if not covered[v]:
                covered[v] = True; total += rec(); covered[v] = False
        covered[u] = False
        return total
    return N, rec()

def macmahon(a, b, c):                        # plane partitions in an a x b x c box
    prod = Fraction(1)
    for i in range(1, a+1):
        for j in range(1, b+1):
            for k in range(1, c+1):
                prod *= Fraction(i+j+k-1, i+j+k-2)
    return int(prod)

for n in (2, 3):
    N, t = count_tilings(n)
    print(f"side {n}: {N} triangles | tilings = {t} | MacMahon = {macmahon(n,n,n)}")
# side 2: 24 triangles | tilings = 20 | MacMahon = 20
# side 3: 54 triangles | tilings = 980 | MacMahon = 980

The direct rhombus count agrees with MacMahon’s product in both cases: 2020 ways to tile the kitchen, 980980 to tile the patio.