Thursday 29 February 2024

Dissecting von Neumann's elephant

Figure 1: Von Neumann's elephant
In my previous post, I quoted John von Neumann:
"With four parameters I can fit an elephant, and with five I can make him wiggle his trunk."
The goal of this post is to show how the elephant image in Figure 1 can be generated from just four complex parameters.[1]

As noted in my last post, the elephant can be regarded as a time signal that is produced using eight epicycles (illustrated in Figure 2). Each epicycle requires one complex value to encode both the length of its rotating radius and its starting angle.

To proceed with our goal, the first step is to extract a suitable number of (x, y) coordinates that represent the time signal. The green dots in Figure 2 (and Figure 3) show 16 coordinates on the complex plane which, proceeding clockwise from the left, are:

Figure 2: Epicycles and coordinates
t0: -60 + 2i
t1: -40.3703 + 21.9123i
t2: -22.1421 + 51.9411i
t3: -4.72831 + 82.9428i
t4: 20 + 50i
t5: 52.5074 + 9.44519i
t6: 78.7107 + 18.7696i
t7: 81.8089 + 16.356i
t8: 60 - 2i
t9: 29.0566 + 3.54352i
t10: 6.14214 - 15.9411i
t11: -6.5854 - 57.4869i
t12: -20 - 50i
t13: -41.1937 - 34.901i
t14: -62.7107 - 54.7696i
t15: -70.4952 - 41.8119i

Figure 3: Signal timeline (side-on) and complex plane (front-on) viewpoints

The next step is to rotate [2] and then split the signal into two separate signals derived from the real components and imaginary components respectively (i.e., {-2, -21.9123, ...} and {-60, -40.3703, ...}).

A Discrete Fourier Transform is now applied to each signal to produce their spectrums.[3][4] The first generated spectrum is:

f1: 50i
f2: 18i
f3: 12
f5: -14

The second generated spectrum is:

f1: -60-30i
f2: 8i
f3: -10i

There are eight distinct real numbers across both spectrums which can be arranged into four complex parameters, as required!

p1: 50 - 30i
p2: 18 +  8i
p3: 12 - 10i
p4: -14 - 60i

To check these parameters are sufficient to generate the elephant in Figure 1, the inverse procedure can be performed. First, the components of the four parameters specify the two spectrums above. An Inverse Discrete Fourier Transform is then applied to each spectrum to produce their respective signals. The real values of the two signals can then be combined into the original complex signal (and the inverse rotation applied) for the elephant in Figure 1.

One further (fifth) parameter is needed to add some elephant dynamics. The Mayer paper uses the number 40 to specify the x-coordinate of the base of the elephant's trunk (thus the coordinates to the right can be wiggled) and uses the number 20 to specify both the x and y coordinates of the elephant's eye. See the references in my earlier post for implementations of those features.

I'll end here with an apt paraphrase of Einstein: [5]
"Everything should be made as simple as possible (but not simpler)."
--

[1] See Drawing an elephant with four complex parameters - Mayer, Khairy, Howard, 2010.

[2] Note that the imaginary numbers have been negated and then the real and imaginary numbers swapped. This is, in effect, a quarter clockwise rotation of the signal which could alternatively be applied by multiplying the complex signal by i. The rotation isn't actually necessary to produce four parameters but, if omitted, the parameter values will be different from those given in the Mayer paper. The final four parameters without the rotation would be {30 + 50i, -8 + 18i, 10 - 12i, -60 + 14i}.

[3] Scaling factors have been omitted. When testing this using Microsoft Excel's Fourier Analysis tool, a scaling factor of 1/16 was needed for the DFT and 16 for the inverse DFT.

[4] Negative frequencies and zero amplitude frequencies have been omitted. A negative frequency means that an epicycle rotates clockwise instead of counter-clockwise. In this instance, the negative frequencies are the complex conjugates of the positive frequencies and don't affect the results.

[5] "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein, "On the Method of Theoretical Physics", The Herbert Spencer Lecture, 1933.

No comments:

Post a Comment