From Randomness to Beauty: How the Chaos Game Creates Fractals

Chaos Game: Generating Fractals with Simple Rules

The Chaos Game is a deceptively simple algorithm that produces complex, beautiful fractals from repeated application of a few straightforward rules. First popularized in the study of iterated function systems and fractal geometry, it shows how randomness combined with a deterministic constraint can produce highly structured patterns such as the Sierpiński triangle, Barnsley fern, and many more.

What the Chaos Game is

  • Core idea: Start with a polygon (often a triangle) and an initial point. Repeatedly move the point a fixed fraction of the distance toward a randomly chosen vertex of the polygon, plotting the new point each time.
  • Key ingredients: a set of target points (vertices), a contraction factor (fractional distance), randomness in choosing targets, and iteration.

The classic example: Sierpiński triangle

  1. Choose three vertices of a triangle (A, B, C).
  2. Place an initial point anywhere inside the triangle.
  3. Repeat many times:
    • Randomly pick one of the three vertices.
    • Move the current point halfway toward that vertex (contraction factor = ⁄2).
    • Plot the new point.

After thousands of iterations, the set of plotted points converges to the Sierpiński triangle — a fractal with self-similar triangular holes — even though each step used only random vertex choices and a simple midpoint rule.

Why it works (intuitively)

The algorithm is a random dynamical system where each vertex defines a contraction mapping. Repeatedly applying these contractions, chosen randomly, converges to the unique attractor of the iterated function system (IFS). The attractor is invariant under the set of contractions, which is why the resulting pattern is stable and fractal-like despite the randomness.

Variations and parameters

  • Contraction factor: Using different fractions (not just ⁄2) changes the fractal’s density and scaling. Other values can produce different attractors or distortions.
  • Number of vertices: Using more vertices yields different fractal shapes. A square with midpoint rule repeated will not fill the square uniformly but can produce distinctive patterns.
  • Forbidden rules: Disallowing certain consecutive vertex choices (e.g., never choosing the same vertex twice) can create dramatically different structures.
  • Weighted selection: Choosing vertices with unequal probabilities biases the attractor toward certain regions.
  • Nonlinear mappings: Replacing linear contractions with other transformations (rotation, scaling, shearing) expands the variety of possible fractals.

Implementing the Chaos Game (pseudocode)

Code

vertices = [(x1,y1), (x2,y2), …]# polygon vertices point = (x0,y0) # initial point factor = 0.5 # contraction factor for i in range(N):

v = random_choice(vertices) point = ( point.x + factor*(v.x - point.x),           point.y + factor*(v.y - point.y) ) plot(point) 

Practical tips: discard the first few hundred points to avoid transient bias from the initial position, and run at least tens of thousands of iterations for sharp detail.

Examples of fractals from Chaos Game

  • Sierpiński triangle: 3 vertices, factor ⁄2.
  • Sierpiński carpet–like sets: using a square and different rules produces carpet-like fractals.
  • Barnsley fern: uses multiple affine maps with assigned probabilities (an IFS approach related to the Chaos Game).
  • IFS art: by designing custom contraction mappings and probabilities, artists generate intricate, organic fractal images.

Applications and significance

  • Mathematics: Demonstrates properties of IFS attractors, measure invariance, and connections between randomness and determinism.
  • Computer graphics: Efficient method to generate fractal textures and natural-looking forms.
  • Education and outreach: Simple to implement and visually striking, making it ideal for teaching chaos, self-similarity, and emergent complexity.

Closing notes

The Chaos Game illustrates a powerful theme: simple local rules plus randomness can yield global order and intricate structure. Experimenting with vertex arrangements, contraction factors, and selection rules lets you explore a vast space of fractal patterns — from classic mathematical shapes to novel artistic designs. Try tweaking one parameter at a time and watch tiny changes produce strikingly different outcomes.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *