0:00
/
0:00

Feedback Loops and Fractals

Creating beautiful patterns with the "chaos game".

Fractals have been one of the most captivating mathematical concepts of the past century, and with good reason. The intricate images bear a striking resemblance to patterns found in nature, surpassing traditional geometric shapes in their ability to mimic organic structures.

One of the founders of fractal geometry, the mathematician Benoit Mandelbrot, alludes to this sentiment in his seminal work, The Fractal Geometry of Nature, by stating "Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth, nor does lightning travel in a straight line.” Fractal patterns seem to capture the essence of what we see in the natural world. Luckily, the mathematical rules for creating fractals are usually not as intricate as the patterns themselves.

Fractals were difficult to visualize before the advent of computer graphics. That's why interest in fractals rose significantly during the 1980s. On my social media accounts I joke that it took me approximately 30 hours to draw all the dots in the video, but I definitely lack the precision and patience to accomplish such a feat (don't tell anyone). The dots were drawn with the help of a computer, which completed the task in only a few seconds.

I should mention that many people correctly pointed out that true snowflakes have 6 arms, not 5. I should have given my description a bit more thought. To correct this transgression I created a second video where 6 points are used instead of 5.

There are a handful of common techniques for creating fractals. One of the most intriguing is known as the chaos game, which utilizes a probabilistic algorithm to draw a series of points that eventually converge into a fractal image. This is the method used in the video.

Watching the fractal appear from these simple rules gives rise to a common question: "why does it work?" While a complete proof and analysis is beyond the scope of this newsletter, it is beneficial to understand the fundamental concept that underlies the chaos game and numerous other methods in the fields of fractal geometry and chaos theory: feedback loops.

Feedback loops are easy to model using functions. For example, consider the function that squares a number:

\(x^2\)

To create a feedback loop with this function, we have to choose a number to begin with. Let’s use .5. Plugging .5 into the function yields .25:

\(.5^2 = .25\)

Now, take the output and plug it into the function again:

\(.25^2 = .0625\)

Take the output and plug it into the function again:

\(.0625^2 = .00390625\)

You get the idea. In this case, the feedback loop produces the sequence of numbers:

\(.5, .25, .0625, .00390625, ...\)

As the feedback loop progresses, the numbers get closer and closer to 0. In fact, as long as the starting number is strictly between -1 and 1, the sequence of numbers generated by the feedback loop will eventually converge to the number 0. In other words, the numbers will eventually get so close to 0 that even a computer would have a hard time telling the difference.

The idea of a feedback loop is not solely an abstract mathematical construct. If you've ever experienced the ear-piercing screech of a microphone's audio feedback, you have witnessed a real-world example. The sound produced by the speaker is detected by the microphone, amplified by the speaker, and then detected again by the microphone, creating a feedback loop that quickly converges to the high-pitched screech we're all familiar with.

To describe a more complicated, but pleasing feedback loop, imagine a group of individuals harmonizing to the same musical note. As we sing, our ears perceive the sound from our own voice and those around us, which influences the pitch and tone of our singing. This new sound is then again perceived by our ears, and the cycle repeats itself. This feedback loop typically results in a harmonious overall sound. The talented musician Jacob Collier effectively harnesses this principle to produce mesmerizing melodies using his audience. It's very cool: Jacob Collier Harmonises The Audience (YouTube).

The chaos game can be viewed as a feedback loop, but instead of converging to a single number or a sound, the output converges to a fractal image. A more technical name for this type of feedback loop is an iterated function system or IFS for short.

To see the feedback loop inherent in the fractal video, notice that to get the next dot, we need to plug the current dot into the rule system. The rule system consists of a simple function, “move halfway toward the selected point”, and a set of probabilities “randomly select one of the points, excluding the one that was just chosen.” Since the current dot is always used to arrive at the next dot, this system represents a feedback loop. As it progresses, the dots converge onto the surface of the fractal and fill it out dot by dot. The probabilities ensure that the dots “move around” the entire surface of the fractal.

One of the most profound takeaways from studying fractals (and the related field of dynamical systems or “chaos theory”) is that feedback loops can be configured to produce unusual and remarkable phenomena. For instance, the chaos game can be adapted in many different ways, and the resulting feedback loop often (but not always) converges to a fractal.

The image below is known as the Barnsley fern after the mathematician Michael Barnsley, another early fractal pioneer and the author of the classic book Fractals Everywhere. It was produced using the chaos game technique and a set of four specific rules to drive the feedback loop. If you’ve read my book you’ll recognize this image from the cover.

Many fractal-producing rules for the chaos game have been devised over the years, but they all involve a similar process. The game begins with a set of points. We randomly select one point from the set according to the specified probabilities, and then apply a specific rule to move toward it. A dot is drawn, and the feedback loop continues.

Discussion about this video

User's avatar