We can extend the chaos game even further, to not rely on anchor points at all to find the next position.
The only thing that really matters is that we have a die roll and then some calculation to work out the position of the next point, and then we use the position of that point to calculate the next one.
That means that given some set of co-ordinates x, y, we can apply some function f(x,y) to calculate the next set of co-ordinates.
\[ f(x,y) = A \begin{bmatrix}x\\y\end{bmatrix} + B \]
Where A is some matrix and B is some vector. More explicitly:
\[ f(x,y) = \begin{bmatrix}a&b\\c&d\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} + \begin{bmatrix}e\\f\end{bmatrix} \]
The British mathematician Michael Barnsley discovered a very special set of values for these constants a,b,c,d,e and f.
Moreover, he used not just one function but four - each with different probabilities.
\[ \begin{align} f_1(x,y) &= \begin{bmatrix}0&0\\0&0.16\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} \\ f_2(x,y) &= \begin{bmatrix}0.85&0.04\\-0.04&0.85\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} + \begin{bmatrix}0\\1.60\end{bmatrix} \\ f_3(x,y) &= \begin{bmatrix}0.2&-0.26\\0.23&0.22\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} + \begin{bmatrix}0\\1.6\end{bmatrix} \\ f_4(x,y) &= \begin{bmatrix}-0.15&0.28\\0.26&0.24\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} + \begin{bmatrix}0\\0.44\end{bmatrix} \end{align} \]
We use the different functions with different probabilities.- \(f_1 \) is used 1% of the time, applying the transformation \[ \begin{align} x_{n+1} &= 0 \\ y_{n+1} &= 0.16 y_n \end{align} \]
- \(f_2 \) is used 85% of the time, applying the transformation \[ \begin{align} x_{n+1} &= 0.85 x_n + 0.04 y_n \\ y_{n+1} &= -0.04 x_n + 0.85 y_n + 1.6 \end{align} \]
- \(f_3 \) is used 7% of the time, applying the transformation \[ \begin{align} x_{n+1} &= 0.2 x_n - 0.26 y_n \\ y_{n+1} &= 0.23 x_n + 0.22 y_n + 1.6 \end{align} \]
- \(f_4 \) is used 7% of the time, applying the transformation \[ \begin{align} x_{n+1} &= -0.15 x_n + 0.28 y_n \\ y_{n+1} &= 0.26 x_n + 0.24 y_n + 0.44 \end{align} \]
Why are we doing all this?
This is the Barnsley Fern, first described by mathematician Michael Barnsley. The original fractal was constructed to resemble the black spleenwort.
The four different functions all reproduce different segments of the fern:
- f1 produces the stem, or rachis
- f2 produces progressively smaller leaves
- f3 produces the largest left-hand leaf
- f4 produces the largest right-hand leaf
The more iterations are run, the more intricate the beautiful image is.
The logician Augustuc De Morgan wrote of problems like this:And little fleas have lesser fleas, and so ad infinitum.
And the great fleas themselves, in turn, have greater fleas to go on,
While these again have greater still, and greater still, and so on.”