ExplorationsRandom draws that always draw the same picture
The Chaos Game
Barnsley’s chaos game marks three corners of a triangle and starts on one of them. Pick a corner at random, move half the way there, and leave a dot; repeat from where you landed. Starting at (0, 0) in the triangle (0, 0), (1, 0), (0, 1), a draw of (1, 0) puts the dot at (0.5, 0). The dots never fill the triangle: they land on the Sierpinski gasket, the holes Pascal’s triangle shows when each entry is reduced modulo 2. The random draws decide the order the dots appear in, not the shape they appear on.
Interactive laboratory
- a dot
- a place the walk landed, one for each move made
- the move
- the part of the distance actually travelled, from the previous dot to the new one
- a corner
- one of the marked points a move can be drawn towards, filled when it is the one just drawn
- the outline
- the polygon the corners sit on, drawn to be read against rather than travelled along
Dots are the places the walk has landed, in order. The line from the previous dot to the corner just drawn shows the whole distance, and the dot sits at the stated fraction along it. Nothing is drawn between the dots: the walk jumps, and the segment is there to be read rather than travelled.
Running the walk for 40 moves.
- Move
- 40 / 40
Try this
The middle quarter of the triangle stays empty. Which corner would a dot have to be moved towards to land there?
What is going on
Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.
- (0, 0)halfway to B (1, 0): ((0 + 1)/2, (0 + 0)/2)(0.5, 0)the dot starts on corner A and moves half the distance to the corner just drawn
- (0.5, 0)halfway to C (0, 1): ((0.5 + 0)/2, (0 + 1)/2)(0.25, 0.5)each coordinate is averaged with the corner separately, so the move is a straight line
- (0.25, 0.5)halfway to B (1, 0): ((0.25 + 1)/2, (0.5 + 0)/2)(0.625, 0.25)the same corner may be drawn again; nothing in the rule forbids it
- (0.625, 0.25)halfway to A (0, 0): ((0.625 + 0)/2, (0.25 + 0)/2)(0.3125, 0.125)moving towards the origin simply halves both coordinates, which is where the binary fractions come from
What you are seeing
A dot, a corner drawn at random, and half the distance between them
Three corners are marked and the walk starts on one of them. A corner is drawn, the dot moves half the way from where it was to that corner, and the new position is marked. The corner drawn next has nothing to do with the corner drawn last, and the dot never returns to any position it has already left except by coincidence.
Watching forty of these moves is watching nothing much: a scatter of marks with a segment showing where each one came from. Watching fifty thousand is watching a specific triangle full of triangular holes appear. The build view shows the first kind and the accumulation view the second, and the rule generating them is the same rule.
Why it starts to make sense
One move is a shrunken copy of the whole picture
Take the whole triangle and apply one move to every point of it at once, always towards the same corner. Halving every distance to that corner turns the triangle into a triangle half the size, sitting in the corner it was aimed at. Doing this for each of the three corners gives three half-size triangles, one in each corner of the original.
Those three copies do not cover the original. The upside-down triangle in the middle is missed by all three, so no move can ever land a dot there. The same argument applies inside each copy, which is why the holes appear at every scale rather than only in the middle, and it is the whole explanation of the figure.
The key idea
The seed decides the order, and the corners decide the set
Two runs from two seeds ink different cells and produce the same figure. That sounds contradictory until the two things being described are separated: the sequence of positions is a random object and depends on every draw, while the set those positions are dense in is not random at all. It is fixed by the corners and the ratio before a single draw is made.
Reseed the laboratory and watch which of the two changes. The individual dots move, the address bar changes, and the shape does not. That is the difference between a simulation estimating something and a simulation drawing something that was already determined.
Formal statement
A finite family of contractions and its invariant set
For a corner and a ratio with , the move towards that corner is
Then , so each is a contraction with the same factor . A finite family of contractions is an iterated function system, and it has exactly one non-empty compact set with
At three corners with that set is the Sierpinski gasket. At four corners of a square with it is the square itself, which is why that case has nothing to show.
Proof
Two arguments: why the square fills, and why the gasket is Pascal’s triangle
The square. Each of the four maps sends the unit square onto the half-size square at its own corner, and those four half-size squares cover the unit square exactly, with no gap. So the square is a non-empty compact set equal to the union of its own images. Only one such set exists, so the square is the attractor and no pattern of holes is being missed by a run that is too short.
The gasket and the binomial coefficients. Play on the corners , and at , starting at the origin. After moves the position is
where is the set of moves that chose and the moves that chose . A move chooses one corner, so and are disjoint and no power of two appears in both coordinates. Reading the leading six bits gives grid indices and with , and by Kummer's theorem that is exactly the condition for to be odd. The occupancy of the grid and the odd entries of Pascal's triangle are therefore the same set, which is what the unit test checks cell by cell. Any other placement of the corners is an affine image of this one, and an affine map carries the system to the corresponding system, so it is the same figure in a different frame.
Limits and further questions
What a finite run shows and what it does not
A finite run inks finitely many cells, so paper still showing is not evidence of a hole. At fifty thousand dots the accumulation view leaves many cells of the attractor empty, and the honest reading is the large holes that stay empty as the count rises rather than the speckle that closes. The ledger separates these: the theorem is proved and cited, the grid agreement is checked at one stated resolution, and the cloud on screen is recorded as one run at one seed.
The restriction toggle is the easiest thing on the page to misread. Forbidding an immediate repeat does not filter the same walk, it defines a different one, and the structure that appears belongs to the new system rather than being a hidden feature of the old. The four-corner square is the case worth sitting with: the rule looks identical to the triangle rule, and there is a proof that nothing is there to be found.
What is not settled by anything here is how many dots a run needs before its picture is recognisable. The attractor is determined, and the rate at which a random orbit fills it depends on the ratio, the corner count and the measure the draws induce, none of which this page measures.
What is actually established
Every statement on this page, with its status, its exact scope, and the date that status was last checked.
A finite family of maps that each shrink distances by a fixed factor below one has exactly one non-empty compact set that is the union of its images, and the dots of a random run accumulate on that set.
- Scope
- Any finite family of contractions of the plane, which is what the corner maps here are for every ratio strictly between 0 and 1. The theorem names the set; it says nothing about how many dots a particular run needs before the set is recognisable, and it is cited here rather than proved on this page.
- Why
- Each corner map moves points towards its own corner and leaves the factor 1 − r of the distance, so the induced map on compact sets is a contraction in the Hausdorff metric and has a unique fixed point. The seed enters only as the order the images are visited in.
- Status checked
- Sources
- Fractals and self similarity citation unresolved; Fractals Everywhere citation unresolved
The run this page arrives on, three corners at ratio one half with seed 20260914, puts 50,000 dots into 8,718 of the 65,536 cells of the 256 by 256 grid.
- Scope
- That one seed, that one dot count and that one grid. Another seed inks a different set of cells of the same attractor, and a longer run inks more of them. This is a record of what was drawn, not evidence for the theorem above.
- Status checked
Played on the triangle with corners (0, 0), (1, 0) and (0, 1) at ratio one half, the run occupies exactly the cells of a 64 by 64 grid where the corresponding entry of Pascal’s triangle is odd, and no others.
- Scope
- All 4,096 cells of a 64 by 64 grid, for one run of 50,000 dots at seed 314159 in that coordinate frame. Grid cell (i, j) is compared with entry i of row i + j. The agreement is a statement about this resolution: a finer grid needs a longer run before every cell of the attractor has been reached.
- Computation (exact)
- A 64 by 64 occupancy grid, 4,096 cells, each compared with rows 0 to 63 of Pascal’s triangle reduced modulo 2, for a single run of 50,000 dots at seed 314159. Coordinates in this frame are exact binary fractions, so the cell a dot falls in is decided without rounding.
- Status checked
With the four corners of a square and ratio one half, the attractor is the whole square, so no pattern of holes exists to be found.
- Scope
- Exactly four corners, placed at the corners of a square, ratio exactly one half, and draws that may repeat. Changing the ratio or forbidding an immediate repeat gives a different family of maps, and this statement says nothing about those.
- Why
- Each of the four maps sends the square onto the half-size square at its own corner. Those four half-size squares cover the whole square with no gap, so the square is a non-empty compact set equal to the union of its images. The attractor is the only such set, so the attractor is the square.
- Status checked
- Sources
- Fractals and self similarity citation unresolved
With four corners at the corners of a square, a move of exactly one half, and an immediate repeat forbidden, no dot after the first lands strictly inside any of the four squares of side one quarter at the corners.
- Scope
- Exactly four corners at the corners of the unit square, ratio one half, the no-repeat rule as the laboratory applies it, any seed and any number of dots. A lower bound on the empty region: the four squares cover a quarter of the area, and the empty region of this system is larger than that. The page does not describe the rest of it.
- Why
- A dot drawn towards corner k is the midpoint between that corner and the previous dot. The previous dot lies in the half-size square at some other corner j, or is the starting corner for the first move. Halving towards k sends the half-size square at j onto a quarter-size square inside the half-size square at k, and it sends the half-size square at k onto the quarter-size square at the corner k itself. These two images have disjoint interiors, so a dot that came from j cannot be inside the corner square. Dots with repeats allowed can come from k, and that is how the square fills.
- Status checked
Sources
Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.
- Michael F. Barnsley, Fractals Everywhere, Academic Press, 1993.
Second edition. Chapter 3 states the contraction mapping theorem for an iterated function system and the uniqueness of its attractor; chapter 9 gives the random iteration algorithm this page plays. Cited for the theorem, not consulted here for any numerical value.
Citation details remain unresolved after review by Mathomaly.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: unresolved.
Publisher listing seen for the second edition; the chapter and theorem numbering quoted above was not checked against the text, so the citation stays flagged.
- John E. Hutchinson, Fractals and self similarity, Indiana University Mathematics Journal 30 (5), 1981. Link
The existence and uniqueness of the invariant set of a finite family of contractions, which is the theorem the attractor claim on this page rests on.
Citation details remain unresolved after review by Mathomaly.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: unresolved.
Journal record located for the article and volume; the statement attributed to it was not read in the paper, so the citation stays flagged.
Related by mechanism
Connected by how they work, not by sharing a topic label.