Pythagoras, Ancient Interdimensional Wizard
When I was a graduate student in data science, I took a class called "Applied Machine Learning". One of the lectures included a section that began like this:
We are so used to living in three dimensions that our intuition fails us when we try to imagine a high-dimensional space. Even a basic 4D hypercube is incredibly hard to picture in our minds, let alone a 200-dimensional ellipsoid bent in a 1,000-dimensional space.
. . . WTF?
For most people, other dimensions are usually encountered in science fiction. They tend to be portrayed as alternate "planes" of reality, magical spaces that somehow exist in our universe yet are inaccessible via normal means. Often, these spaces are illustrated in pretty wild ways to emphasize just how bizarre and alien they would be to us if we ever found ourselves there.
This isn't really what "other dimensions" means when mathematicians talk about that concept though. In at least one understanding of it, the idea is actually much simpler than something that time-traveling wizards would regularly play around with. What's cool about that is that you can start to get a feeling for what extra dimensions are like by using a tool you learned about in elementary school.
You probably remember Pythagoras from math class. If you don't, you probably at least recognize the name of his most famous contribution to math, the Pythagorean theorem. It's the one about triangles that comes with all sorts of fancy words like "hypotenuse" and "orthogonal ". If you still don't remember it, you might at least recognize it if you see it:
Ohhhhh. That old thing. What was it for, again?
The Pythagorean theorem, at its core, is about the relationship between the three sides of a right triangle. Specifically, it tells us that if you know the lengths of the two sides that make the right angle, you can find the length of the remaining side (the one across from the right angle). You have to square all three measurements and add the first two together before the relationship becomes clear, but that's not important here, so you can ignore it. What matters is that length is a kind of distance, which means that the Pythagorean theorem is also about distance.
Remember in math class when you had to make graphs of lines and shapes and things? You constructed those graphs using coordinates that told you where each point was supposed to go. Coordinates come in pairs that look like this: (x, y). The number x told you how far right the point was, and the number y told you how far up it was.1 Reach way back in your memory, it's in there somewhere!
When we talk about "how far" something is, we're talking about distance, which we just said was connected to the Pythagorean theorem. So if we have a point on a graph, we can think of it as being one tip of a triangle - the x coordinate is the length of one side of the triangle, and the y coordinate is the length of another. This is getting tough to explain without pictures (gotta upgrade my Bear Blog account!), but try to imagine a point at the coordinates (3, 4). This would be somewhere up and to the right (4 units up and 3 units right) of the middle of the graph, coordinates (0, 0). If you draw a line from the middle that goes 3 units to the right, and then draw another line (starting at the end of the first) that goes 4 units up, you've reached our point at (3, 4)2 and created two sides of a triangle in the process. The third side would be a line going from the middle of the graph directly to our point.3
Okay. So we can make a triangle out of any point. What does this do for us?
Imagine another point, wherever you want, doesn't matter. Its coordinates are (x, y). Let's rename x and y to be a and b, and let's also use the name c for the length of the line that goes from the middle of the graph to our point. Now it starts to sound kinda familiar - that's just the parts of the Pythagorean theorem. So talking about the lengths of sides a and b of a right triangle is the same as talking about the coordinates (location) of a point, and talking about the length of side c is the same as talking about the distance from the middle of the graph to that point.4
The point (0, 0), the middle of the graph, is just another point, right? What that means is that we can actually use the Pythagorean theorem to find the distance between any two points. We just move the triangle around so that the first point is at one end of side c and the second point is at the other end.5 Neat.
But why are we having a geometry lesson? I wanted to hear about Doctor Strange!
One place that extra dimensions show up in real life is in the realm of data science. The lecture quote that I shared earlier referenced this fact as a way to start talking about the problems that show up when you have really big sets of data.
Picture a spreadsheet. It has rows and columns. Each row represents an entry in our spreadsheet, and each column represents a type of information we might have about an entry. Maybe each row/entry is a person, and the first column/type of info is their age. If we have a lot of people in our spreadsheet (a lot of rows), there's going to be a lot of ages in the "age" column, each one associated with a person.
Let's add a column to our spreadsheet. We'll use it to record the height of each person. Now we've got two types of information for everybody, their age and their height. One way to think about these pieces of information is that they're measurements about the people in our spreadsheet, and when we realize that, we start to be able to do some fun things with this little set of data we've got.
Think back to our graphs, with their points and x and y values. x and y are the two parts of our measurements of the location of a point. What if x and y didn't just have values that were abstract numbers, though? What if instead of only measuring how far right and how far up, we were measuring how old and how tall? Instead of "3 units right and 4 units up" the coordinates for a point might be something like "35 years, 68 inches", where the number of years was represented by how far right the point was on the graph, and the number of inches was how far up it was. We're using the same system (right and up) but now those numbers mean something. Each row/entry in our spreadsheet becomes a point, and the numbers associated with it in each column become that point's coordinates.
Often in data science, we want to know how different two entries are from each other. Now that we're representing our entries as points on a graph, we can directly measure the difference between them. How? With the Pythagorean theorem.
Another way of looking at distance is that it's the difference between two locations. The Pythagorean theorem tells us the distance between two points, so that's one way of describing the difference between them. Since our spreadsheet entries are points now, the Pythagorean theorem helps us measure the difference between them, too.6
Now, there's one important thing I should mention before the end here. Each column is a measurement of a specific type of information (age and height), right? Well, there's a name for "a specific type of information that gets measured". It's called a dimension. (Ahhh! He said the thing! leo-pointing-at-tv.gif)
You may already see where this is going. If you've ever worked with spreadsheets before, you know that you rarely just have two columns. Sometimes you have three, or five, or ten, or fifty. Every one of those columns is a new way to measure information about an entry, or, if we're talking graphs, it's another direction (dimension) in which to measure your points. With three columns, instead of just how far right and how far up a point is, you now need to know how far out it is too (picture holding your hand in front of you - how far out from your chest is it?). And as we just said, spreadsheets don't have to stop at three columns. Got ten columns? That's seven more dimensions than the three we physically exist in.7 Every time you work in a spreadsheet with lots of columns, you are working in extra-dimensional space.
Okay. That's kind of a lot. How do you picture that many dimensions? What does that physical space even look like?
Well . . . we don't know. In the strictest sense of the word, it doesn't look like anything, because our brains simply do not work that way. They're built to work in three dimensions. Any more than that is honestly kind of meaningless to us, at least in a physical sense. In a mathematical sense, we can start to build a logical understanding of what having extra dimensions means (extra columns, extra axes), but graphs can't really help us if we've got more than three dimensions, so it's still hard to get our footing in this space.
There's one thing I latched onto from that machine learning class that's given me at least a tiny foothold, though, and it's this: the Pythagorean theorem works no matter how many dimensions you have.
Remember, all we need to find the distance/difference between two points is their coordinates. Remember when we took a pair of coordinates and swapped x and y with a and b from the Pythagorean theorem? More dimensions just means more numbers in the coordinates - instead of (x, y), you might have (x, y, z, w, . . . etc) - and all of those new numbers get letters on the left side of Pythagoras' equation. It can get pretty big:
It keeps working even after you run out of letters in the alphabet!
Maybe this doesn't resonate with you in the same way, but for me, it helps a lot. Because I have a really good sense of what distance means in two or three dimensions, knowing that the simple math behind that idea holds up even in a million dimensions somehow makes those extra 999,997 dimensions seem a little less insane. And it makes me feel like Doctor Strange, seeing into a hidden secret of the universe.
We're still in 2-dimensional space for now, and we will not be dealing with negative numbers today. No thank you sir!↩
You could of course go up first and then go right, and you'd still end up with the third side being in exactly the same place.↩
I promise there's a reason we're going over the Cartesian coordinate system before getting back to the dimensional wizardry, stick with me!↩
Technically I'm referring here to both the lengths of the sides and the sides themselves by the same names, but I think this is a straightforward way to get the point across, so . . . meh.↩
I'm obfuscating a bit of math here that accounts for the translation of the triangle away from the origin, but again, not important right now.↩
You might be asking yourself, now that we're using concrete measurements like age and height, what's our concrete unit of measurement for the difference between two entries? The answer might be kind of unsatisfying - it doesn't actually matter. All we need to know is the number. The bigger it is, the more different the two entries are from each other.↩
Yes, time is a dimension too, so we actually exist in four dimensions. We're talking about spatial dimensions here, though.↩