20 Apr

Three-D Pythagorean Theorem

This recent post described a construction that demonstrated the “Three-D Pythagorean Theorem.” Here we dive a bit deeper into this bit of mathematics that may be less familiar than it deserves.

A right tetrahedron has, by definition, a vertex where three right angles meet (there can be only one). An example is shown in the diagram at right. Suppose that the areas of its faces are $A < B < C < D$. Then the Three-Dimensional Pythagorean Theorem (also known as de Gua’s Theorem) says that \[A^2 + B^2 + C^2 = D^2.\]

This is a generalization of the “usual” two-dimensional Pythagorean Theorem. How so? Here we say that one theorem “generalizes” another if it has the other theorem as a special case. How can we get the 2D theorem as a special case of the 3D? Unlike with most generalizations, it’s not particularly clear.

Because the area of square BEFD is twice that of ABCD, the diagonal BD is √2 times the side length AB.

In fact, I was only able to derive the usual PT from the 3D one if I also presumed the special case case of the usual PT that the diagonal of a square is √2 times its side — but that case is quite simple to prove on its own, by considering a 2-by-2 grid of squares and four of the diagonals of squares in that grid that themselves form a square (you can see essentially the full proof to the left).

Now, assuming the 3D Pythagorean Theorem and the fact that the diagonal of a square is √2 times its side, we derive the usual Pythagorean Theorem as follows: Let $a$ and $b$ be arbitrary lengths, and consider the right tetrahedron with legs (edges meeting at the right-angle vertex) of lengths $a$, $b$, and $b$.

Then the edges of the base (the face that does not include the right-angle vertex) of this right tetrahedron are $c$, $c$, and $\sqrt{2}b$, where $c$ is the hypotenuse of a right triangle with sides $a$ and $b$ (see the diagram at right). The areas of the other three faces are $ab/2$, $ab/2$, and $b^2/2$. Hence, by the 3D PT, the area of the base is $b^2(2a^2 + b^2)/4$, and so the height $h$ of the base (from the vertex between the two sides of length $c$) is $\sqrt{a^2 +b^2/2}$. But the altitude of an isosceles triangle bisects the third side, so $c$ is also the hypotenuse of a right triangle with legs $b/\sqrt2$ and $\sqrt{a^2+b^2/2}$.

Iterating this construction, we see that $c$ must also be the hypotenuse of a right triangle with legs $b/2$ and $\sqrt{a^2+3b^2/4}$. Iterating further, $c$ must also be the hypotenuse of a right triangle with legs $b/4$ and $\sqrt{a^2+15b^2/16}$, and further in general $c$ is the hypotenuse of a right triangle with legs $b/2^n$ and $\sqrt{a^2 + b^2(2^{2n}-1)/2^{2n}}$. Taking the limit as $n$ grows without bound, $b/2^n$ approaches zero and $(2^{2n}-1)/2^{2n}$ approaches one, and we see that $c$ must equal $\sqrt{a^2+b^2}$, as desired.

Of course, one would never really prove the usual Pythagorean Theorem in this way; the above merely serves to justify calling the 3D PT a “generalization” of the usual one, in that we can recover the usual one from it.

All this begs the question, how do we prove the Three-D Pythagorean Theorem itself? The simplest way is to generalize the following atypical “proof” of the usual Pythagorean Theorem:

Place a right triangle with legs $a$ and $b$ on a coordinate plane so that the vertex of its right angle is at the origin and the legs extend along the $x$ and $y$ axes, respectively. Then by the two-intercept form of a line, the equation of the line containing the hypotenuse is $x/a + y/b = 1$. Also, the line through the origin given by $y=ax/b$ is perpendicular to the hypotenuse (see the diagram to the left, with the hypotenuse in blue). These two lines intersect at the point $(ab^2/(b^2+a^2), a^2b/(b^2+a^2))$. The line segment from the origin to this point (dark green in the diagram) has length $ab/\sqrt{a^2+b^2}$. But this line segment is also an altitude of the right triangle with respect to the hypotenuse as base. Since the area of the rectangle is $ab/2$, by dividing we get that the hypotenuse of the right triangle must be $\sqrt{a^2+b^2}$.

I put “proof” in quotes because it’s circular — I actually used the Pythagorean Theorem to get the length of the altitude segment. However, if we do the same proof in three dimensions, we still only need the ordinary Pythagorean Theorem to get the length of the corresponding segment, and so we get a bona fide proof of the 3D Pythagorean Theorem (using the usual PT, which is OK because as mentioned, we would not actually use the 3D PT to prove the usual 2D PT — there are plenty of independent proofs). That goes like so:

Place a right tetrahedron with legs $a$, $b$, and $c$ in a coordinate system so that its right-angled vertex is at the origin and the legs extend along the $x$, $y$, and $z$ axes, respectively. Then by the three-intercept form of a plane, the equation of the plane containing the base of the right tetrahedron is $x/a + y/b + z/c = 1$. (See the diagram to the right.) Also, the line through the origin given in parametric from with parameter $t$ by $(x,y,z) = (bct, act, abt)$ is perpendicular to the base (you can check this by taking the dot product of $(bc, ac, ab)$ with the two vectors $(a,-b,0)$ and $(0,b, -c)$ which both clearly lie in the plane of the base). This line intersects the plane at the point \[\left(\frac{a(bc)^2}{(bc)^2+(ac)^2+(ab)^2},\frac{b(ac)^2}{(bc)^2+(ac)^2+(ab)^2},\frac{c(ab)^2}{(bc)^2+(ac)^2+(ab)^2}\right).\] The line segment from the origin to this point has length $abc/\sqrt{(bc)^2+(ac)^2+(ab)^2}$ (that’s where I’m using the regular PT). But this line segment (dashed green in the diagram) is also an altitude of the tetrahedron to the base. Since the volume of the tetrahedron is $abc/6$, the area of the base must be $\frac12\sqrt{(bc)^2+(ac)^2+(ab)^2}$. So indeed the square of the area of the base is $(bc/2)^2 + (ac/2)^2 + (ab/2)^2$, which is the sum of the squares of the areas of the other three sides as desired.

In case you’re wondering, the Pythagorean Theorem does generalize in this way to $n$ dimensions: the square of the $(n-1)$-hypervolume of the base of a right $n$-simplex is the sum of the squares of $(n-1)$-hypervolumes of the other faces, and the exact same proof as just given, except with more variables and an $n!$ in place of “6,” works.

04 Oct

Integer Complexity Measures

[Note this post is a bit outdated, and not maintained; the most up-to-date version of this information can be found in my pages on the OEIS wiki.]

I’ve recently become interested in a family of interrelated sequences that can be found in the Online Encyclopedia of Integer Sequences (OEIS). These sequences all have to do with one approach to measuring the “complexity” of an integer. This approach assumes that you have some basic “building blocks” for constructing integers: starting numbers you’re allowed to use, and operations that you may apply to them. The idea, then, is that the number of these building blocks that you need to arrive at a particular integer is one way of characterizing how “complex” that integer is.

This approach to constructing integers may seem familiar from the “Four fours” puzzle: Given four instances of the number 4 to start with, and a variety of operations that you might use, how many different whole numbers can you construct? For some examples, \[1 = \frac44 \quad 2 = \frac{4+4}4 \quad 3 = \frac{4+4+4}4 \quad 5 = 4+\frac44 \quad \ldots \quad 8 = 4 + 4 \quad \ldots \] Here it seems quite reasonable that in terms of “expressing with fours,” the number eight is “simpler” than the number three.

The lowest-numbered sequence (that I’ve found) in the OEIS that has to do with integer complexity is A000792. In the case of this sequence, the only number you’re allowed to start with is one, and the only operations you’re allowed to use are plus and times. The $n$th entry of sequence A000792 then tells you the largest number you can produce using at most $n$ ones.

Formally, let $A$ be an “alphabet” of numbers and operators; for simplicity we’ll assume all operators are unary or binary. One can then form finite sequences of elements from $A$; such a sequence is a well-formed RPN expression if no initial subsequence has as many binary operators as numbers. Each well-formed RPN expression unambiguously determines its value: imagine you have an initially-empty stack of numbers, and go through the sequence from left to right. Any time you encounter a number, put it on top of the stack; when you encounter a unary operator, modify the top number on the stack by applying that operator; and when you encounter any binary operator $\ast$, remove $a$ and $b$ (respectively) from the second-to-top and top positions from the stack, and then put $a\ast b$ on top of the stack (reducing the height of the stack by one). The value of the RPN expression is the top number on the stack when the entire expression has been scanned. The well-formed condition guarantees the stack never empties.

We can now define the $A$-operand complexity of a number $n$, which we’ll write as $c_A(n)$, as the minimum number of numbers in any well-formed RPN expression with value $n$, the $A$-operator complexity $d_A(n)$ as the minimum number of operators in any well-formed RPN expression with value $n$, and similarly the $A$-expression complexity $e_A(n)$ as the minimum length of a well-formed RPN expression with value $n$. There is no general relationship between $c_A$, $d_A$, and $e_A$, but if $A$ contains only binary operators, then $e_A(n)$ $= 2c_A(n)-1$ $= 2d_A(n)+1$. (Briefly, count the number of operators needed to reduce the operands to a single number; clearly the minimal expression in any case ends with a stack of just one number.)

Since it’s the most common notion of complexity used in the OEIS, we take “complexity” without an adjective to refer to $c_A$, the $A$-operand complexity.

I’ve also assembled a table that organizes sequences in the OEIS related to these notions of integer complexity, according to the alphabet $A$ and the particular measure or property of the complexity.

30 Aug

Whence 2/(3+√5) ?

In both the Woven SSD and the Woven GSD, you calculate the inset (from the points where the rods meet near their ends) for putting marks on the rods by multiplying their lengths by 2/(3+√5). Where does that strange-looking number come from?

The key is that both figures consist of (regular) pentagrams, just interlocked in different ways. In other words, in both structures, looking only at any 5 rods in the same plane, we see:

What we’re interested in the fraction of the length of one rod (that is, the length between the points of the star where the rods cross; we’ll ignore the small overhangs beyond that from here on) represented by the distance from a point to the first internal intersection. In other words, we want the ratio of the red segment to the green segment in this diagram:

Now imagine that these segments are roads, and you start driving in a car from the red-blue point, and you follow all five of the roads until you end up back where you started, pointing in the same direction. You make five turns through the angle $\alpha$ indicated in the diagram below, but end up overall making two full turns all the way around (i.e., overall your car turns through an angle of $720^{\circ} = 4\pi = 2\tau.$) Therefore, $5\alpha = 2\tau,$ so the angle $\alpha = 2\tau/5,$ or 2/5 of a turn. We can then conclude that the point angle $\beta$ in the following diagram must be $\tau/2 – 2\tau/5 = \tau/10,$ or one-tenth of a turn (36 degrees).

The same argument applied to a regular pentagon shows that its interior angles are $3\tau/10$ (or 108 degrees). In other words, in the following diagram, the edges of the pentagram trisect the vertex angles of the circumscribed pentagon:

This angle relationship in turn means that the orange-pink-green triangle is similar to the brown-purple-green triangle. But it’s also clear that the long green is the sum of the brown and the purple. This similarity tells us that the sum of the purple and brown is to the orange as the purple is to the brown. But the orange is clearly the same as the purple, so the sum of the purple and brown is to the purple as the purple is to the brown. And this is exactly the definition that the purple cuts the long green in the golden ratio $\phi,$ i.e. that the purple is $1/\phi$ as long as the long green.

On the other hand, the brown-purple-green triangle is also similar to the acute pink-blue-red triangle. Applying the exact same argument as before shows that the red segment is $1/\phi$ as long as the purple segment.

Combining these two facts tells us that the red segment is $1/\phi^2$ as long as the long green segment. By solving the equation $(\phi+1)/\phi = \phi/1$, you can find the value $\phi=(1+\sqrt5)/2$. Using this value and some algebraic manipulations lets us calculate that the red segment is $2/(3+\sqrt5)$ as long as the green one, as used in the posts linked above.

09 Mar

Icosahedron in Octahedron

If you look again at the diagram of an icosahedron in a cube (at the right), you’ll see that because of its symmetry, all three of the icosahedron vertices nearest the top front cube vertex are the same distance from that cube vertex. That equidistance means that the body diagonal of the cube passes through the center of the icosahedron and is perpendicular to the nearest face of the icosahedron.

All of these properties hold at every vertex of the cube in relation to one of the eight faces of the icosahedron that do not have an edge lying in a face of the cube. Because the eight faces of the inscribed dual octahedron of the cube have these same properties, we’ve demonstrated that an icosahedron may also be inscribed in an octahedron like so:

It also means that if you extend the plane of one these particular eight faces of the icosahedron, it slices off an isosceles right triangular pyramid from the corner of the cube:

In a lattice of such cubes, eight of these pyramids fuse together at each vertex to create the octahedra seen inside the Anticos.

09 Mar

Icosahedron in Cube

As mentioned and illustrated in the post on the Anticos, it’s possible to inscribe an icosahedron in a cube. (In this case, that technically means that given a cube, you can choose two points on each face of the cube such that the convex hull of the resulting set of twelve points is a regular icosahedron.)

But why should this be so? To see this, it’s easiest to start with a regular dodecahedron, say with unit edge length. Notice the interesting pattern of the blue face diagonals in this diagram:


Notice that during this transformation, each of the edges remains in the plane perpendicular to that axis. Therefore, twelve of the vertices of an icosahedron lie on the surface of a cube, two on each face. Since an icosahedron only has twelve vertices, it is inscribed in a cube.

30 Jul

Insubordinate Integral

How does the value of the following improper integral compare to 1? I.e., is it smaller, larger, or exactly equal to 1?

(This problem was proposed to Math Horizons Playground by Mehtaab Sawney of Commack High School. And for all of you $\pi$-ists out there, $\tau$ is of course just the radian measure of a full circle, i.e., $\tau=2\pi$.)

Stumped? You can peek at the solution using the password “strapyb”.

30 Jul

Troubling Triangle

What is the area of the pink shaded triangle (as a fraction of ABC)?

For definiteness, the unlabeled points do in fact trisect each of the sides of the triangle.

Stumped? You can peek at the answer using the password “threedian”.

30 Jul

Smallish Sequence

What are the next few terms in this sequence of smallish numbers?

1 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 1 3 2 1 1 3 2 1 3 1 1 3 1 1 1 3 2 1 1 3 2 1 1 3 ? ? ?

(And, of course, what’s the rule generating the sequence?)

Stumped? You can peek at the solution using the password “1p1a2s”.

11 Apr

Side of Spherical Square

This post contains the details of the claim made in “More Spherical Construction” that you can determine the side length of a spherical square from the ratio between the lengths of its diagonals. We’ll do this on a sphere of radius one; everything scales by a factor of the radius for a general sphere.

The advantage of working on a sphere of radius one is that then the side length is nothing other than the measure of the central angle (in radians) between two adjacent vertices of the square. Similarly, the diagonal is the central angle between opposite vertices of the square.

The easiest way to construct a square on the unit sphere is to place its center at the intersection of the sphere and the x-axis, and then choose a (positive) angle $\theta \leq \tau/4$ (where $\tau = 2\pi$ is the radian measure of a full circle) and place two vertices at plus or minus $\theta$ (from the square’s center) in the longitudinal direction and two vertices at plus or minus $\theta$ in the latitudinal direction. In spherical coordinates, the center is at $(1,0,\tau/4)$ and the four vertices are at $(1,-\theta,\tau/4), (1,\theta,\tau/4), (1,0,\tau/4-\theta), (1,0,\tau/4+\theta)$. For this square, the diagonal is obviously $2\theta$; it remains only to compute the side length of the square.

Using the great-circle distance formula on the two points $(1,\theta,\tau/4)$ and $(1,0,\tau/4-\theta)$ yields a side length of \[\arccos(\cos(\tau/4)\cos(\tau/4-\theta) + \sin(\tau/4)\sin(\tau/4-\theta)\cos(\theta)\;).\]

Since $\cos(\tau/4)$ is 0 and $\sin(\tau/4)$ is 1, this expression equals \[\arccos(\sin(\tau/4-\theta)\cos(\theta)).\]

And further, $\sin(\tau/4-\theta) = \cos(\theta)$, so the side length is just \[\arccos(\cos^2 \theta).\]

Therefore, the ratio of the diagonal to the side of the square is $2\theta/\arccos(\cos^2 \theta)$. Graphing this on the allowed interval $(0,\tau/4]$ for $\theta$ immediately demonstrates the claims made in the referring post: no value of the ratio is repeated for different values of $\theta$, so the ratio determines the diagonal (and side length) of the square; the maximum value is 2; and any value greater than $\sqrt2$ is achievable.

If you’d rather not rely on graphing software to extract these facts, but rather demonstrate them just from the formulas, here’s how you can proceed. The value 2 at $\theta=\tau/4$ comes from straight substitution. The value at 0 by substitution is the indeterminate 0/0, so we obtain the value by L’Hôpital’s rule: the derivative of the numerator is 2, but the derivative of the denominator is \[\frac{2\cos \theta}{\sqrt{1+\cos^2\theta}},\] so the diagonal-side ratio has the limiting value $\sqrt2$ at $\theta =0$. Finally, we need to show that the ratio is monotone increasing on the interval of interest. By the quotient rule, this is equivalent to showing that on this interval \[\arccos(\cos^2\theta) > \frac{2\theta\cos\theta}{\sqrt{1+\cos^2\theta}}.\] Both sides are 0 at $\theta=0$, so we can take derivatives one more time; the derivative of the left-hand side is of course $2\cos\theta(1+\cos^2\theta)^{-1/2}$ again, which on this interval is always larger than the derivative of the right-hand side, namely $2\cos\theta(1+\cos^2\theta)^{-1/2} – 2\theta\sin\theta(1+\cos^2\theta)^{-3/2}$. So the left-hand side is also always larger than the right hand side, i.e., the derivative of the diagonal-side ratio is positive on this interval.