Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Find the length of a main diagonal of an n-dimensional cube, for example the one from $(0,0,...,0)$ to $(R,R,...,R)$

I tried to use induction to prove that its $\sqrt{n}R$ but I'm stuck on writing the proof that for an n-dimensional cube, the perpendiculars that with that main diagonal compose the right-angled triangle are the main diagonal of the n-1-dimensional cube and another R-length-ed perpendicular


share|cite|improve this question
up vote 17 down vote accepted

Simple derivation:

From my naive perspective, you are looking for a distance between points $(0,0,\dots,0)$ and $(R,R,\dots,R)$. Since you are in $n$-dimensional Euclidean space, their separation is $\sqrt{(R-0)^2 + \dots + (R-0)^2} = \sqrt{n} R$. Would that be sufficient?

Looking at it geometrically, if the length in $(n-1)$ dimensions is $l_{n-1}$, you can use the fact that, since the $n^{th}$ direction is perpendicular to any direction in the $(n-1)$ dimensional subspace, Pythagorean addition of distances holds and $l_n = \sqrt{l_{n-1}^2 + R^2}.$ Starting from $l_1 = R$, you get $l_n = \sqrt{n} R$ by induction.

More detailed derivation using differential geometry:

To make it more explicit, one can use the metric of $n$-dimensional Euclidean space $g_{ab} = \delta_{ab}$ for $a,b \in [1,2,\dots,n]$. The "distance" $s$ is then defined as $$ (\mathrm{d} s)^2 = \sum_{a,b} g_{ab} \mathrm{d}x^a \mathrm{d}x^b \, , $$ in general. Let's have a curve $x^a = x^a(t)$ parametrised by $t$. Then $$ \frac{\mathrm{d} s}{\mathrm{d} t} = \sqrt{\sum_{a,b} g_{ab} \frac{\mathrm{d}x^a}{\mathrm{d}t} \frac{\mathrm{d}x^b}{\mathrm{d}t}} = \sqrt{\sum_a \left ( \frac{\mathrm{d}x^a}{\mathrm{d}t} \right ) ^2 } \, . $$ The diagonal going from $(0,0,\dots,0)$ to $(R,R,\dots,R)$ can be described by the curve $x^a(t) = Rt$ for $t \in [0,1]$. The total length of the curve is $$ s = \int_0^1 \mathrm{d} s = \sqrt{\sum_a \left ( \frac{\mathrm{d}x^a}{\mathrm{d}t} \right ) ^2 } \mathrm{d}t = \int_0^1 \sqrt{\sum_a \left ( R \right ) ^2 } \mathrm{d}t = \int_0^1 \sqrt{n} R \mathrm{d} t = \sqrt{n} R \, . $$ Therefore the length of the diagonal in $n$ dimensions is $\sqrt{n} R$.

share|cite|improve this answer
"Since you are in n-dimensional Euclidean space, their separation is [...]" - and he doesn't have to prove that? – Random832 Jan 7 at 19:30
I don't think so, because it's the definition of the Euclidean distance – Amjad Jan 7 at 20:45
I think you do not have to prove that, but will edit my answer to make it more explicit. – SSF Jan 7 at 20:47

I think this is basically what you've been trying to do, but here's a picture of a series of right angled triangles, each built using the hypotenuse of the previous triangle and a side of length $R$ as legs. The red triangle's hypotenuse is the diagonal of a square, the green triangle's hypotenuse is the diagonal of a cube, and the blue triangle's hypotenuse is that diagonal of the 4-cube. enter image description here

The only particular thing we must prove about this is that the chosen diagonal is perpendicular to the chosen edge at each step. Essentially, this is because, to extend the cube one dimension higher, we add a new side, perpendicular to all the other sides. A consequence of this is that any line drawn in the space of the original cube is perpendicular to the new edges - for instance, any line drawn on the bottom face of a cube is perpendicular to the edges connecting that face to the top face.

This is most simply a consequence of vectors: The set of vectors perpendicular to a given one is a linear subspace. Since the diagonal of a cube is in the span of the edges of the cube and all of those are perpendicular to the new edge, we find that the diagonal is perpendicular to the new edge. Basically, extending a cube is adding a new vector perpendicular to everything we already had.

One could state this property (sufficiently well for our purposes), without resorting to vectors, as saying:

If $AB$ and $BC$ are perpendicular to $ED$, then $AC$ is perpendicular to $ED$.

which could be proved using the law of cosines. Then, in our case, we can just apply that $AB$ and $BC$ are perpendicular to $ED$ by definition of a cube, thus so is $AC$. Then, again $CD$ is perpendicular to $ED$ and we just proved $AC$ was, meaning $AD$ is perpendicular to $ED$, which gets us the result we wanted.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.