# A Square Peg in a Round Hole

First a little background …

 I love rockets. I love to read about them (I even studied them at university). It’s probably no surprise that I also like the movie Apollo 13. This movie documents, reasonably accurately, the fateful events that occurred during this mission.
 As you may know, one the many issues that occurred during the flight was the escalating levels of Carbon Dioxide in the lunar module. To reduce the, potentially lethal, level of this gas required the insertion of a “scrubber” canister (A Lithium Hydroxide filter) into the air-circulation system. The problem, however, was that the circulation system in the lander (which they were using as a lifeboat) used cylindrical canisters, but the spare scrubber cartridges they had were square in section.
 What they needed to do was find a way to fit a square peg into a round hole!
 ←  CO2 molecule

Below is a picture of their solution [Photo Credit: NASA], hastily thought up by Mission Control engineers using, amongst other things, scavenged lunar suit hose and tape! (I like engineers).

### Now on to the puzzle

Watching the movie again, and hearing the square peg, round hole, quote once more made me think of an interesting puzzle:

Which is a better fit? A round peg in a square hole, or a square peg in a round hole?

Let me explain with two pictures. On the left we have a square hole with a round plug fitting as tight as possible. On the right, we have the opposite; a round hole with a tightly fitting square plug.

Which is a better fit? For the purpose of definitions, I will define better fit as being the configuration that blocks out the highest percentage of the original opening.

In the above examples, you can see the gaps displayed in pink. We’re looking for the solution that has the lowest percentage of pink as a ratio of the original hole (or the highest percentage of coverage by the plug, if you are glass half-full kind of person …)

The math is not too difficult, it's just a little geometry.

### Square Hole and Round Peg

 Let us define the length of the side of the square as a The area of the square hole is therefore a2 A tightly fitting round plug in this hole will have radius a/2 The area of this circle is π (a/2)2 The ratio of coverage therefore = πa2/4 : a2 Which simplifies to: π / 4

### Round Hole and Square Peg

 Let us define the radius of the round hole as b The area this round hole is πb2 A tight fitting square has a major diagonal the same as the circle, and so the length of the edge side of the square is b√2 (Pythagoras is our friend.) The area of this square is 2b2 There ratio of coverage, therefore, is = 2b2 : πb2 This simplifies to: 2 / π

# The results

 It’s close, but π/4 > 2/π, so it’s more efficient to put a round peg in a square hole than the other way around!

 I mentioned this puzzle to my father (also an engineer), and he said: “Of course, in real life, if you needed to block a square hole with a round peg, you’d simply cut-off the correct length of cylindrical bar, rotate it 90 degrees and slide it sideways into the hole – Problem Solved!” This reminded me of puzzle found in an old magic book I received when I was a eight years old …

# Square, Triangle, Circle …

 Similar to the my dad’s suggestion above, the puzzle is to carve a cork (bung, plug, stopper …) so that it could be tightly inserted into three different shaped holes. A square hole, a round hole, and a triangular hole.

# … Three independant dimensions …

 The solution is to produce a 3D object, such that it is possible to make 2D projections of, that conform to each of the shapes of the different holes. (Imagine shining a light onto the 3D shape and looking at the shape of the shadow it creates).

One possible solution is shown above. The picture above shows the PLAN, FRONT and SIDE elevations.

# … Animation

 Having difficulty visualizing this? Watch this short animation. Click on the image to the right to view a Quicktime animation of this shape. (If you can't get that to work, try this slightly larger WMV version instead.)

# Other regular polygons

 It's possible to expand our analysis to cover shapes other than square section. For instance, how well would an equilateral triangle fill a circular hole, and vice-vera? On the left are renderings of regular pentagon and regular hexagon solutions.

To the right are the coverage percentages for a selection of regular n-sided polygons in a tabular format.

The left column gives the number of sides on the polygon (4=Square, 5=Regular Pentagon …)

The middle column shows what percentage coverage a tightly fitting polygon of this order will achieve in a circular hole. The right column gives the percentage coverage a circular plug would make in a polygon with that number of sides.

Looking at row 4 (a square), the percentage coverage in a circular hole is 63.662% (which is 2/π), and the percentage coverage for a square hole is 78.540% (which is π/4).

Polygon #  Circle Hole  Polygon Hole
341.350%60.460%
463.662%78.540%
575.683%86.481%
682.699%90.690%
787.103%93.194%
890.032%94.806%
992.073%95.905%
1093.549%96.688%
1194.650%97.266%
1295.493%97.705%
1396.152%98.046%
1496.677%98.316%
1597.101%98.534%
1697.450%98.712%
1797.739%98.859%
1897.982%98.983%
1998.187%99.087%
2098.363%99.176%
2598.951%99.473%
5099.737%99.868%
10099.934%99.967%
25099.989%99.995%
50099.997%99.999%
1,00099.999%100.000%

As you can see, a circular plug in a regular polygon hole is always more efficient than the other way around.

For a circular hole, the percentage passes 90% coverage at a regular Octagon. A circular plug passes 90% coverage after a regular Hexagon.