math, science

Life in Hyperbolic Space 1: Primer

It’s rare that weird, brain-bending ideas and video games meet, but in my experience, when they do, it’s pretty glorious. Portal, Prey, Antichamber, The Stanley Parable, and SUPERHOT are examples I’ve played personally. Also Miegakure (if it ever comes out, grumble grumble) will probably land instantly in that category, being a 4D puzzle game. But my most recent weird-game obsession has been HyperRogue. HyperRogue is awesome. Like Dwarf Fortress, it’s got a bit of a retro look with clean, minimalist graphics. And like Dwarf Fortress, it’s pretty obvious that a lot of love has gone into it. Here’s what the game looks like:


Like many roguelikes (modeled after the ancient ASCII game Rogue), it’s played on a sort of chessboard. It looks at first glance like one of those board wargame or D&D-type hexagonal chessboards, but instead of being just hexagons, it’s got heptagons (7-sided polygons) too. You know what? That reminds me of the description of another geometric object:

Truncated Icosahedron

(Screenshot from the awesome polyhedron program polyHédronisme)

That is a truncated icosahedron, but I’d wager that most people know it better as either A) a soccer ball/football, or B) a molecule of C60: a fullerene, a buckyball.

Don’t worry. It’ll be clear in a moment what the hell I’m going on about. You see, HyperRogue takes place in the hyperbolic plane. A flat piece of paper is a Euclidean plane. The surface of a globe (or the Earth, or a buckyball) is a sphere. The hyperbolic plane is the third brother in the trio, so to speak, and it’s the weird brother. Their relationship makes more sense to me if I think in terms of polygons. Here’s another picture:


(From the Wikimedia commons.)

The Euclidean plane (the hexagonal tiling above) consists of hexagons, each of which is bordered by six hexagons. The buckyball (football/soccer ball) farther above, representing spherical geometry, consists of pentagons, each of which is bordered by five hexagons. And at the very top of the page, the world of HyperRogue, representing the hyperbolic plane, consists of heptagons (7-sided polygons), each of which is bordered by seven hexagons. The hyperbolic plane is what would happen if you tried to sew up a soccer ball using heptagonal and hexagonal pieces of leather, rather than the usual pentagonal and hexagonal ones. Here’s what that looks like:


(From the page of Frank Sotille, who has awesome templates so you can make your own hyperbolic football. I would’ve done it myself, but all of my Scotch tape has vanished.)

The only buckyball-type tiling that lays flat is the one with hexagons surrounded by hexagons. Pentagons surrounded by hexagons curves into a sphere, and heptagons surrounded by hexagons curls up into what HyperRogue’s creator calls a hypersian rug.

But here’s a more intuitive (though less precise) way to understand the hyperbolic plane. Consider the flat Euclidean plane. Pick a point. Draw a circle centered on that point. Measure the circumference of that circle. Draw another circle with the same center, but twice the radius. Measure the circumference of that circle. The farther you get from your starting point, the larger the circumference, but the increase is very predictable and linear. As a matter of fact, the circumference (the “amount of space”) you cover as you increase the radius of your circle increases exactly like this:

save (1)(1)

(Graphed with

Now do the same thing on a sphere: centered on the north pole, draw a very small circle with a given radius (with the radius measured across the curved surface of the sphere, not straight from point to point). Draw another circle with twice the radius. Up until you hit the equator, the circumference will increase, but eventually it maxes out and goes back down:

save (3)

(Circumference in the Euclidean plane in black, circumference on the sphere in red)

There’s another important effect to consider here: the sphere’s radius matters. That plot assumed a sphere of radius 1. Here’s what it would look like with a sphere of radius 2:

save (2)

It doesn’t make much sense to ask for the “scale” or “radius” of the Euclidean plane, because the answer is “infinity.” Any Euclidean plane is indistinguishable from any other, no matter how you swell or shrink it. Spheres, though, are distinguished by their radii: each has an inherent positive curvature.

Of course, on a sphere, the largest circle you can draw has a radius (measured across the surface of the sphere) of ½πR. the circumference of that circle lies right on the sphere’s equator. After that, the circumference decreases as the radius increases, because your circle’s shrinking as it approaches the opposite pole. It reaches zero when the radius is πR, and your radius-line stretches from one pole to the other.

The Euclidean plane has zero curvature. The sphere has positive curvature. The hyperbolic plane has negative curvature. The “radius” of a hyperbolic plane is defined as 1 / sqrt(-K), where K is a measurement called “Gaussian curvature.” (For comparison, the Gaussian curvature of a sphere is 1/(R²) ). K is the thing that’s zero for the plane, positive for the sphere, and negative for the hyperbolic plane. For a hyperbolic plane of K = -1, with a “radius” of 1, the circumference increases like this:

save (1)

(Hyperbolic circumference is the green line. The red line for a sphere with R = 1 (K=1) is included for comparison.)

That’s the weird thing about hyperbolic geometry: a sphere of infinite radius behaves exactly like the Euclidean plane (it is the Euclidean plane). But as the radius shrinks, the sphere contains less and less space (so to speak). To put it another way: if you were knitting a Euclidean plane (which people do, because mathematical knitting is a thing, which is awesome), then you’d need to knit in twice as much thread at radius 2 than you’d needed at radius 1. To knit a sphere, you’d need to knit less than twice as much thread in at twice the radius. And to knit a hyperbolic plane, you’d need to knit in more than twice as much yarn at twice the radius (according to the formula 2 * pi * R * sinh(r/R), where R = 1/sqrt(-K), and r is the radius measured through the plane; the equivalent relation for the sphere is 2 * pi * R * sin(r/R)). Where the Euclidean knit would give you a flat circular rug, and the spherical knit would give you a hacky-sack ball, the hyperbolic knit would give you something like this:


(Knitted by Daina Taimina, exhibited on the website of the Institute for Figuring.)

But the weird thing is that you can still do almost exactly the same geometry on the hyperbolic plane that you can do in the Euclidean plane. In fact, that’s why hyperbolic geometry is interesting: apart from a couple of weird quirks, it behaves just like a plane. That means you can make rigorous, valid, geometric proofs in the hyperbolic plane.

The Euclidean plane gets its name from Euclid of Alexandria, who is responsible for the infinite misery of people (like me) who just couldn’t get along with high-school geometry. But he condensed many centuries of Greek (and other) geometry into a set of postulates (axioms) from which you can prove pretty much anything that’s true in geometry. Here they are:

  1. You can draw a straight line between any two points.
  2. You can extend an existing straight line as far as you like.
  3. Using a compass, you can draw a circle with any center and any radius you want.
  4. All right angles are the same.
  5. If you’ve got two lines running alongside each other and another line running through both of those, and the angles on the insides of the intersections add up to less than a right angle, then the lines will intersect if you extend them far enough, and they’ll intersect on the side where the angle-sum is less than two right angles.

That last one, called the parallel postulate was a thorn in geometry’s side for a long time, because it seems a lot less elegant than the others, and it seems like the kind of thing you might be able to prove from the other axioms, which would mean it’s not an axiom, since axioms are your starting rules and theorems are what you prove using them. A less messy way to write the parallel postulate is:

5. Given any straight line, and given a point which doesn’t lie on that line, there is exactly one straight line through that point which never intersects the first line (the second line being the parallel).

Spherical geometry and hyperbolic geometry are both based on changing the parallel postulate. In spherical geometry, it becomes:

5. Given any straight line, and given a point which doesn’t lie on that line, there are zero straight lines through that point which never intersect the first line.

Or, to put it in simpler terms: because you’re on a sphere, lines that should be parallel (that is, lines which form a total of two right angles when intersected by a third line), inevitably intersect. Think of the north and south poles as two points. Draw the prime meridian from North to South. Now draw another line passing through the equator at 1° East longitude, 0 ° North latitude. At that point, the two lines are as parallel as lines get: they form ninety-degree intersections with the equator, and therefore, the interior angles on either side form exactly two right angles. But keep drawing those lines, and they’re going to intersect at the south pole, even though they should, according to Euclidean intuition, have stayed parallel.

In hyperbolic geometry, the parallel postulate is modified to the other extreme:

5. Given any straight line L, and given a point P which doesn’t lie on that line, there are an infinite number of straight lines through P which do not intersect L.

Poincare Parallels

That’s the Poincaré disk model, which fits the infinite hyperbolic plane into a finite circle. It’s elegant and simple, and it’s the model HyperRogue uses, so I’m going to stick with it. The red lines are the boundaries of the infinite set of lines which pass through P but never intersect L. It looks like the red lines intersect L at one end each, but the Poincaré disk model distorts distances more and more the closer you get to the edge. A picture’s worth a thousand words, so here’s a series of circles of equal radius starting from the center of the disk and moving outward:


(Both images rendered with the awesome (and free) geometry software GeoGebra)

I know they don’t look like circles of equal radius, but that’s just an artifact of the projection. The same way a Mercator map distorts Greenland so that it looks like it’s bigger than North America (when in reality it’s not much bigger than Quebec or Mexico), the Poincaré disk model distorts distances the closer you get to the edge of the circle. As a matter of fact, that bounding circle, as measured within the hyperbolic plane, is infinitely far from the center. You can’t ever reach it: it’s infinitely far from everywhere. So those intersections that seem to exist in the picture with the red and blue lines, they don’t actually exist, because you’d have to go infinitely far to get there. And keep in mind that, from any given point, it feels like you’re at the center of a Poincaré disk, so those lines don’t actually get closer to the line L the way the projection makes it seem. The projection is a necessary evil. You can do spherical geometry on an ordinary globe and remove all distortion, but you saw how messy and rumpled the hyperbolic version of a globe became: just look at the red crochet thing above. That’s not gonna happen. You have to live with the distortion.

The cool thing about the Poincaré disk model, though, is that it preserves angles, which makes it easy to do the kind of straightedge-and-compass geometry that’s so handy for geometric proofs.

And guess what? Just like we experience the world an almost-flat Euclidean space (relativity says it’s not perfectly flat, but it’s very close in our neighborhood, which I have to say to stop the nitpickers from yelling at me), there are three-dimensional spaces with spherical curvature, and there are three-dimensional spaces with hyperbolic curvature. In the next part, I’m going to talk about life in a highly-curved hyperbolic space. But before I go, let me leave you with a picture of something. In the Euclidean plane, you can only pack six equilateral triangles (all angles and edge-lengths the same) around a single point. The result looks like this:



In the hyperbolic plane, though, you can fit seven equilateral triangles around a vertex, and it looks like this (and don’t forget, those triangle are just as perfect and equilateral as the ones above; it just doesn’t look like it, because of the projection):



You can actually fit eight triangles around a vertex too, although the triangles have to be larger (largeness being a slightly complicated concept in hyperbolic geometry, but we’ll get to that next time):



And actually, it’s perfectly allowable to fit an infinite number of equilateral triangles around every vertex. That looks like this:



And remember, those triangles are still perfect and equilateral and regular. Hyperbolic space is weird. Remember that thing Christopher Lloyd said in Back to the Future? Get ready: we’re gonna see some serious shit.

engineering, math, physics, thought experiment

The Treachery of Plumb-Lines

I’m pretty sure that’s my most pretentious article title to date, but really, the only pretentious thing about it is that it’s a Rene Magritte reference, because if you read it literally, that’s exactly what this article is about.

Imagine two skyscrapers. Both start from ordinary concrete foundations 100 meters by 100 meters, and each will be 1,000 meters high, when finished. We’ll call the first skyscraper Ruler, and the second skyscraper Plumb, for reasons I’ll explain.

Ruler is built exactly according to architectural specifications. Every corner is measured with a high-grade engineer’s square and built at precisely 90 degrees. Importantly, Ruler is constructed so that every floor is precisely 10 meters above the previous one, and every floor is 100 meters by 100 meters. This is done, of course, using a ruler. Because it’s kept so straight and square at every stage, Ruler is a very straight, square building.

Plumb, on the other hand, is kept straight and square using one of the oldest tricks in the architect’s book: the plumb-bob. True story: plumb-bobs are called that because, back in the day, they were almost always made of lead, and the Latin for lead is plumbus (or something like that; I took Latin in high school, but the teacher got deathly ill like two weeks in, so I never learned much). A well-made and well-applied plumb-bob is an excellent way to make sure something is absolutely vertical.

The builders of Plumb do use a ruler, but only to mark off the 10-meter intervals for the floors. They mark them off at the corners of the building, and they make sure the floors are perfectly horizontal using either a modified plumb-bob or a spirit level (which is largely the same instrument).

One might assume that Plumb and Ruler would turn out to be the exact same building. But anybody who’s read this blog knows that that’s the kind of sentence I use to set up a twist. Because Plumb was kept straight using plumb-bobs, and because plumb-bobs point towards the center of the Earth, and because the 100-meter difference between the east and west (or north and south walls) gives the bobs an angle difference of 0.009 degrees, Plumb is actually 11 millimeters wider at the top than at the bottom. Probably not enough to matter in architectural terms, but the difference is there.

Not only that, but Plumb’s floors aren’t flat, either, at least not geometrically flat. The Earth is a sphere, and because Plumb’s architects made its floors level with a spirit level or a plumb-bob, those floors aren’t geometrically flat: they follow the spherical gravitational equi-potential contours. Over a distance of 100 meters, the midpoint of a line across the Earth’s surface sits 0.2 millimeters above where it would were the line perfectly, geometrically straight. This difference decreases by the time you reach the 100th floor (the top floor) because the sphere in question is larger and therefore less strongly curved. But the difference only decreases by around a micron, which is going to get swamped out by even really small bumps in the concrete.

“Okay,” you might say, “so if you blindly trust a plumb-bob, your building will end up a centimeter out-of-true. What does that matter?” Well, first of all, if you came here looking for that kind of practicality, then this blog is just gonna drive you insane. Second, it doesn’t matter so much for ordinary buildings. But let’s say you’re building a 2,737-meter-long bridge (by total coincidence, the length of the Golden Gate Bridge). If you build with geometric flatness in mind, your middle pier is going to have to be 14.7 centimeters shorter than the ones at the ends. That’s almost the length of my foot, and I’ve got big feet. It’s not a big enough difference that you couldn’t, say, fill it in with concrete or something, but it’d certainly be enough that you’d have to adjust where your bolt-holes were drilled.

What’s the moral of this story? It’s an old moral that probably seems fairly ridiculous, but is nonetheless true: we live on the surface of a sphere. And, when it comes down to it, that’s just kinda fun to think about.

biology, math, science, short, statistics, thought experiment

Short: Immortality Math

There are people out there who are quite seriously trying to make human beings immortal. It sounds like something from a bad 1970s pulp comic, but it’s true. Of course, when serious people say “immortal,” they’re not talking Highlander. They’re talking biological immortality, sometimes called by fancy names like “negligible senescence”: the elimination of death by aging. Whether we can (or should) ever achieve biological immortality is a question I’ll leave to people smarter than me, but either way, biological immortality doesn’t mean full immortality. It just means that you can no longer die from, say, a heart attack or cancer or just generally wearing out. You can still quite easily die from things like falls, car accidents, or having Clancy Brown chop your head off with a sword.

There are a number of organisms out there which are either believed or known to be biologically immortal, or at the very least, nearly so. These include interesting but relatively simple organisms like hydras and jellyfish, but also more complex organisms like the bristlecone pine (many living specimens of which are confirmed to be over 1,000 years old, and one of which is over 5,000 years old), and the lobster. (Technically, though, the lobster isn’t really immortal, since they most molt to heal, and each molt takes more energy than the last, until the molts grow so energy-intensive they exhaust the lobster to death.) For the record, the oldest animal for which the age is well-established was a quahog clam named Ming Hafrun, who died at 507 years old when some Icelandic researchers plucked it out of the water.

If a human was made biologically immortal, how long could they expect to live before getting hit by a bus or falling down the stairs (or getting stabbed in the neck by Christopher Lambert)? That’s actually not too hard to estimate. According to the CDC (see Table 18), there were 62.6 injury-related deaths per 100,000 Americans, in 2014. With a bit of naive math (I’m not adjusting for things like age, which probably inflates that statistic a fair bit, since older people are at a higher risk of falls and similar) that means the probability of death by accident is 0.000626 per year, or roughly 0.06%. Knowing that, it’s almost trivial to compute the probability of surviving X years:

probability of surviving X years = (1 – 0.00626)^X

This formula is based on one of my favorite tricks in probability: to compute the probability of surviving, you do the obvious and convert that to the probability of not-dying. And you can take it one step further. At what age would 90% of a biologically-immortal group still be alive? All you have to do is solve this equation for N:

0.9 = (1- 0.00626)^N

which is no trouble for Wolfram Alpha a math genius like me: a biological immortal would have a 90% chance of surviving 168 years. Here are a few more figures:

  • A 75% probability of living up to 459 years.
  • A 50% probability of living up to 1,107 years.
  • A 25% probability of living up to 2,214 years.
  • A 10% probability of living up to 3,677 years.
  • A 5% probability of living up to 4,784 years.
  • A 1% probability of living up to 7,354 years.
  • A one-in-a-thousand chance of living 11,031 years.
  • A one-in-a-million chance of living 22,062 years.

For reference, the probability of a member of a population surviving (in the US, in 2012, including death by biological causes) doesn’t drop below 75% until around age 70. To put it in slightly annoying media jargon: if we’re biologically immortal, then 459 is the new 70.

math, short, thought experiment

Short: Probabilities

For this thought experiment, let’s equate a probability of 1 (100% chance, a certainty) with the diameter of the observable universe. The diameter of the observable universe is about 93 billion light-years (because, during the 13.8 billion years since it started, the universe has been steadily expanding). With this analogy, let’s consider some probabilities!

According to the National Weather Service, your odds of being struck by lightning this year (if you live in the US, that is) are 1 in 1,042,000. Less than one in a million. One part in a million of the diameter of the universe is 93,000 light-years, which is far enough to take you outside the Milky Way, but on a cosmic scale, absolutely tiny.

The odds of winning the jackpot with a single ticket in the U.S. Powerball lottery are around 1 in 292 million. That’s like 318 light-years set against the diameter of the universe. 318 light-years is a long way. Even so, it’s an almost-reasonable distance. Most of the brighter stars you see in the night sky are closer than that. That’s almost the Sun’s neighborhood. Compared to the entire universe. Maybe that’s why they say the lottery is for suckers…

The odds of being struck by lightning three times in your lifetime are, mathematically, 1 in 1,000,000,000,000,000,000. The actual odds are even lower, since there’s a non-zero chance that you’ll be killed by a lightning strike, making getting another impossible. If your odds of dying in a lightning strike are 10%, then your odds of surviving are 9/10, and your odds of surviving the first two so you can get the third are (1 in a million) * (9/10) * (1 in a million) * (9 in 10) * (1 in a million), or about 81 in one hundred million trillion.That’s 81 in 100,000,000,000,000,000,000. That’s roughly the diameter of the Earth-moon system compared to the diameter of the universe.

The odds of putting 100 pennies in a cup, shaking them up, and scattering them so they all land flat, and then having every single coin come up heads, are 1 in 1, 267, 650, 600, 228, 229, 401, 496, 703, 205, 376. That’s the diameter of a grain of sand compared to the entire universe. Literally.

Get a standard deck of cards. Take out the jokers and the instructions. Shuffle the deck and pick a card at random. Do this 25 times. The odds of picking the jack of clubs every single time are like a proton compared to the visible universe.

If you pick 43 letters at random, the odds of forming the string


(that is, the first 43 letters of Hamlet) are as small as one Planck length (which is the smallest unit of distance that ever gets used in actual physics) compared to the visible universe. For reference, a Planck length is ten million trillion times smaller than a proton, which is itself a trillion times smaller than a grain of salt.

Incidentally, if you assembled random 43-letter strings, you would have to do it

32, 143, 980, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000

times to have a 99% chance of producing the first 43 letters of Hamlet in one of them. But a human bard did it in, at most, a couple hundred tries. Isn’t that weird? More probability stuff (and black hole stuff) to come!