Tuesday, April 5, 2011

What's the shortest path between 2 points?

If you said, "a straight line, silly!?!", think again.


Imagine a chessboard stretched out before you, with a single rook placed in one of the corners. What's the shortest path to the opposing corner along the diagonal, given an unlimited number of moves and recalling that rooks are restricted to moving in straight lines (no diagonals)?

Well, it turns out that all valid paths have the same length, if we count a single step as unit length (1) and we stipulate that each move must be towards the goal, never away. So we can take any zig-zaggy, staircase-like path from corner to corner and the trip distance will be the same. To better illustrate the situation we can view our chessboard as a simple 2D array of numbers.



Fig 1. Our chessboard converted to a 2D (8x8) addition table and example corner-to-corner paths over the grid. The length of the inner path is the same as the outer. Grid size reduction could continue ad infinitum without ever getting closer to the length of the true diagonal. The color scheme is intended to emphasize the additive aspect of the length.

In Fig. 1, we're going to start our rook at 0 (the minimum) and end at 14 (the maximum), taking any path we like, so long as we don't travel diagonally and we never backtrack. Each square is numbered by the path distance from 0 traveled so far, so it's clear that all paths do indeed have the same length; they all trace out the incremental sequence {0,1,2,...,12,13,14}. Note that, regardless of the path taken, the entire distance in the horizontal and vertical must be traversed: the array is nothing more than an addition table.

As we might expect, the number of entries in our table makes no difference whatever in the constancy of the path lengths. We could extend the number in both directions by 1 or a googol (10100); yet for any size we choose, the path lengths remain fixed. The numbers themselves could represent anything from Planck lengths (~10-35m) to light years (~9.5x1015m); yet for any unit of measurement, the relative lengthiness of the paths remains unchanged. What's more, we could hoist our table and paths right out of the page into the 3rd dimension; yet we'd get only a 3D addition table for our efforts; and while a bit zig-zaggier, each min-max path would still measure the same distance overall.



Fig 2. A 3D (8x8x8) addition table (left) and example corner-to-corner paths through the lattice (right). Again, the length of the inner path is the same as the outer. All valid paths trace out the incremental sequence {0, 1, 2, ..., 19, 20, 21}.

Are there numbers for which there are no entries in our addition table? One way to see this discrepancy is to realize that, for any nonzero grid size we choose, we can always find an empty square to place a number in. Conversely, for any number on the diagonal or not otherwise in the table, we can always add another entry in the table. If this is a paradox of the "chicken and egg" variety, and if addition tables are chickens and diagonals are eggs, then it appears that the chickens have it by a beak. To plumb the depths of this barnyard mystery let's look for still more dimensions buried under the coop.

Perhaps the most intuitive picture of 4D is seen in an operation called a "sweep," which is basically a paintbrush-like stroke in a particular direction. For example, a 1D line is a sweep of a point; a 2D plane is a sweep of a line; a 3D volume is a sweep of a plane; and a 4D hyper-volume is a sweep of a volume. For the purposes of our barnyard experiment, we can think of our limited 4D table as a 3D table "swept" in a choice direction over a unit circle. That is, placing ourselves at the center of a unit circle, any point on its circumference is a unit step away. More generally, we can think of a 5D table as a 3D table swept in any one of a sphere of possible directions, taking every point on the 2D surface of a unit sphere to be a unit step away from its center.



Fig 3. Hemisphere of sweep directions. Left: External view of a choice sweep direction. Right: A 2D "high-noon shadow" view from the center of the sphere on left looking straight down.



Fig 4. A murky 5D (8x8x8x8x1) addition table (left) as an incremental translation or "sweep" of the 3D table along its diagonal and example corner-to-corner paths through its hyper-lattice (right). All valid paths trace out the incremental sequence {0, 1, 2, ..., 26, 27, 28}. White arrows represent the 4th sweep direction and connect the 8 otherwise identical 3D paths. To minimize clutter, only 1 of the 8 otherwise identical table directions is shown.

In figure 4 it appears that the eggs (diagonals) have been buried in the 5th dimension, but we can't be sure. After all, there are at least as many ways to slice up our addition table as there are dimensions, so in a larger context this could be seen as a parlor trick--as one card of a complete deck is to one slice of a higher dimensional space (or as 12 eggs are to a baker's dozen).

To see the slice analogy, take a piece of lumber, like a 2x4. The 3rd dimension is the board's length, which can vary wildly but is otherwise initially uninteresting to a carpenter entering a lumber store; first and foremost is the 2D part--the 2x4 slice. Later, she could specify a particular length, such as 19'', by tacking on the extra dimension (2x4)x(19); but as all such lengths project to the same 2x4 footprint, the 2D slice is the salient profile to specify first. Now we've only to realize that there are other equally valid if less practical ways to slice the wood. We could, for example, specify length first, as in 19x2x4; or we could specify height first, as in 4x19x2. No matter how we choose to order the slices (or shuffle the deck), the overall shape and volume is exactly the same--only our view of it is different. With this in mind it should be clear that if we were to tack on addition 1's to our board specification, the volume would be unaffected. That is to say the volume of 2x4x1x1x1 is numerically the same as 2x4, however unlikely a 5D Brazilian rosewood tree may be.



Fig 4.1. Orthographic views of the hyper-volume in Fig. 4 along 2 of the 4 sweep axes: first along the blue axis, then the white (red and green are similar to blue). Note that in both views the length of the outer 3D path is still 21, but now represented by a sequence of zigzags on the left and a single triangular loop on the right. The apparent length of the inner 3D path on the right, however, has dwindled to 3 (plus the 6 hidden cycles). While it's tempting to take the white-arrowed diagonal the full distance on the left, we'd need a bigger board to do so, being currently limited to a total of 7 steps along each axis.

In an eggshell, no matter how many dimensions we start with, we can always add extra dimensions by tacking on extra 1's or we can flatten to 1's the extra unneeded dimensions by way of projection--by slicing out the salient cross section. In either case, the 1's contribute nothing (0) to the path length and may be safely suppressed. So what does all this leave us with?

Well, for one thing, it leaves us with one whale of an addition table, not to mention a chessboard that even Mr. Spock would secretly find a little intimidating. But as tantalizing though number crunching and hyper-chess of the 5th kind may be, we may well imagine that our marathon sweep-fest would see strange shapes emerge in the wilds of 7D, weird hyper-geometries in the brush-swept scapes of 10D stranger still. Where does it end, or when? Addition table wise, we can continue to pile up the dimensions in a never ending parade of sweeps, however difficult it becomes to ascribe intuitive geometric meaning and insightful images to these extra connected directions. [An interesting aspect of this puzzle is determining the various ways in which each subsequent sweep connects to its predecessor(s) incrementally--such that all min-max (corner-to-corner) paths are of the {0,1,2,...,N} form.] May your brush be swift and your sweeps true.



Fig 5. Curves emerge in a network of lines in some higher dimensional space. Each arrow represents a subspace (a single card of a numberless deck) in a slightly different configuration.

What's the shortest path between 2 points? A straight line. Never claimed it wasn't. But now what's a straight line again?

No comments:

Post a Comment