Tag Archives: hypersphere

Casual Weekend Notes

This weekend, I give you a cop-out post, hopefully a little lighter than my last. Just a few things happening in my sphere.

  • I’m addicted to Twitter, ever since I figured out how to use TweetDeck.
  • Lots more hits on my layoff post than I thought (25, as of today, rather than my predicted three).
  • People still like my hypersphere post, but not as much as when it was new on reddit. I still can’t get over the fact that someone reddit-ed my post! I’m still really flattered.
  • My wife and I checked out a few neighborhoods today that we’d move to, and that hopefully we can afford. We’re looking at houses this time (to rent, not to own), and we plan to move at the end of Summer. We’re hoping that the difficulty of selling will work in our favor.
  • I officially love Sumatran coffee beans. The flavor is exactly what I’m looking for in a cup of coffee. Of course, for all I know, Sumatran may just be the white zinfandel of coffee.
  • I dislike using the word random outside its probabilistic meaning. Desultory, casual, or stray are usually more appropriate words for the way that I find most people use the word random. Unfortunately, I find myself using it inappropriately at times, so I can’t really be that critical.

Have a good weekend!


Visualizing Hyperspheres

Since all you in the blogosphere seem to love hyperspheres so much, here’s a link to someone who put together some visualizations of hyperspheres and polytopes in 4 dimensions:


The approach is pretty cool, and some of the images are quite stunning.

Reasoning in Higher Dimensions: Measure

In a previous post on this topic, I said that hyperspheres get a bad rap. They’re doing their best to be perfectly round, and someone comes along and accuses them of being inadequate, or weird. It turns out that hyperspheres aren’t really weird at all. It’s measure that’s weird. And where measure is concerned, there are objects out there that truly display that weirdness.

To recap, I was talking about how the volume of a unit hypersphere measured the normal way (with its radius = 1) approaches zero with increasing dimension. I also mentioned that even though a “unit” hypercube that circumscribes the unit sphere (i.e., a hypercube with inradius = 1) has volume that increases exponentially with the dimension (2d), a hypercube with circumradius = 1 decreases even faster than the volume of the hypersphere. Why is one configuration different than the other?

The answer is that they’re not different. A cube is a cube, no matter how you orient it. If its side is of length s, then its volume is sd. What’s different here is our notion of unit measure. We commonly define a unit of volume as the volume of a hypercube with sides of unit length. In that light, it’s not terribly surprising what we know about the volume of hypercubes. So why can’t we just define the unit hypersphere to have unit volume?

This seems objectionable until you realize that we do this all the time in the real world. What’s a gallon? It has nothing to do with an inch or foot. So why do we worry ourselves over defining volume in terms of one-dimensional units? The metric system doesn’t even adhere to this standard. A liter is a cubic decimeter. Why? It just worked out that way. Since these units are all just arbitrary, we could just declare that unit volume is the volume of a unit hypersphere. Or not. So a hypersphere’s volume really isn’t that weird. What seems weird is the discrepancy between the geometries of the hypercube and hypersphere.

Are there objects that do act strangely in higher dimensions? Definitely. Consider a multivariate normal distribution (a Gaussian distribution in multiple dimensions). For the sake of simplicity, I’ll consider one with zero mean and variance σ2:

p(x) = \frac 1 {(2\pi)^{n/2}\sigma^n} \exp\left(\frac{\|x\|^2}{2\sigma^2}\right)

Multivariate Gaussians are all nice and round. What can we say about what the distance from the mean (0) looks like? Well, this is just the variance:

\mathbf{E}\|X\|^2 = \mathbf{E}(X_1^2 + \dots + X_n^2) = n\sigma^2

How much does it deviate from this value? We can apply a Chernoff bound (don’t ask me how; deriving Chernoff bounds is not my strong suit):

\mathbf{P}(\left|\|X\|^2 - n\sigma^2\right| > \epsilon n\sigma^2) \leq \exp\left(-\frac{n\epsilon^2}{24}\right)

Let’s take another look at this bound, though. It’s saying that the probability of the squared distance from the mean deviating from nσ2 by more than a small percentage decreases exponentially with n. So the points that follow the distribution mostly sit in a thin shell around the mean. But the density function still says that the density is highest at the mean. Now that’s weird.

Why does this happen, though? It’s difficult to get a handle on, but the word “density” is what you have to pay attention to. That shell has an incredibly high volume at higher dimensions (it grows with drd-1). High enough that the density is still lower at the shell than at the mean. Why it’s highest in the shell is even more difficult to figure out. I don’t have a good answer, but I suspect that it has something to do with the fact that the distribution must add up to one, and it has to “fill” all the nooks, and it can’t do that at the mean. It has to do this out in this thin shell.

[Update: I guessed last night that if I multiply the p.d.f. by the boundary volume (i.e. “surface area”) of a hypersphere of radius ||x||, then I should see spikes out at σ√n. I was correct. Below, Micheal Lugo confirmed that intuition slightly more rigorously in the comments. He’s a probabilist, so I think I’m safe. :-) ]

There are certainly weird things that happen in higher dimensions. In my opinion, all these things have more to do with measure than geometry.

Reasoning in Higher Dimensions: Hyperspheres

In my last post on higher dimensions, I alluded to the fact that I don’t agree completely with certain notions about higher dimensions. Specifically, I disagree with the idea that the intuition that you take for granted in low dimensions is necessarily ill-equipped to serve you in higher dimensions. Low-dimensional intuition is ill-equipped for many problems, and like most other topics in math, it’s usually most sensible to do the calculations anyway.

Hyperspheres often get brought up with the subject of weirdness in higher dimensions, mostly because they’re easy to understand, and it’s easy to demonstrate the weirdness very quickly. But are they completely weird? Are the examples really fair, or are hyperspheres getting a bad rap?

First, let’s get some notation out of the way. We often like to call a hypersphere an n-sphere, because it’s an n-dimensional manifold. Technically, one of these can exist in any metric space with more than n dimensions (because I’m talking about intuition, I’m assuming it’s Euclidean space). For simplicity, though, we’ll say that it lives in n+1 space, so that we can define it easily:

S^n = \left\{ x \in \mathbb{R}^{n+1} : \|x\| = r\right\}

That’s not all that I want to talk about, though. I also want to talk about the volume of the n-sphere, and in that case, we often talk about a ball, which is just the interior of a sphere. The interior of an n-sphere is an (n+1)-ball, because if the sphere is an n-dimensional manifold, its interior is an (n+1)-dimensional manifold:

B^{n+1} = \left\{ x \in \mathbb{R}^{n+1} : \|x\| < r\right\}

Or more simply:

B^{n} = \left\{ x \in \mathbb{R}^{n} : \|x\| < r\right\}

The volume of this object has a somewhat simple formula:

V_n={\pi^\frac{n}{2}r^n\over\Gamma(\frac{n}{2} + 1)}

Where Γ(x) represents the Gamma function (which is a tad more complicated).

So where’s the counter-intuition? Say that we took the unit ball for all n > 0 and graphed its volume:

Volume vs. dimension of unit n-ball

Volume vs. dimension of unit n-ball

This does seem a little odd. The volume goes up, hits a peak at 5, and then drops, and eventually bottoms out. In fact, with high enough dimension, you won’t see an n-ball have any volume at all. The limit of the volume of any n-ball as n goes to infinity is 0. That is weird. That’s not necessarily something that you’d expect. It also seems weird that the volume starts dropping after a while.

But is all this really that strange? What if we fixed the radius at, say, 1/sqrt(π)? The volume vs. dimension is then just a decreasing function, even at low dimensions. Not surprising when you consider that radii less than 1 should make the volume diminish rapidly. So what about radii greater than 1? What if we fix r at say, 3? The volume peaks out at n = 56, and the volume is about 143 billion … somethings. After that, the volume diminishes back to zero again. All that we’re really saying here is that the geometry of the sphere dominates rn, but rn has enough power to dominate at low dimensions until the geometry cuts over.

What’s so special about rn though? Why is this the gold standard by which we judge the hypersphere? It’s just the hypercube with sides of length r. In fact, the unit sphere is inscribed in a cube with sides of length 2r. What if we considered a hypercube of circumradius r instead of inradius r? That means that a sphere of radius r contains it. If that’s the case, then it has volume strictly less than the sphere’s volume. In fact, its volume is:

V_n=\left(2r\over\sqrt n\right)^n = {(2r)^n\over n^{n\over2}}

which diminishes even faster than the sphere’s volume. So it can’t be the geometry of a cube that makes it keep its volumetric power.

So what’s my point? This is all sounding very counterintuitive. My point is that when you talk about counter-intuition in higher dimensions, it’s helpful to talk about what’s actually going on, instead of maligning poor innocent constructs like the hypersphere. What’s actually going on? More about that later.

But for now, consider this: no matter how many dimensions a sphere has, it’s always perfectly round, and perfectly isotropic. That’s intuition that isn’t lost in higher dimensions.

[Someone posted this to Reddit! Thanks!]