163

There is a reasonably popular card game entitled 24, where players attempt to derive 24 by applying basic arithmetic operations to a set of four positive integers. For example, the provided integers may be {3, 3, 8, 8}. A solution must use all of the provided integers, so 3*8 is an invalid solution. The actual solution is difficult to find, being 8/(3-(8/3)). This can be represented as a tree:

The number of ways in which four integers {a, b, c, d} can interact with four operations {+, *, /, -} is rather large. An upper bound is 7680, which is the number of fully-parenthesised expressions containing the four integers (in some permutation) separated with arithmetic operations. This is the product of the number of permutations (4! = 24), parenthesisations (C(3) = 5) and sequences of operations (4^3 = 64). The actual number of possibilities is considerably smaller, as I have not taken into account the commutativity or associativity of + and *.

I heard that a variant of this game is 163. You begin with a few randomly chosen playing cards (where Jack, Queen and King represent 11, 12 and 13, respectively) and attempt to obtain a value as close as possible to 163. Being the largest Heegner number, there is a very elegant formula approximating 163, discovered by Srinivasa Ramanujan:

The logarithm is, of course, to base e.

Posted in Uncategorized | Leave a comment

Antikythera mechanism

Near the beginning of the 20th century, a shipwreck was discovered. It contained a horde of treasure en route from Greece to Rome, including a life-size bronze head of a philosopher. The most valuable treasure, however, was a 2000-year-old analogue computer believed to have originated on the island of Syracuse.

The Antikythera mechanism is a sophisticated arrangement of bronze gears, which can calculate the relative positions of the Sun and Moon, lunar phases and even eclipses. Archaeologists were unable to determine the workings of the computer until the advent of X-ray tomography revealed gears and inscriptions pertaining to astronomical calculations. In 2006, Michael Wright constructed the first reasonably accurate mechanical model of the mechanism, reviving this ancient computer. There have been a handful of computer simulations, including the one presented here.

The Antikythera mechanism is enclosed in a box with a protruding crank (a handle connected to a crown gear, not an irrational person who refutes Cantor’s diagonalisation argument!) and orrery displaying the positions of the Sun and Moon. Here’s a partial screenshot of the model I made in Mathematica:

Turning the crank causes the Sun and Moon pointers to move, with the phase of the Moon represented accurately by an embedded semi-silvered sphere. There are two concentric dials: one displaying the tropical zodiac; the other indicating the current date in the Egyptian calendar. The inscriptions are, as expected, in Ancient Greek.

Just looking at the outside will not give a very good understanding of how the mechanism actually functions. For this, it is necessary to strip away the enclosure and analyse the arrangement of interconnected gears.

The 48-tooth crown gear connected to the crank handle meshes with a large, horizontal 224-tooth gear (the mean sun gear, b1). This completes one revolution per simulated year. As you can see, the central pillar rotates, advancing the position of the Sun needle and globe.

Most of the other gears encode rational approximations to astronomical cycles, such as the Exeligmos and Metonic cycles. The 223-tooth gear (e3), for example, is a necessity due to the Saros cycle, which lasts for 223 synodic months. As 223 is a prime number, it cannot be ‘factorised’ into smaller gears. Let’s have a look underneath the mechanism, to see the remaining mechanics.

We can see a 188-tooth annular (ring-shaped) gear, e4. This is welded to e3, which lies directly above it (or behind, in this screenshot). Mounted on e3 are two offset gears, which rotate together due to a pin-and-slot connection. The offset means that one of the gears (k2) moves at a non-linear rate with respect to the other (k1), emulating the elliptic orbit of the Moon. This is then transferred back up the central spindle ‘b’ by a network of other gears.

I zeroed the device to May 6, 2012, 03:35 GMT, when a full moon and lunar perigee (closest approach to the Earth) occurred merely two minutes apart. According to my calculations, this event only occurs every 1500 years or so. As the moon is travelling fastest at perigee, the pin in the pin-and-slot mechanism is closest to the axes of k2. The period of k1 and k2 is an anomalistic month: the time between successive lunar perigees.

The moon pointer rotates with a period of one sidereal month with respect to the fixed stars. By means of a crown gear mounted on the top of the ‘b’ spindle, the difference between the angular velocities of the sun and moon is determined. The period of this is the synodic month, which is the time between successive full moons. I had some difficulty implementing this, as the Wikipedia article is inaccurate (claiming that there are 12.474, as opposed to 12.368, synodic months per solar year). The crown gear rotates the semi-silvered ball about a horizontal axle to display the current phase of the moon.

Another feature of the mechanism is the ability to predict eclipses. This cannot be inferred simply from the orrery on the front of the box, as in reality the orbit of the Moon is not coplanar with the orbit of the Earth around the sun (a plane known as the ecliptic). Hence, eclipse cycles are dependent on a fourth type of lunar month, the time taken for the Moon to return to the ecliptic. This is known as the draconic month. 223 synodic months are approximately equal to 242 draconic months, as we determined with the LLL algorithm.

The Saros, Exeligmos and Metonic cycles are all displayed by means of pointers on the rear face of the mechanism. There are additional pointers for the Callippic cycle and calculation of the dates of the Olympic Games, Nemean Games et cetera. The Metonic and Saros cycles are displayed on Archimedean spirals for greater precision, with a stylus tracking the spiral in a similar fashion to those record players people listened to in the 70s.

The Antikythera mechanism originated on Syracuse, which suggests that Archimedes invented a precursor to this analogue computer. This is rather fitting, actually, due to the Archimedean spirals engraved into the posterior plate.

I may upload the simulation to the Wolfram Demonstrations Project in the foreseeable future. It’s very complex (several pages of code) and rather slow, though. You can see a couple of my other demonstrations in the meantime.

Planetary display?

At the moment, I have only accounted for the known mechanism. The large vacuous space above the mean sun gear, together with suggestive inscriptions, hint at the possibility that the mechanism also displayed the positions of the five planets known at that time (namely Mercury, Venus, Mars, Jupiter and Saturn). Unfortunately, we have no idea how this mechanism worked, and there have been three radically different proposals.

Posted in Uncategorized | 3 Comments

MODA: Sequences and Polynomials

It’s reached this time of week again, so I’ve uploaded the fourth and fifth chapters of Mathematical Olympiad Dark Arts. Enjoy!

As before, please notify me of any errors or omissions, no matter how trivial, so that I can amend them before officially releasing the book.

Posted in MODA | Leave a comment

Lizard and Spock dice

Continuing the theme of magic squares, we begin with the unique simplest non-trivial magic square. It contains the integers {1, 2, …, 9}, one in each square, such that the rows, columns and diagonals all sum to 15.

Remarkably, the converse is also true. If three distinct integers in the interval {1, 2, …, 9} sum to 15, they form a line in the Lo-shu magic square. This enabled Professor Marcus du Sautoy to demonstrate an equivalent game to tic-tac-toe in the 2006 Royal Institution Christmas Lectures. For convenience, the rules are repeated below:

  • There is a ‘bank’, initially containing each of the numbers {1, 2, …, 9}.
  • Each turn, a player removes a number from the bank and adds it to his or her inventory. Players alternate turns until the supply is exhausted or someone wins.
  • If a player has three numbers summing to 15, he or she wins.

Non-transitive dice

Another property of the Lo-shu magic square is its ability to manufacture non-transitive dice. For each row/column, we make a die by writing each number on two (antipodal) faces. For example, die A is numbered {8,3,4,8,3,4}. Similarly, die B is numbered {1,5,9,1,5,9}.

Alice and Bob have retired from sending secret messages to each other using RSA cryptography, and have decided to play a nice game of dice instead. Simultaneously, Alice throws die A and Bob throws die B. Whoever rolls the higher number wins. As a first approximation, one might imagine that the game is fair, since both dice have the same mean. Further analysis shows that Bob wins 5/9 of the time:

We then introduce a third character, Chris, whose gender is revealed by neither name nor my use of pronouns. Chris rolls die C, marked with the numbers {6,7,2,6,7,2}. Chris beats Bob 5/9 of the time, so one would imagine that die C is optimal and die A is the worst. Surprisingly, Alice beats Chris 5/9 of the time, so this new game is completely balanced! It is similar to the popular game of rock-paper-scissors.

This situation is mirrored by the dice α, β and γ. Due to the difficulty of incorporating Greek letters into blog posts, we’ll concentrate without loss of generality on their Roman counterparts.

Generalising to five dice

Sam Kass and Karen Bryla augmented the traditional game of Rock, Paper, Scissors to encompass two new entities: Lizard and Spock. I was very fortunate to find that my naïve magic square construction generalises to produce a set of five non-transitive dice with cyclic symmetry.

My five dice (which can be implemented as icosahedral dice, since 5 divides 20) are given below:

  • Rock: {1,7,13,19,25}
  • Paper: {15,16,22,3,9}
  • Scissors: {24,5,6,12,18}
  • Lizard: {17,23,4,10,11}
  • Spock: {8,14,20,21,2}

It is a remarkable fact that these dice do indeed emulate the game, i.e. die X has a probability greater than ½ of winning against die Y if and only if X beats Y in the game. Specifically, we have the following:

  • Paper disproves Spock with a probability of 14/25;
  • Spock dematerialises Rock with a probability of 14/25;
  • Rock blunts Scissors with a probability of 14/25;
  • Scissors decapitate Lizard with a probability of 14/25;
  • Lizard eats Paper with a probability of 14/25;
  • Paper smothers Rock with a probability of 13/25;
  • Rock crushes Lizard with a probability of 13/25;
  • Lizard poisons Spock with a probability of 13/25;
  • Spock smashes Scissors with a probability of 13/25;
  • Scissors cut Paper with a probability of 13/25.

Here’s a net of the Lizard die, obtained by writing the numbers in a straightforward way on the net of an icosahedron.

If I ever visited the Gathering for Gardner, I would probably give away sets of these five non-transitive icosahedral dice as exchange gifts.

Posted in Uncategorized | Leave a comment

Linear-bounded automata

If we provide a bog-standard computer with an infinite data store, it suddenly becomes a Turing machine: capable of answering any question answerable by any digital computer. Even quantum computers are no more powerful; they are merely faster. For example, a quantum computer recently factorised 15 into 5 * 3 by using Shor’s algorithm; an ordinary computer could do this much more slowly by exhaustive search.

Your computer isn’t even as powerful as a Turing machine. Having a mere finite data store, it falls into a weaker class of machines: linear-bounded automata (or LBAs). A linear bounded automaton is just a Turing machine with a large but finite amount of tape. Since we’re so familiar with digital computers, I’ll give examples of other, more unusual, LBAs.

Essentially, to make a LBA we just need to be able to make some simple components and connect them together. I’ll mention a few of the conventional and unconventional approaches here.

Approach 1: Logic gates

This is quite an abstract one. We use Boolean logic operations such as AND, OR and NOT, and have simple components performing each task. For example, the AND gate returns a ‘1’ if both inputs are ‘1’, and ‘0’ otherwise.

A better logic gate is negative-AND, or ‘NAND’. This inverts the output, so it returns a ‘0’ if both inputs are ‘1’, and ‘1’ otherwise. By connecting up arrangements of NAND gates, we can emulate any other logic circuit. We can even avoid the need for wire crossings by a strategic arrangement of three XOR gates, each composed of four NAND gates:

The inputs are on the left; the outputs are on the right.

Approach 2: Electronic circuits

A conventional way to build computers is to make these logic gates out of electronic components. We currently use CMOS (complementary metal-oxide semiconductor), although earlier versions used conventional transistors and even vacuum tubes. A few years ago I visited Manchester and saw the first stored-program computer. The Baby was built by a team of pioneers, including our favourite, Alan Turing. If you look closely, you’ll see diodes and some larger vacuum tubes called pentodes. No prizes for analysing the Greek stem and ascertaining how many electrodes a pentode has.

Baby

The first stored-program computer, housed in Manchester’s Museum of Science and Industry. Click to enlarge.

Of course, there have been earlier computers, including Charles Babbage’s analytical engine, which has yet to be physically constructed. The first computer program (which calculated the Bernoulli numbers) was written by Ada Byron, wife of Lord Byron, who happened to go to the same college as Charles Babbage, namely Trinity College, Cambridge. The web of fundamentally interconnected events never ceases to amaze…

You may believe that our silicon chips represent the most advanced possible electronic circuits, but this is not the case. Transistors have been built from carbon nanotubes, relying on the fact that they can either act as conductors or semiconductors. These nanotube circuits make silicon chips look like vacuum tubes by comparison!

Approach 3: Making logic gates out of sticky mess

Professor Andrew Adamatzky has created logic gates in amazing, unconventional ways. Reaction-diffusion systems (invented by Alan Turing) occur in certain chemical soups, such as the Belousov-Zhabotinsky reaction. This oscillates in colour violently, and causes spirals to emerge. You can investigate these sorts of patterns in the program Ready.

Adamatsky has made similar logic gates using the Plasmodium slime mould. This is a gooey cluster of cells in a much longer life cycle, involving sporangia (like fungi), spores, amoeboids, gametes (some of which have flagellae, like sperm) and zygotes.

Approach 4: Reversible logic

A key feature of the NAND gate is that we can’t reverse it: if a ‘1’ is outputted, the inputs could have either been both ‘0’, or one ‘1’ and one ‘0’. In other words, information is continually lost. An alternative is to use only reversible logic gates. My favourite is the Fredkin gate, which has three inputs (A, B, C) and three outputs (A’, B’, C’). The output C’ is an identical copy of C. The inputs A and B are mapped directly to A’ and B’ (if C is ‘0’) or swapped to B’ and A’ (if C is ‘1’). As such, it is occasionally known as a controlled-swap gate.

The Fredkin gate has three desirable properties:

  • Reversibility: given A’, B’ and C’, we can deduce A, B and C. Indeed, the gate is an involution, which means it is equal to its own inverse.
  • Conservation: A + B + C = A’ + B’ + C’, which means we can represent the pulses as solid particles.
  • Universality: any logic gate can be emulated with Fredkin gates.

The idea led to the concept of a billiard-ball computer, where ‘1’ is represented by a billiard ball and ‘0’ by empty space. Computation is achieved by the balls undergoing elastic collisions with each other. Exactly what the ‘balls’ are is left to your imagination; they could be regular balls, ionised hydrogen atoms, or even planets. Andy Adamatzky has managed to do this with soldier crabs chased by images of predatory birds!

Reversible logic can also be implemented electronically. It is of interest as it can be engineered to produce very little heat, which is the main enemy to the continual miniaturisation of silicon chips.

Quantum computers also use reversible logic gates, but they can exist in a complex superposition of states rather than just one. To emulate a quantum computer on a classical computer, an exponentially large amount of memory is required. For example, a 30-qubit quantum computer requires more than 1000000000 complex numbers to describe its state.

Approach 5: Trains and cellular automata

Instead of logic gates, we can have a single pulse moving around a network of components, storing and reading information. A fun implementation of this is a train on a railway track. It transpires that only three types of points are needed, known as the lazy point, sprung point and flip-flop point. Ian Stewart has a brilliant write-up of this.

I recall that someone even implemented a linear-bounded automaton on the Chalcraft-Greene train set, which was emulated by the Wireworld cellular automaton. There’s an even simpler cellular automaton, Banks-I, which is able to emulate any linear bounded automaton.

The next state of each cell in Banks-I is determined only by that of itself and its four immediate neighbours. Moreover, there are only two states, and the rules are isotropic (reflecting and/or rotating a computer will not affect its operation).

Again, this could have practical applications. There’s an emerging field of ‘quantum-dot cellular automata’, where each cell is a mere 60nm wide. This is superior to existing semiconductor-based circuitry.

What isn’t a linear-bounded automaton?

A Turing machine with infinite memory is more powerful than a linear-bounded automaton. Conversely, if the logic gates ‘burn out’ after a single use, like those in Matt Parker’s domino computer, it is less powerful than a LBA. If something can be ‘solved’ in an amount of time linear in the size of the machine, like the Antikythera mechanism, then it is also weaker than a linear-bounded automaton.

Posted in Uncategorized | Leave a comment

Lunisolar calendars

Here’s the post I promised you a while ago. I wrote the first part of this in an e-mail on Burns’ Night of 2011, and the main idea (which Alex Bellos termed the ‘Goucherian calendar’) was mentioned in the Guardian. The rest of this post uses more advanced mathematics to determine lunisolar and eclipse cycles.

Calendars and continued fractions

In 45 BC, Julius Caesar reformed the Roman calendar to closely adhere to the tropical year. The Julian calendar has a leap year every four years, and thus has an average year length of 1461/4 = 365.25 days. This is not a particularly accurate approximation to the actual tropical year of 365.2421897 days, so Pope Gregory later commissioned an updated version, namely the Gregorian calendar we use today. It has a rather complicated system of rules, specifically:

  • If 400|N, then year N is a leap year, otherwise;
  • If 100|N, then year N is a regular year, otherwise;
  • If 4|N, then year N is a leap year, otherwise;
  • Year N is a regular year of 365 days.

It is not too difficult to calculate that the mean length of the year is 146097/400 = 365.2425 days. Whilst much closer to the actual figure than the Julian calendar, it is far from perfect, and pretty inefficient. What we desire is a best rational approximation to the number 365.2421897. One way to do this is to find 365.2421897 on the Ford circles, and draw a vertical line to see which circles it intersects. There is a numerical alternative, which involves computing the continued fraction of 365.2421897.

Continued fraction of 365.2421897

The number 27 is quite large, so the term 1/(27+1/(2+…)) is reasonably small. If we ignore it and truncate at this point, we obtain the approximation 365+1/(4+1/(7+1/3)) = 365.2421875. This is about 140 times closer than the approximation given by the Gregorian calendar. As a mixed fraction, this is 365+31/128. Hence, we can construct a 128-year cycle, which is far more efficient than the 400-year Gregorian calendar.

  • If 128|N, then year N is a regular year, otherwise;
  • If 4|N, then year N is a leap year, otherwise;
  • Year N is a regular year.

See? Much simpler. The next discrepancy between my calendar and the Gregorian calendar occurs in the year 2048, which is a leap year in the Gregorian calendar but not in mine.

We have established that best rational approximations make good calendars. What if a sadistic deity wanted to create a solar system to make it intentionally difficult for the inhabitants to design an accurate calendar? Obviously, we would want a number that has poor rational approximations. The basis is again continued fractions, but a value of phi = 1.618033… would be optimal for this purpose. It has a continued fraction of [1; 1, 1, 1, 1, …], with the best rational approximations equal to ratios of consecutive Fibonacci numbers. In some sense, it is the ‘least rational’ number.

Let’s presume we had a mean tropical year of 365.618033… days. When should we have leap years to adhere as closely as possible to the changing seasons? A periodic calendar would be no good for this, so we instead resort to an aperiodic calendar! The optimal solution is given by the golden string:

L R L L R L R L L R L L R L R L L R L R …

We can create this sequence by using a Lindenmayer system, or L-system. When given as instructions to a robot for drawing a line, L-systems lead to beautiful fractal curves. A famous example of a curve generated in this way is the Koch snowflake. The paths traced out by my glider on the kite-and-dart Penrose tiling also have structures determined by L-systems. The golden string itself can be found in Penrose tilings and can be considered to be a one-dimensional quasicrystal.

Lunisolar calendars and the LLL algorithm

If we want to find a simple integer relationship between two quantities, we can use continued fractions. Let’s try this again on the tropical year (365.2421897 days) and the synodic month (29.530589 days). The ratio is 12.368266, which has the continued fraction:

[12; 2, 1, 2, 1, 1, 17, 3, 12, …]

Ooh! 17 is a nice, big number! Let’s truncate before that. This gives us [12; 2, 1, 2, 1, 1], or 235/19. So, 235 synodic months is almost exactly 19 tropical years. This is known as the Metonic cycle and features in the Hebrew calendar. However, what if we want to find an integer relation between not two, but three or more quantities? How do we discover an integer relationship between the length of a day, synodic month and tropical year?

The answer is to use the LLL (or Lenstra-Lenstra-Lovasz) algorithm. I imagine that the Lenstrae in the title were two distinct (probably related) mathematicians, and not an indication that Lenstra deserves twice as much credit as Lovasz for inventing the algorithm. It’s not really important how it works, just that it does. It’s actually designed for simplifying a basis for a n-dimensional lattice, but we can use it to solve our problem as well. I gave Mathematica the following input, producing this output:

I’ve cropped the output, as only the first vector is important. What I’ve essentially told the LLL algorithm to do is to find integers x, y and z, such that:

  • x is small;
  • y is small;
  • z is small;
  • x days is approximately z synodic months;
  • x days is approximately y tropical years;
  • y tropical years is approximately z synodic months.

The first vector informs us that one solution is 20819 days = 57 tropical years = 705 synodic months. This is a really good approximation; it’s only 5 minutes away from the actual tropical year, and is better than the Julian calendar. Moreover, 57:705 is the ratio 19:235 of the Metonic cycle.

Saros and Exeligmos

Patterns of solar and lunar eclipses are not really related to the spin of the Earth on its axis, or even the absolute rotation of the Earth around the Sun. More importantly, it is the relationship between the synodic month and draconic month (27.212221 days). We can use continued fractions to find a good rational approximation to 29.530589/27.212221. A reasonably good rational approximation is 242/223, which gives a cycle known as Saros. Every Saros, a similar eclipse is repeated.

If we want to find a cycle where eclipses occur at a similar time of day, then we’ll have to incorporate the length of one day into the calculation as well. Let’s use the LLL algorithm again, but replace 365.2421897 (the year, which is unimportant) with 27.212221.

We see that 19756 days, 726 draconic months and 669 synodic months all approximately equal each other. This menage a trois is known as the Exeligmos. The observant amongst you may notice that it is equal to precisely three Sarosses. (I actually had to alter the Wikipedia page, which incorrectly stated that the Exeligmos is 725 draconic months.) Every Exeligmos, a similar eclipse occurs at a similar time of day.

Why bother doing all of this? The answer is to build automata for predicting eclipses. On Syracuse, an island in Ancient Greece once inhabited by Archimedes, the legendary Antikythera mechanism was constructed. This is a complex system of gears, each with an integer number of teeth, and combines a lunisolar calendar with a planetary orrery. The Antikythera mechanism incorporates the Saros, Exeligmos and Metonic cycles amongst others, and is really impressive. This mechanical sophistication was never replicated until the Renaissance, when mechanical clocks were developed.

I’m intending to create a simulation of the Antikythera mechanism to include on the Wolfram Demonstrations Project. Shown above is the largest, 224-toothed gear, which revolves for every simulated year. One gear down, 29 to go…

Posted in Uncategorized | Leave a comment

Second and third chapters

The second and third chapters of Mathematical Olympiad Dark Arts can now be downloaded for public review.

Please notify me of any errors or omissions, no matter how trivial, so that I can amend them before officially releasing the book.

Posted in MODA | Leave a comment

Big Mandelbrots

The Mandelbrot set, as you’re probably aware, is the set of points c in the complex plane such that iterating f(z) = z² + c repeatedly doesn’t escape to infinity. By invoking the triangle inequality, it can be shown that a point escapes to infinity if and only if it ever leaves the disc of radius 2 centred on the origin.

Monochromatic image of the Mandelbrot set

Monochromatic image of the Mandelbrot set

A couple of weeks ago, I generated a 262144 by 262144 monochromatic image of the Mandelbrot set. When viewed an an ordinary monitor, it is comparable to the area of a football pitch. The compressed file (25 megabytes!) can only be opened in the cellular automata program Golly. It is stored as an optimised quadtree, which means that identical regions are stored in the same memory. For a monochromatic image such as this one, the file size is very compact (0.0004 bytes per pixel, on average).

The fun thing is that Golly can run cellular automata rules (as it’s been designed), so we can see what happens when this huge rendering of the Mandelbrot set is iterated in Conway’s Game of Life. It’s rather anticlimatic, really, resulting in four waves of gliders and a few orthogonal spaceships radiating from a Mandelbrot-shaped blob of random faeces.

Mandelbrot set in the Game of Life

Four waves of receding gliders surrounding the initial seed

Coloured images don’t compress very well as mc.gz files. In order to avoid my programs choking on the file, I had to reduce the size of the image to 65536 by 32768 for the full-colour Mandelbrot set. The points are coloured according to the number of iterations required for the point to escape the disc of radius 2. I’ve only rendered half of it due to the symmetry of the set; I chose the positive imaginary part of the complex plane without loss of generality (a great phrase, don’t you think?). When initially loaded into Golly, it looks relatively boring:

Basically, Tom Rokicki has designed his implementation of Gosper’s HashLife algorithm to be as efficient as possible. That means no colour information can be stored, unfortunately (even though I worked out a way of doing it, which only increases the quadtree size by 6-18%). Hence, we need to zoom in to appreciate the true beauty of the Mandelbrot set:

Looking at that, you would presume that this is a special fractal program, rather than a screenshot of Golly. Many details are apparent only in the coloured version, such as the whorls, spirals and dendritic fibres connecting the Mandelbrot set to its offspring. You can download the pattern file (40 megabytes!) and explore it for yourself. It’s certainly more visually attractive than its massive monochromatic cousin. The general favourite place to look is Seahorse Valley, between the cardioid and largest circle of the Mandelbrot set.

Seahorse Valley

Of course, these screenshots don’t compare to downloading the 40 megabyte file and viewing it in Golly yourself! The cellular automata community will probably hate me now for abusing Golly to explore the Mandelbrot set. Please forgive me. Anyway, here’s a third and final Golly screenshot to persuade Tom Rokicki to include coloured subpixel zooms:

The Mandelbrot set is connected, after all...

Golly gosh!

Posted in Uncategorized | 4 Comments

Dürer’s square

In Albrecht Dürer’s 1514 engraving Melancolia I, there is a famous 4×4 magic square. In addition to the rows, columns and main diagonals summing to 34, so do various other arrangements such as the quadrants and four corners.

Albrecht Dürer's magic square

We can transform this into an equivalent magic square by decrementing each of the values. This will map the numbers into the interval [0, 15] instead of [1, 16]. We can then write these values in binary as four-bit numbers.

Dürer’s magic square, in binary

Of course, Dürer wouldn’t have done this as binary was unknown to Western civilisation at that time (Gottfried Leibniz was born more than a century later). You may begin to notice patterns in the binary square. These become much more evident when we separate it into ‘layers’.

The four 'binary layers' of Dürer's magic square

The four ‘binary layers’ of Dürer’s magic square

Consider each layer separately. Each row, column, diagonal and any of a plethora of other arrangements (such as 2×2 ‘blocks’ in the corners) contains precisely two black and two white squares. This means that the sum must be equal to 2(1+2+4+8) = 30 in each of these arrangements. Since we decremented the values to obtain this square, the corresponding sum in Dürer’s original square is 34.

Remarkably, someone has found a magic cube containing Dürer’s square as a subplane. However, the numbers are not {1, 2, …, 64}, so it is of questionable validity. We can instead exploit the binary construction to yield a true magic cube with the numbers {1, 2, …, 64}. First, it is necessary to understand precisely what is happening in each of the binary bit planes.

Creating a bit plane using the XOR operation

Creating a bit plane using the XOR operation

We can construct the first bit plane by applying the exclusive or (XOR) operation to two ‘orthogonal’ patterns. If each of these orthogonal patterns contains two rows/columns (which they do!), then every row and column in the combined pattern must contain precisely two black and two white squares.

For the cube construction, we have to XOR together three orthogonal pairs of planes. We’ll choose planes which appear to generalise the two-dimensional counterparts, resulting in six ‘bitspaces’, two of which are shown below:

Three-dimensional generalisations of the Dürer bitlayers

Three-dimensional generalisations of the Dürer bitlayers

These two ‘bitspaces’ are linearly independent of each other and the other four bitspaces obtained by rotating them about a long diagonal. Hence, they together generate a magic cube related to Dürer’s square, where every orthogonal line has a sum of 130. Note that the four diagonals each pass through two cubes of each bitspace, so the diagonals (or, more generally, any centrally symmetric arrangement of four cubes) of the magic cube also have the same sum of 130. Additionally, selecting four out of the eight corner cubes (such that they form a regular tetrahedron) gives the sum of 130.

Dürer cube

Three-dimensional generalisation of Dürer’s magic square

In fact, we can construct a 4x4x4x4 magic tesseract using this technique, and so on ad infinitum.

Dürer's tesseract

Dürer’s tesseract

Amusingly, this visualisation of the tesseract is also a 16×16 magic square!

Posted in Uncategorized | Leave a comment

Digest

There have been several recent items of news, either related to or inspired by the recent postings on Complex Projective 4-Space. Rather than mention them separately, I have collected them in this ‘digest’ format.

Jigcypher solved

I received an anonymous e-mail from someone who solved the Jigcypher using a computer program. He/she (according to the Gender Genie software, he) subjected my Jigcypher to the program, which successfully assembled about 88% of the pieces. After completing the jigsaw puzzle manually, it wasn’t long before the cipher itself was also solved.

It transpires that he made the program earlier to reconstruct shredded documents. There is even commerical software out there designed to do this. I imagine this could be invaluable to archaeologists attempting to assemble fragments of the Dead Sea Scrolls and other ancient documents, as well as of interest to organisations such as the CIA.

Katsunobu’s glider

Recently, the second glider on a Penrose tiling was discovered, this time by Katsunobu Imai. Although too late to claim the prize, Imai’s glider is more natural than mine and occurs in a well-known family of cellular automata known as Generations rules. Golly can simulate these rules on an ordinary square lattice, taking full advantage of the HashLife algorithm to achieve exponential speed-up.

Katsunobu's glider

Katsunobu’s glider on the P3 Penrose tiling

There is a video and animated GIF of the glider. The glider appears to travel at a speed of c (compared with c/2 for my glider) in the same ten directions. It grows and shrinks according to the underlying tiling, and there is no proof as of yet that the glider will continue forever.

Unlike my glider, it does not function on a kite-and-dart tiling. He attempted to find a glider travelling along an axis of symmetry, but to no avail. It is more likely that there exist natural gliders which imitate mine, moving on convoluted fractal paths with Hausdorff dimension log(6)/log(phi^3).

Professor Andy Adamatzky mentioned that it would be interesting to explore the collisions between gliders on a Penrose tiling. Imai’s rule is more natural, so probably a better environment for investigating rich phenomena.

Myers’ polyhedra

Joseph Myers, inspired by the recent post, constructed card models of the rhombic triacontahedron and hexecontahedron. His construction method was different from mine, avoiding Sellotape to ensure durability. He has a large collection of hand-made card polyhedra.

Myers' hexecontahedron

Joseph Myers’ model of the rhombic hexecontahedron.

Nomography

Although Richard Guy had made a nomogram (an anagram of monogram!) based on a cubic curve, it turns out that it was not equivalent to my elliptic curve calculator. Guy uses a cubic curve of the form y = x^3 + ax + b, which has only a single real point of inflection. Whereas mine emulates a circular slide rule, Guy’s nomogram is equivalent to a linear slide rule. There is also a much simpler explanation for why his works: the abscissae (x-coordinates) of three collinear points on the cubic curve sum to zero.

This idea of using a straight-edge alone to perform calculations lies firmly in the realm of projective geometry. Taking a photograph of a nomogram results in a functionally identical nomogram. There is an 9-parameter family of cubic curves, but only an 8-parameter family of projective transformations. This is why we can have two distinct species of nomograms based on cubic curves: mine and Guy’s.

Miscellany

A mere two days after my hyperbolic eye tessellation, Katie Steckles reported that someone had knitted a Euclidean tessellation in the style of Escher. I commented that this would be compatible with hyperbolic crochet.

Andrew Carlotti found one direction of a closed-form bijection using the inverse Gamma function. He then found a better solution, claiming to have ‘essentially invented the Minkowski Question Mark Function’. Apparently, his latter solution was inspired by origami.

Posted in Uncategorized | Leave a comment