Showing posts with label recreational mathematics. Show all posts
Showing posts with label recreational mathematics. Show all posts

Friday, December 13, 2019

High-Dimensional Weirdness

At work, I run a mathematics colloquium that meets every other Thursday.  I don't always present—I probably present about 20 to 25 percent of the time—but I did a recent one on the behavior of high-dimensional spaces.  I then came upon an oddity that I thought was worth sharing, for those three or four of you who might like that kind of thing.

In this presentation, I made reference to some dimensional weirdnesses.  While making the point that additional dimensions make room for more stuff (as I put it), I pointed out that if you put four unit circles in the corners of a square of side 4, you have room for a central circle of radius r = 0.414.  (Approximately.  It's actually one less than the square root of 2.)

 

Correspondingly, if you put eight unit spheres in the corners of a cube of side 4, you have enough space for a central sphere of radius r = 0.732 (one less than the square root of 3), because the third dimension makes extra room for the central sphere.


If you were to put a sphere exactly in the middle of the front four spheres, or in the middle of the back four spheres, it would have a radius of r = 0.414, just as in two dimensions, but by pushing it in between those two layers of spheres, we make room for a larger sphere.

Finally (and rather more awkwardly, visually speaking), applying the same principle in four dimensions makes room for a central hypersphere of radius r = 1 (one less than the square root of 4).


The situation for general dimension d (which you've probably guessed by now) can be worked out as follows.  Consider any pair of diametrically opposed unit hyperspheres within the hypercube (drawn in orange below).  Those two hyperspheres are both tangent to the central green hypersphere, and they are also tangent to the sides of the blue hypercube.


We can figure out the distances from the center of any unit hypersphere to its corner of the hypercube, as well as to the central hypersphere.  Since we also know the distance between opposite corners of the hypercube, we can obtain the radius of the central hypersphere:


One interesting consequence is that at dimension d = 4, the central green hypersphere is now as large as any of the orange unit hyperspheres, and above dimension d = 9, the central hypersphere is actually large enough to poke out of the faces of the hypercube.  Keep that in mind for what follows.



One other oddity had to do with the absolute hypervolume, or measure, of unit hyperspheres in dimension d.  A one-dimensional "hypersphere" of radius 1 is just a line segment with length 2.  In two dimensions, a circle of radius 1 has area π = 3.14159; in three dimensions, the unit sphere has volume 4π/3 = 4.18879....  The measure of a unit hypersphere in dimension d is given by


For odd dimensions, this requires us to take a fractional factorial, which we can do by making use of the gamma function, and knowing that


With that in mind (and also knowing that n! = n (n – 1)! for all n), we can complete the following table for hyperspace measures:


That last entry may come as a bit of a surprise, but it is simply a consequence of the fact that as a number n grows without bound, πn grows at a constant pace (logarithmically speaking), while n! grows at an ever increasing rate.  As a result, the denominator of Vd totally outstrips its numerator, and its value goes to zero.



But what if we combine the two, and ask how the measure of the central green hypersphere, expressed as a proportion of the measure of the blue hypercube, evolves as the number of dimensions goes up?  On the one hand, we've seen that the measure of a unit hypersphere goes to 0 as the number of dimensions increases, but on the other hand, the central green hypersphere isn't a unit hypersphere; rather, its radius goes up roughly as the square root of the number of dimensions.  How do these two trends interact with increasing dimensionality?  In case it helps your intuition, here's a table for the ratios for small values of d.



Those of you who want to work it out for yourself may wish to stop reading here for the moment.  Steven Landsburg, who is a professor of economics at the University of Rochester but earned his Ph.D. in mathematics at the University of Chicago, told a story of attending a K-theory conference in the early 1980s, in which attendees were asked this very question.  Actually, they were specifically asked not to calculate the limiting ratio, but rather to guess what it might be, from the following choices:

  • –1
  • 0
  • 1/2
  • 1
  • 10
  • infinity

Attendees were invited to choose three of the six answers, and place a bet on whether the correct answer was among those three.  Apparently, most of the K-theorists reasoned as follows: Obviously, the measure can't be negative, so –1 can safely be eliminated.  Then, too, the central green hypersphere "obviously" fits within the blue hypercube, so its volume can't be greater than that of the hypercube, so the ratio of the two can't be greater than 1, so 10 and infinity can likewise safely be eliminated.

Well, "obviously," you know that the hypersphere can in fact go outside the hypercube, so 10 and infty can't actually be eliminated.  So what is the right answer?

At the risk of giving the game away so soon after offering it, I'll mention that the answer hinges on, of all things, whether the product of π and e is greater or less than 8.  Here's how that comes about: We know that the measure of a unit hypersphere in dimension d is given by


But that's just the unit hypersphere.  If we take into account the fact that the radius of the central green hypersphere is


then the question becomes one of the evolution of the measure Gd of the central green hypersphere:


To figure out how this behaves as d goes to infinity, we first rewrite it as


Next, we make use of Stirling's approximation to the factorial function:


Applying this to n = d/2 gives us


and when expressing it as a proportion of the measure of the hypercube of side 4, we get


Finally, we observe that we can write (by taking into account one extra higher-order term in the usual limit for 1/e)


and we see that


The right-hand side is eventually dominated by the factor involving πe/8 = 1.06746..., which drives the ratio Gd/4d to infinity as d increases without bound—but it takes a long time.  A more precise calculation shows that the fraction first exceeds 1 at dimension d = 1206.  A plot of the ratio as a function of dimension looks like this:


Notice that the ratio reaches a minimum of very nearly 0.00001 at 264 dimensions; the exact value is something like 0.00001000428.  As far as I know, that's just a coincidence.

Friday, May 22, 2015

The Most Beautiful Equation in Mathematics

What follows is a bit I did over at Math StackExchange.  Posting it over here was an experiment in whether the mathematical typesetting would transfer correctly in a copy-and-paste.  For the most part, as long as I leave it alone, it seems to have done so (modulo the line breaks being lost in the shuffle).

Euler's equation

eiπ+1=0

is considered by many to be the most beautiful equation in mathematics—rightly, in my opinion. However, despite what Gauss might say, it's not the most obvious thing in the world, so let's perhaps try to sneak up on it, rather than land right on it with a bang.

It's possible to think of complex numbers simply as combinations of real values and imaginary values (that is, square roots of negative numbers). However, plotting them on the complex plane provides a kind of geometric intuition that can be valuable.


On the complex plane, a complex number a+bi is plotted at the point (a,b). Adding complex numbers is then just like adding vectors—(a+bi)+(c+di)=(a+c)+(b+d)i, for instance—just as you might have expected. (It's probably useful to draw some of these out on graph paper, if you can.)

Multiplication is where things get a little unusual. Multiplication by real values is just as you'd expect, generalizing from the one-dimensional real number line to the two-dimensional complex plane: Just as k times a positive number is (for positive k) another positive number k times as far from the origin, and correspondingly for negative numbers, k times a complex number is another complex number, k times as far from the origin, and in the same direction.

But multiplication by imaginary values is different. When you multiply something by i, you don't scale that something, you rotate it counter-clockwise, by 90 degrees. Thus, the number 5, which is 5 steps to the east (so to speak) of the origin, when multiplied by i becomes 5i, which is 5 steps to the north of the origin; and 3+4i, which is to the northeast, becomes 4+3i, which is to the northwest. And so on.



OK, let's step away from the complex plane for a moment, and proceed to the exponential function. We're going to start with the ordinary ol' real-valued exponential function, y=ex. There are lots of exponential functions: 2x,10x,πx, But there's something special about the exponential function with e, Euler's constant, as its base.

If you graph y=ex, you get a curve that starts out at the far left, at (,0) (so to speak), and proceeds rightward, crawling very slowly upward, so slowly that by the time it gets to x=0, it's gotten no further upward than (0,1). After that, however, it picks up speed, so that further points are (1,e),(2,e2),(3,e3),, and by the time x=20, we've nearly halfway to a billion.

Another way to put that is that the derivative of y=ex, which you might think of as its slope, starts out as an almost vanishingly small number far to the left of the origin, but becomes very large when we get to the right of the origin.

To be sure, all exponential functions do that basic thing. However, the very unusual thing about y=ex is that its derivative—its slope, in other words—is exactly itself. Other exponential functions have derivatives that are itself multiplied by some constant. But only the exponential function, with e as its base, has a derivative that is exactly equal to itself.

It's very rare that an expression has that property. The function y=x2, for instance, has derivative (or slope) y=2x, which is not equal to x2. But if you want to know the slope of y=ex at any point, you just figure out what y is, and there's your slope. At x=1, for instance, y=e2.71828, so the slope there is also y=e2.71828.

The only functions that have that property have the form y=Cex, where C is any constant.

There's another way to think of the derivative that is not the slope, although it's related. It has to do with the effect that incremental changes in x have on y. As we saw above, the derivative of y=ex, at x=1, is also y=ex=e2.71828.

That means that if you make a small change in x, from 1 to 1+0.001=1.001, then y approximately makes 2.71828 times as much of a change, from 2.71828 to 2.71828+0.002718282.72100. This is only accurate for small changes, the smaller the better, and in this case at least is exact only in the limit, as the change approaches zero. That is, in fact, the definition of the derivative.



Now, let's return to the complex plane, and put the whole thing together. Let's start with e0=1. We can plot that point on the complex plane, and it will be at the point with coordinates (1,0). It's important to remember that this does not mean that 0=e1. The value of x is not being plotted here; all we're doing is plotting y=e0=1=1+0i, and that 1 and 0 are the coordinates of (1,0), which is one step east of the origin. By the unusual property of ex, the derivative is also 1.

Suppose we then consider making a small change to x=0. If we add 0.001 to x, we make a change to ex that is equal to the derivative times the small change in x. That is to say, we add the derivative 1 times the small change, 0.001, or just 0.001 again. So the new value would be close to (though not quite exactly) 1.001, which is represented by the point (1.001,0). It would be in the same direction from the origin—east—as the original point, but 0.001 further away.

But what happens if we add not 0.001 to x, but 0.001i? The derivative is still 1, so the incremental impact on ex is the derivative ex=1 times 0.001i, or 0.001i again. So the new value would be close to (though, again, not quite exactly) 1+0.001i, which is represented by the point (1,0.001). It would be 0.001 steps to the north of (1,0), because the extra factor of i rotates the increment counter-clockwise by 90 degrees.

Symbolically, we would say

e0.001i1+0.001i

Now, suppose we added another 0.001i to the exponent, so that we are now evaluating e0.002i. We'll do what we did before, which was to multiply the increment in the exponent, 0.001i, by the derivative. And what is the derivative? Is it 1, as it was before? No, since we're making an incremental step from e0.001i, it should be the derivative at 0.001i, which is equal to e0.001i again, which we determined above to be about 1+0.001i. If we multiply this new derivative value by the increment 0.001i, we get an incremental impact on ex of 0.000001+0.001i, which is a tiny step that is mostly northward, but which is also just an almost infinitesimal bit to the west (that's the 0.000001 bit). We've veered ever so slightly to the left, so the new estimated value at x=0.002i is

e0.002i0.999999+0.002i

One thing to observe about the small steps that we've taken is that each one is at right angles to where we are from the origin. When we were directly east of the origin, our small step was directly northward. When we were just a tiny bit north of east from the origin, our small step was mostly northward, but a tiny bit westward, too.

What curve could we put around the origin, such that if we traced its path, the direction we're moving would always be at right angles to our direction from the origin? That curve is, as you might have guessed already, a circle. And since we start off 1 step east of the origin, the circle has radius 1. Unsurprisingly, this circle is called the unit circle.

If we follow this line of reasoning, then the value of eiπ must be somewhere along this unit circle; that is, if eiπ=m+ni, then m2+n2=1 (since that's the equation of a circle of radius 1, centered at the origin). The only reason our estimated values weren't exactly on the unit circle is that we made steps of positive size, whereas the derivative is technically good only for steps of infinitesimal size. But where on the unit circle is eiπ?

The crucial observation is in how fast we make our way around the circle. When we made our first step, from x=0 to 0.001i, that step had a size, a magnitude, of 0.001, and the incremental impact on ex was also of magnitude 0.001. Our second step, from x=0.001i to 0.002i, was also of magnitude 0.001, and the incremental impact on ex was, again, about 0.001.

In order to get to eiπ, we would have to make a bunch of steps, whose combined magnitude total π. The result would be, if we reason as we did above, to move a distance π around the unit circle. Since the unit circle has radius 1, and diameter 2, its circumference must be 2π. Therefore, eiπ must be halfway around the circle, at coordinates (1,0). That is none other than the complex value 1+0i=1:

eiπ=1

or, in its more common form,

eiπ+1=0

The foregoing is not, by any means, a rigorous demonstration. It's an attempt to give some kind of intuition behind the mysterious-looking formula.