<<

A reprint from American Scientist the magazine of Sigma Xi, The Scientific Research Society

This reprint is provided for personal and noncommercial use. For any other use, please send a request Brian Hayes by electronic mail to [email protected]. C!"#$%&'( S)&*')*

An Adventure in the Nth

Brian Hayes

+* ,-*, *').!/*0 by a is cal term for a solid spherical object. πr2. The volume inside a “Sphere” itself is generally reserved 3 On the mystery T4 3 is ∕ πr . These are formulas I learned too for a hollow shell, like a soap bubble. early in life. Having committed them to More formally, a sphere is the locus memory as a schoolboy, I ceased to ask of a ball that fills of all points whose distance from the questions about their origin or mean- center is equal to the radius r. A ball ing. In particular, it never occurred to a box, but vanishes is the locus of points whose distance me to wonder how the two formulas from the center is less than or equal are related, or whether they could be in the vastness to r. And while I’m trudging through extended beyond the familiar world this mire of terminology, I should men- of two- and three-dimensional objects of higher tion that “n-ball” and “n-cube” refer to the geometry of higher-dimensional to an n-dimensional object inhabiting . What’s the volume bounded n-dimensional . This may seem by a four-dimensional sphere? Is there too obvious to bother stating, but some master formula that gives the mea- we played on a two-dimensional field. some branches of adopt sure of a round object in n dimensions? If we had lost our ball in a space of a different convention. In topology, a Some 50 years after my first expo- many dimensions, we might still be 2-sphere lives in 3-space.) sure to the formulas for area and vol- looking for it. ume, I have finally had occasion to look The mathematician Richard Bell- The Master Formula into these broader questions. Finding man labeled this effect “the curse of An n-ball of radius 1 (a “unit ball”) the master formula for n-dimensional dimensionality.” As the number of will just fit inside an n-cube with volumes was easy; a few minutes with spatial dimensions goes up, finding sides of length 2. The of the Google and Wikipedia was all it took. things or measuring their size and ball kisses the center of each face of But I’ve had many a brow-furrowing gets harder. This is a matter of the cube. In this configuration, what moment since then trying to make practical consequence, because many fraction of the cubic volume is filled sense of what the formula is telling me. computational tasks are carried out in by the ball? The relation between volume and di- a high-dimensional setting. Typically The question is answered easily in mension is not at all what I expected; each variable in a problem description the familiar low-dimensional spaces indeed, it’s one of the zaniest things I’ve is mapped to a separate dimension. we are all accustomed to living in. At ever come upon in mathematics. I’m A few months ago I was prepar- the bottom of the hierarchy is one- appalled to realize that I have passed ing an illustration of Bellman’s curse dimensional geometry, which is rather so much of my life in ignorance of this for an earlier Computing Science col- dull: Everything looks like a line seg- curious phenomenon. I write about it umn. My first thought was to show ment. A 1-ball with r = 1 and a 1-cube here in case anyone else also missed the ball-in-a-box phenomenon. Put an with s =2 are actually the same object— school on the day the class learned n- n-dimensional ball in an n-dimension- a of length 2. Thus in one dimensional geometry. al cube just large enough to receive dimension the ball completely fills the it. As n increases, the fraction of the cube; the volume ratio is 1.0. Lost in Space cube’s volume occupied by the ball In two dimensions, a 2-ball inside a In those childhood years when I was falls dramatically. 2-cube is a inscribed in a square, memorizing volume formulas, I also In the end I chose a different and and so this problem can be solved with played a lot of ball games. Often the simpler scheme for the illustration. But one of my childhood formulas. With game was delayed when we lost the after the column appeared [“Quasi- r =1, the area πr2 is simply π, whereas ball in the weeds beyond right field. I random Ramblings,” July–August], I the area of the square, s2, is 4; the ratio didn't know it then, but we were lucky returned to the ball-in-a-box question of these quantities is about 0.79. out of curiosity. I had long thought that In three dimensions, the ball’s vol- 4 Brian Hayes is senior writer for American Scien- I understood it, but I realized that I had ume is ∕3π, whereas the cube has a vol- tist. Additional material related to the Comput- almost no quantitative data on the rela- ume of 8; this works out to a ratio of ing Science column appears at http://bit-player. tive size of the ball and the cube. approximately 0.52. org. Address: 11 Chandler St. #2, Somerville, MA (In this context “ball” is not just a On the basis of these three data points, 02144. E-mail: [email protected] plaything but also the mathemati- it appears that the ball fills a smaller and

442 American Scientist, Volume 99 © 2011 Brian Hayes. Reproduction with permission only. Contact [email protected]. smaller fraction of the cube as n increas- the , unlike the facto- But then I looked at the continuation es. There’s a simple, intuitive argument rial, is also defined for numbers oth- of the table: suggesting that the trend will continue: er than integers. For example, Γ(½) is – The regions of the cube that are left va- equal to √π. n V(n,1) cant by the ball are the corners. Each 1 2 time n increases by 1, the number of The Incredible Shrinking n-Ball 2 π ≈ 3.1416 corners doubles, so we can expect ever When I discovered the n-ball formula, 4 more volume to migrate into the nooks I did not pause to investigate its prov- 3 3 π ≈ 4.1888 and crannies near the cube’s vertices. enance or derivation. I was impatient 1 2 4 2 π ≈ 4.9348 To go beyond this appealing but non- to plug in some numbers and see what 5 8 π2 ≈ 5.2638 quantitative principle, I would have to would come out. So I wrote a hasty 15 1 3 ≈ calculate the volume of n-balls and n- one-line program in Mathematica and 6 6 π 5.1677 16 3 cubes for values of n greater than 3. began tabulating the volume of a unit 7 105 π ≈ 4.7248 The calculation is easy for the cube. An ball in various dimensions. I had defi- 8 1 π4 ≈ 4.0587 n-cube with sides of length s has vol- nite expectations about the outcome. 24 32 4 ≈ ume sn. The cube that encloses a unit I believed that the volume of the unit 9 945 π 3.2985 n 1 5 ball has s =2, so the volume is 2 . ball would increase steadily with n, 10 120 π ≈ 2.5502 But what about the n-ball? As I have though at a lower rate than the volume already noted, my early education of the enclosing s = 2 cube, thereby Beyond the fifth dimension, the vol- failed to equip me with the necessary confirming Bellman’s curse of dimen- ume of a unit n-ball decreases as n in- formula, and so I turned to the Web. sionality. Here are the first few results creases! I tried a few larger values of What a marvel it is! (And it gets better returned by the program: n, finding that V(20,1) is about 0.0258, all the time.) In two or three clicks I and V(100,1) is in the neighborhood of had before me a Wikipedia page titled n V(n,1) 10–40. Thus it looked very much like “Deriving the volume of an n-ball.” 1 2 the n-ball dwindles away to nothing as Near the top of that page was the for- 2 π ≈ 3.1416 n approaches infinity. mula I sought: 3 4 π ≈ 4.1888 n n 3 Doubly Cursed π 2 r V(n, r ) = . 4 1 π2 ≈ 4.9348 I had thought that I understood Bell- Γ( n + 1) 2 2 5 8 π2 ≈ 5.2638 man’s curse: Both the n-ball and the Later in this column I’ll say a few 15 n-cube grow along with n, but the cube words about where this formula came I noted immediately that the val- expands faster. In fact, the curse is far from, both mathematically and histori- ues for one, two and three dimensions more damning: At the same time the cally, but for now I merely note that the agreed with the results I already knew. cube inflates exponentially, the ball only part of the formula that ventures (This kind of confirmation is always shrinks to insignificance. In a space of beyond routine arithmetic is the gamma reassuring when you run a program 100 dimensions, the fraction of the cubic function, Γ, which is an elaboration on for the first time.) I also observed that volume filled by the ball has declined to the idea of a . For positive inte- the volume was slowly increasing with 1.8×10–70. This is far smaller than the gers, Γ(n+1) = n!=1×2×3×...×n. But n, as I had expected. volume of an atom in relation to the

3-ball in 3-cube 2-ball in 2-cube

1-ball in 1-cube r = 1 r = 1 r = 1

s = 2 volume ratio = 1.0

s = 2 s = 2 volume ratio = 0.79 volume ratio = 0.52 Balls in boxes offer a simple system for studying geometry across a series of spatial dimensions. A ball is the solid object bounded by a sphere; the boxes are cubes with sides of length 2, which makes them just large enough to accommodate a ball of radius 1. In one dimension (left) the ball and the cube have the same shape: a line segment of length 2. In two dimensions (middle) and three dimensions (right) the ball and cube are more recognizable. As dimension increases, the ball fills a smaller and smaller fraction of the cube’s internal volume. In three dimensions the filled fraction is about half; in 100-dimensional space, the ball has all but vanished, filling only 1.8 × 10–70 of the cube’s volume.

© 2011 Brian Hayes. Reproduction with permission only. www.americanscientist.org 2011 November–December 443 Contact [email protected]. volume of the Earth. The ball in the box the center point.) The shortest diam- of 2, which makes it twice the size of has all but vanished. If you were to se- eters run from the center of a face to the 512 surrounding balls. Furthermore, lect a trillion points at random from the the center of the opposite face. For the the central ball has expanded to reach of the cube, you’d have almost cube enclosing a unit ball, the length the sides of the bounding box, and will no chance of landing on even one point of this shortest diameter is 2, which is burst through the walls with any fur- that is also inside the ball. both the side length of the cube and ther increase in dimension. What makes this disappearing act the diameter of the ball. Thus a skewer so extraordinary is that the ball in on the shortest diameter lies inside the What’s So Special About the 5-Ball? question is still the largest one that ball throughout its length. I was taken by surprise when I learned could possibly be stuffed into the The longest diameters of the cube that the volume of a unit n-ball goes to cube. We are not talking about a pea extend from a corner through the cen- zero as n goes to infinity; I had expect- rattling around loose inside a refrig- ter point to the opposite corner. For ed the opposite. But something else erator carton. The ball’s diameter is an n-cube with side length s = 2, the surprised me even more—the fact that – still equal to the side length of the length of this diameter is 2√n. Thus the volume function is not monotonic. cube. The surface of the ball touches in the 100-cube surrounding a unit Either a steady increase or a steady every face of the cube. (A face of an n- ball, the longest diameter has length decrease seemed more plausible than cube is an (n–1)-cube.) The fit is snug; 20; only 10 percent of this length lies having the volume grow for a while, if the ball were made even a smidgen within the ball. Moreover, there are then reach a peak at some finite value larger, it would bulge out of the cube just 100 of the shortest diameters, but of n, and thereafter decline. This be- on all sides. Nevertheless, in terms there are 299 of the longest ones. havior singles out a particular dimen- of volume measure, the ball is nearly Here is still another mind-bending sion for special attention. What is it crushed out of existence, like a black trick with balls and boxes to suggest about five-dimensional space that al- hole collapsing under its own mass. just how weird space becomes in higher lows a unit 5-ball to spread out more How can we make sense of this dimensions. I learned of it from Barry expansively than any other n-ball? seeming paradox? One way of un- Cipra, who published a description in I can offer an answer, although it derstanding it is to acknowledge that Volume 1 of What’s Happening in the doesn’t really explain much. The answer the ball fills the middle of the cube, Mathematical Sciences (1991). On the is that everything depends on the value but the cube doesn’t have much of , a square with sides of length 4 of π. Because π is a little more than 3, the a middle; almost all of its volume is will accommodate four unit disks in volume peak comes in five dimensions; away from the center, huddling in a two-by-two array, with room for a if π were equal to 17, say, the unit ball the corners. A simple counting argu- smaller disk in the middle; the radius with maximum volume would be found – ment gives a clue to what’s going on. of that smaller disk is √2 –1. In three in a space with 33 dimensions. As noted above, the ball touches the dimensions the equivalent 3-cube fits To see how π comes to have this role, enclosing cube at the center of each eight unit balls, plus a smaller ninth ball we’ll have to return to the formula – face, but it does not reach out into the in the middle, whose radius is √3 –1. In for n-ball volume. We can get a rough corners. A 100-cube has just 200 faces, the general case of n dimensions, the sense of the function’s behavior from but it has 2100 corners. box has room for 2n unit n-balls in a a simplified version of the formula. Another approach to understanding rectilinear array, with one additional In the first place, if we are interested the collapse of the n-ball is to imag- ball in the vacant central space, and the only in the unit ball, then r is always – ine poking skewers through the cube central ball has a radius of √n –1. Look equal to 1, and the rn term can be ig- along various diameters. (A diameter what happens when n reaches 9. The nored. That leaves a power of π in the is any straight line that passes through “smaller” central ball now has a radius numerator and a gamma function in the denominator. If we consider only n = 5.2569464 even values of n, so that n/2 is always 5 V(n,1) = 5.277768 an integer, we can replace the gamma function with a factorial. For brevity, let m = n/2; then all that remains of the 4 formula is this ratio: πm/m!.

-ball The simplified formula says that the n 3 n-ball volume is determined by a race between πm and m!. Initially, for the smallest values of m, πm sprints ahead; 2 for example, at m =2 we have π2 ≈10,

volume of unit volume which is greater than 2! = 2. In the long 1 run, however, m! will surely win this race. Both πm and m! are products of m factors, but in πm the factors are all 0 5 10 15 20 equal to π, whereas in m! they range dimension n from 1 up to m. Numerically, m! first m The volume of a unit ball in n dimensions reveals an intriguing spectrum of variations. Up exceeds π when m = 7, and thereafter to dimension 5, the ball’s volume increases with each increment to n; then the volume starts the factorial grows very much larger. diminishing again, and ultimately goes to zero as n goes to infinity. If dimension is considered This simplified analysis accounts a continuous variable, the peak volume comes at n=5.2569464 (green dot). for the major features of the volume

© 2011 Brian Hayes. Reproduction with permission only. 444 American Scientist, Volume 99 Contact [email protected]. curve, at least in a qualitative way. The volume of a unit ball has to go to zero in infinite-dimensional space because zero is the limit of the ratio πm/m!. In low dimensions, on the other hand, the ratio is increasing with m. And if it’s going uphill for small m and down- hill for large m, there must be some intermediate value where the function reaches a maximum. To get a quantitative fix on the loca- tion of maximum, we must return to the formula in its original form and consider odd as well as even num- bers of dimensions. Indeed, we can take a step beyond mere integer di- mensions. Because the gamma func- tion is defined for all real numbers, we can treat dimension as a continuous variable and ask with finer resolution where the maximum volume occurs. A numerical solution to this calculus problem—found with further help from Mathematica—shows a peak in the volume curve at n ≈5.2569464; at this point the unit ball has a volume of 5.2777680. With a closely related formula, we can also calculate the surface area of an n-ball. Like the volume, this quantity reaches a peak and then falls away to zero. The maximum is at n ≈7.2569464, or in other words two dimensions larger than the volume peak.

The Dimensions of the Problem The arithmetic behind all these results is straightforward; attaching meaning The graph of n-ball volume as a function of dimension was plotted more than 100 years ago to the numbers is not so easy. In par- by Paul Renno Heyl, who was then a graduate student at the University of Pennsylvania. The ticular, I can see numerically—by com- volume graph is the lower curve, labeled “content.” The upper curve gives the ball’s surface paring powers of π with — area, for which Heyl used the term “.” The illustration is from Heyl’s 1897 thesis, “Properties of the locus r = constant in space of n dimensions.” why the unit ball’s volume reaches a maximum at n =5. But I have no geo- intuition about five-dimension- pare volumes across dimensions. Each reverses, and eventually the ball is much al space that would explain this fact. dimension requires its own units of smaller than the unit cube. This chang- Perhaps readers with deeper vision measure, and so the relative magni- ing ratio of ball volume to cube volume will be able to provide some insight. tudes of the numbers attached to those is the phenomenon to be explained. The results on noninteger dimen- units don’t mean much. Is a disk of sions are quite otherworldly. The no- area 10 square centimeters larger or Slicing the Onion tion of fractional dimensions is famil- smaller than a ball of volume 5 cubic The volume formulas I learned as a iar enough, but it is generally applied centimeters? We can’t answer; it’s like child were incantations to be memo- to objects, not to spaces. For example, comparing apples and orange juice. rized rather than understood. I would the Sierpinsky triangle, with its end- Nevertheless, I believe there is indeed like to do better now. Although I can- lessly nested holes within holes, is as- a valid basis for making comparisons. not give a full derivation of the n-ball signed a dimension of 1.585, but the In each dimension volume is to be mea- formula—for lack of both space and triangle is still drawn on a plane of sured in terms of a standard volume in mathematical acumen—perhaps the dimension 2. What would it mean to that dimension. The obvious standard following remarks will shed some light. construct a space with 5.2569464 mu- is the unit cube (sometimes called the The key idea is that an n-ball has tually perpendicular coordinate axes? “measure polytope”), which has a vol- within it an infinity of (n–1)-balls. I can’t imagine—and that’s not just a ume of 1 in all dimensions. Starting at For example, a series of parallel slices figure of speech. n = 1, the unit ball is larger than the unit through the body of an onion turns a Another troubling question is cube, and the ball-to-cube ratio gets still 3-ball into a stack of 2-balls. Another set whether it really makes sense to com- still larger through n = 5; then the trend of cuts, perpendicular to the first series,

© 2011 Brian Hayes. Reproduction with permission only. www.americanscientist.org 2011 November–December 445 Contact [email protected]. reduces each disklike slice to a collec- My journey began with the num- Heyl was a graduate student at the tion of 1-balls—linear ribbons of onion. ber 5.2569464. I entered the digits into time of this work. He went on to a career If you go on to dice the ribbons, you the On-Line Encyclopedia of Integer with the National Bureau of Standards, have a heap of 0-balls. (With real on- Sequences, the vast compendium and he was also a writer on science, phi- ions and knives these operations only of number lore created by Neil J. A. losophy and religion. (His best-known approximate the forms of true n-balls, Sloane. I found what I was looking book was The Mystery of Evil.) but the methods work perfectly in the for in sequence A074455. A reference In the 1897 thesis Heyl derives for- mathematical kitchen.) there directed me to Sphere Packings, mulas for both volume and surface area This decomposition suggests a re- Lattices, and Groups, by John Horton (which he calls “content” and “bound- cursive algorithm for computing the Conway and Sloane. That book in turn ary”), and gives a lucid account of mul- volume of an n-ball: Slice it into many cited An Introduction to the Geometry tidimensional geometry in general. He (n–1)-balls and sum up the volumes of N Dimensions, by Duncan Sommer- clearly appreciates the strangeness of of the slices. How do you compute the ville, published in 1929. The Sommer- the discovery that “… in a space of in- volumes of the slices? Apply the same ville book devotes a few pages to the finite dimension our locus can have no method, cutting the (n–1)-balls into n-ball formula and has a table of val- content at all.” I will allow Heyl to have (n–2)-balls. Eventually the recursion ues for dimensions 1 through 7, but the last word on the subject: bottoms out at n =1 or n = 0, where it says little about origins. However, We might be pardoned for sup- the answers are known. (The volume further rooting in library catalogs re- posing that in a space of infinite of a 1-ball is 2r; the 0-ball is assigned a vealed that Sommerville—a Scottish dimension we should find the volume of 1.) Letting the thickness of mathematician who emigrated to New Absolute and Unconditioned if the slices go to zero turns the sum into Zealand in 1915—also published a anywhere, but we have reached an integral and leads to an exact result. bibliography of non-Euclidean and n- an opposite conclusion. This is the In practice, it’s convenient to use a dimensional geometry. most curious thing I know of in slightly different recursion with a step The bibliography lists five works on the Wonderland of Higher Space. size of 2. That is, the volume of an n-ball “hypersphere volume and surface”; is computed from that of an (n–2)-ball. the earliest is a problem and solution The specific rule is: Given the volume published in 1866 by William Kingdon Bibliography of an (n–2)-ball, multiply by 2πr2/n to Clifford, a brilliant English geometer Ball, K. 1997. An elementary introduction to get the volume of the corresponding who died young. Clifford’s derivation modern convex geometry. In Flavors of Geom- n-ball. (Showing why the multiplicative of the formula is clearly original work, etry. Silvio Levy (ed.) Cambridge: Cambridge University Press. factor takes this particular form is the but it was not the first. Bellman, R. E. 1961. Adaptive Control Processes: hard part of the derivation, which I am Elsewhere Sommerville mentions the A Guided Tour. Princeton: Princeton Univer- going to gingerly avoid; it requires an Swiss mathematician Ludwig Schläfli sity Press. exercise in multivariable calculus that as a pioneer of n-dimensional geometry. Catalan, Eugène. 1839, 1841. Journal de Mathéma- lies beyond my abilities.) Schläfli’s treatise on the subject, written tiques Pures et Appliquées 4:323–344, 6:81–84. The procedure is easy to express in in the early 1850s, was not published Cipra, B. 1991. Here’s looking at Euclid. In the form of a computer program: in full until 1901, but an excerpt trans- What’s Happening in the Mathematical Sci- lated into English by Arthur Cayley ap- ences, Vol. 1, p. 25. Providence: American function V(n,r) Mathematical Society. peared in 1858. The first paragraph of if n =0 then return 1 Clifford, W. K. 1866. Question 1878. Mathemati- that excerpt gives the volume formula elseif n =1 then return 2r cal Questions, with Their Solutions, from the for an n-ball, commenting that it was else return “Educational Times” 6:83–87. determined “long ago.” An asterisk 2πr2/n × V(n–2,r) Conway, J. H., and N. J. A. Sloane. 1999. Sphere leads to a footnote citing papers pub- Packings, Lattices, and Groups. 3rd edition. For even n, the sequence of operations lished in 1839 and 1841 by the Belgian New York: Springer. carried out by this program amounts to: mathematician Eugène Catalan. Heyl, P. R. 1897. Properties of the locus r = Looking up Catalan’s articles, I constant in space of n dimensions. Phila- 2πr2 2πr2 2πr2 2πr2 delphia: Publications of the University of 1× × × ×· · ·× . found that neither of them gives the Pennsylvania, Mathematics, No. 1, 1897, 2 4 6 n correct formula in full, although they’re pp. 33–39. Available online at http://books. For odd n, the result is instead the close. Catalan deserves partial credit. google.com/books?id=j5pQAAAAYAAJ product of these terms: Not one of these early works paus- On-Line Encyclopedia of Integer Sequences, es to comment on the implications of published electronically at http://oeis.org, 2πr2 2πr2 2πr2 2πr2 2010, Sequence A074455. 2r × × × ×· · ·× . the formula—the peak at n = 5 or the 3 5 7 n Schläfli, L. 1858. On a . The trend toward zero volume in high di- Quarterly Journal of Pure and Applied Math- For all integer values of n the program mensions. Of the works mentioned by ematics 2:269–301. yields the same output as the formula Sommerville, the only one to make these Sommerville, D. M. Y. 1911. Bibliography of Non- based on the gamma function. connections is a thesis by Paul Renno , Including the Theory of Heyl, published by the University of Parallels, the Foundation of Geometry, and Space Who Done It? Pennsylvania in 1897. This looked like of N Dimensions. London: Harrison & Sons. A question I cannot answer with cer- a fairly obscure item, but with help from Sommerville, D. M. Y. 1929. An Introduction to the Geometry of N Dimensions. New York: tainty is who first wrote down the n- Harvard librarians, the volume was Dover Publications. ball formula. I have paddled up a long found on a basement shelf. I later dis- Wikipedia. Deriving the volume of an n-ball. river of references, but I’m not sure I covered that the full text (but not the http://en.wikipedia.org/wiki/Deriving_ have reached the true source. plates) is available on Google Books. the_volume_of_an_n-ball.

© 2011 Brian Hayes. Reproduction with permission only. 446 American Scientist, Volume 99 Contact [email protected].