Richard Zhang – winner of the 2020 Teddy Rocks Maths Essay Competition
I recently showed my friends a Desmos (online graphing calculator) project of a hypercube that I made, and I was met with confusion about how it is possible for us to visualise 4D. This inspired me to write and create in Desmos an accessible discussion for how we can think about higher dimensions. The project works towards understanding how to create a simple visual representation of the hypercube, while also teaching the importance of abstraction in mathematics!
Interactive version here.
Thinking about two and three dimensional objects is commonplace to everyday life. We find it natural to do so, since we are able to relate these concepts to the world we live in. However, the idea of a higher dimensional object is less tangible. We can all conjure up a clear image in our head when we are told to think about a three dimensional cube, but what about a four dimensional one? It seems strange, perhaps even illogical that there should be such an abrupt cut-off point between three and four dimensions. In fact, we shall find that if we first take a step back and break down the process through which we view three dimensional objects, we can extend our method to four or more dimensions.
When thinking about how to visualise a higher dimensional cube, it will help to first think about how we look at a 3D cube on a 2D screen. That is what the canvas above shows.
On the canvas, there is a set of 3 axes (x, y, and z) representing 3D space. The green cube is a 3D object. We want to look at this object on a 2D screen.
If we think of the xy-plane (the plane spanned by the red and blue axes) as our screen, the black lines show what we see of our green cube on the screen. We call this image of our cube on the screen its ‘projection’.
The purple box shows what we would see if we were looking at the screen head on.
The question is, how do we generate this projection?
EXERCISE: Drag the black point around to try and make the green cube line up with its projection. When you do, what do you notice? What does this tell you about the process?
ANSWER: The two line up when you are either looking down at the green cube from directly above it, or looking up at it from directly below. This tells you that the projection is created by effectively flattening the green cube onto the screen in a direction parallel to the z-axis (orange axis).
Also note that when you line the two up, what you see is identical to what is shown on the purple screen. Why is this?
The process of the projection can also be thought of as taking each vertex of the green cube, and moving it vertically down until it reaches the xy-plane. Each of the purple lines represent the path a vertex of the green cube would take as it moves down to the xy-plane.
EXERCISE: Say one vertex of the green cube has coordinates (x,y,z). As you move it vertically down to the xy-plane, what does its coordinate become?
ANSWER: It becomes (x,y,0). This is because as we move the vertex down, its x and y coordinates don’t change since it is always above the same point on the xy-plane. However, its z coordinate decreases to zero.
Overall, we can conclude that given some point (x,y,z), to project it onto the xy-plane we keep its x and y coordinates the same and make all other coordinates (ie the z coordinate in this case) zero.
This is called the orthogonal (or orthographic) projection. If two things are orthogonal, they are at 90 degrees to each other. Why do you think the projection is given this name?
We have talked about the orthogonal projection in 3D, and now we can think about generalising it to higher dimensions. We have to begin by thinking about what a ‘higher dimension’ means.
Points in 2D have the form (x,y), and the entirety of 2D space can be thought of as the set of all possible points (x,y). 3D points are of the form (x,y,z), and similarly 3D space is the collection of all such points.
Therefore, it is only natural to extend our definition to more dimensions. 4 dimensional space is defined to be the set of all points of the form (x,y,z,w). More generally, n dimensional space is the set of all points of the form (x1,x2,…,xn).
It may be weird to think about this at first, however the reason for making these definitions is such that we can abstract the concept of an n-dimensional space away from the real world (which is limited to n=3).
If we consider objects and concepts just in terms of these definitions, we see that many familiar ideas, such as squares/cubes, circles/spheres and the orthogonal projection can be generalised.
We now extend our orthogonal projection to higher dimensions. Say we want to project a 4D point (x,y,z,w) onto the xy-plane. You can still think of the xy-plane as a 2D screen, but this time it is placed inside 4D space and you are using it to view a 4D object.
Similar to 3D, we keep the x and y coordinates of the point fixed, and make all other coordinates (ie. z and w) zero. This gives us (x,y,0,0) as our projected point.
In n-dimensional space, the projection of (x1,x2,x3,x4,….,xn) is (x1,x2,0,0,…,0). In other words, all coordinates apart from the first two become zero.
We now discuss the process of visualising a 4D cube.
We call the n-dimensional generalisation of the square an ‘n-square’. The familiar 2D square is therefore the ‘2-square’. We call the cube a ‘3-square’. It follows that the 4D cube (hypercube) is the ‘4-square’.
If we just want to use 0s and 1s in the coordinates, a 2-square has vertices at (0,0), (0,1), (1,0) and (1,1).
The vertices of the 3-square are (0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0) and (1,1,1).
EXERCISE: How many vertices does a 4-square have? Can you list them out, or describe how you would list them? What about an n-square?
ANSWER 1: We see that the vertices of the 2-square are all possible combinations of two numbers, each either a 0 or a 1. Order matters here, since (0,1) is not the same as (1,0). Now the same goes for a 3-square. Its vertices are all possible ordered triplets of 0s and 1s.
Consider the vertices of a 4-square. The first coordinate can be a 0 or a 1. In each case, the second coordinate can be a 0 or a 1, giving 4 possible combinations so far. For each of these cases, the third coordinate can be a 0 or a 1. This gives 8 in total. Finally, for each of these 8 cases, there are two options for the final coordinate. Hence, a 4-square has 2^4 = 16 vertices. To list them, we would have to write down all possible ordered quartets of 0s and 1s. Also, by the same logic, an n-square has 2^n vertices.
ANSWER 2: Note that the vertices of the 2-square correspond to all binary numbers of 2 bits. Those of the 3-square correspond to all 3 bit binary numbers. Therefore the vertices of an n-square correspond to all the n bit binary numbers, of which there are exactly 2^n. To list them, we would have to count from 0 to (2^n)-1 in binary. Think about why this is true if you aren’t sure.
Once we have all the vertices of a 4-square, we can scale it, move it around and rotate it, if we wish. Then we can project it onto our screen (the xy-plane) by sending each vertex of the form (x,y,z,w) to (x,y,0,0).
This process is exactly what’s being done in the link below to visualise a 4-square! The 4-square is moving since we are showing it being rotated as it is projected.
Interactive link here.
In the following link, we use a different projection called the perspective projection to visualise the 4-square. We have not discussed the perspective projection, however the process of thinking about it in 3D and then generalising it to higher dimensions can still be applied.
Interactive link here.
Some extra discussions that may be of interest are below.
What would we do if we don’t want to project onto the xy-plane? In other words, what if our screen doesn’t happen to be the xy-plane?
To answer this, say we want to project n-dimensional space (denoted as R^n) onto a plane P. We can apply a transformation T (specifically a translation followed by a rotation) to R^n. This will give us a transformed version of the space, T(R^n). We want T to be such that after the transformation, the plane P coincides with the xy-plane. We can then project T(R^n) onto the xy-plane for the same effect as projecting R^n onto P. This is because R^n relative to P is identical to T(R^n) relative to the xy-plane.
EXERCISE: Do you think the human eye sees in an orthographic projection? Why or why not? As a hint, think about certain properties of objects that the orthographic projection preserves. Do our eyes preserve these properties?
EXERCISE: Define the Euclidean norm of a point (x1,x2,…,xn) to be the square root of x1^2 + x2^2 + … + xn^2. The unit n-dimensional sphere is defined to be the set of all points in R^n with Euclidean norm 1. Describe what you see when you take the orthographic projection of a unit n-dimensional sphere centred on the origin onto the xy-plane. Here n is greater than or equal to 3. First you should think about the 3D sphere, and what its projection looks like.
EXERCISE: What do we rotate objects around in 4 dimensions? What do we reflect objects in in 4 dimensions? What about n-dimensions?
You can find more entries from the Teddy Rocks Maths Competition here.