Peg

DOWNLOAD Mathematica Notebook Pegs

The answer to the question "which fits better, a round peg in a square hole, or a square peg in a round hole?" can be interpreted as asking which is larger, the ratio of the area of a circle to its circumscribed square, or the area of the square to its circumscribed circle? In two dimensions, the ratios are pi/4 and 2/pi, respectively. Therefore, a round peg fits better into a square hole than a square peg fits into a round hole (Wells 1986, p. 74).

PegRatio

However, this result is true only in dimensions n<9, and for n>=9, the unit n-hypercube fits more closely into the n-hypersphere than vice versa (Singmaster 1964; Wells 1986, p. 74). This can be demonstrated by noting that the formulas for the content V(n) of the unit n-ball, the content V_c(n) of its circumscribed hypercube, and the content V_i(n) of its inscribed hypercube are given by

V(n)=(pi^(n/2))/(Gamma(1/2n+1))
(1)
V_c(n)=2^n
(2)
V_i(n)=(2^n)/(n^(n/2)).
(3)

The ratios in question are then

R_(round peg)=(V(n))/(V_c(n))=(pi^(n/2))/(2^nGamma(1/2n+1))
(4)
R_(square peg)=(V_i(n))/(V_c(n))=(2^nGamma(1/2n+1))/(n^(n/2)pi^(n/2))
(5)

(Singmaster 1964). The ratio of these ratios is the transcendental equation

 (R_(round peg))/(R_(square peg))=(pi^nn^(n/2))/(2^(2n)[Gamma(1+1/2n)]^2),
(6)

illustrated above, where the dimension n has been treated as a continuous quantity. This ratio crosses 1 at the value n approx 8.13794 (OEIS A127454), which must be determined numerically. As a result, a round peg fits better into a square hole than a square peg fits into a round hole only for integer dimensions n<9.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.