ExplorationsThe Thue-Morse sequence connects substitution with binary parity

A Pattern Built by Flipping Its Copy

Provedbinarysubstitutionaperiodicitycurious

Begin with 0 and make a copy in which every 0 becomes 1 and every 1 becomes 0, then append that changed copy. Repeating this gives 0, then 01, then 0110, then 01101001. This is the : its infinite continuation repeats many smaller blocks but never settles into one endlessly repeated block.

Current view: Copy and flip

See the appended copy before and after each bit changes.

Thue-Morse constructionRound 0 of 4

Begin with one zero

0

Round 0 is complete with 1 bit. The construction starts with one zero.

Positions start at zero. Read across each line before continuing on the next; wrapping does not change the sequence.

Complete construction transcript

Every completed row for the selected rule is recorded here, independent of playback.

  1. Round 0: 0
  2. Round 1: 01
  3. Round 2: 0110
  4. Round 3: 01101001
  5. Round 4: 0110100110010110
0
an outlined tile containing zero
1
a filled tile containing one
new half
a vermilion outline marks the appended copy during a step

Tiles are read left to right and then onto the next line. Outlined zeroes and filled ones carry printed values as well as colour. During a step, the new half is first copied unchanged, then complemented; only the complemented row is a completed Thue-Morse stage.

Round 0 is complete with 1 bit. The construction starts with one zero.

Completed rounds
0
Committed bits
1
Zeroes / ones
1 / 0

Construction

Without flipping, the result is the all-zero control sequence and the Thue-Morse claims do not apply.

Step by step

Use Step for one change you can inspect, or Run to watch the changes accumulate.

Speed

Cases worth seeing

Try this

If a row contains five zeroes and three ones, how many of each would remain after appending its complement?

1/2

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.

Worked by handBeginning with 0, each row keeps the previous row and appends its , doubling the length.
  1. 00 followed by 101The copy of zero is flipped to one.
  2. 0101 followed by 100110Each of the appended copy changes to its opposite.
  3. 01100110 followed by 100101101001The old row stays intact as its complement is appended.
  4. 0110100101101001 followed by 100101100110100110010110The completed row has eight zeroes and eight ones.
The tiles in the laboratory show the same strings. During each animated step, the extra half first appears as a copy and then changes each zero to one and each one to zero.
The completed rows balance zeroes and ones exactly, yet that balance does not make the infinite random or periodic. Its are determined by a rule that can also be read from their positions.
01

What you are seeing

The old half stays while the new half changes

Start with a tile marked zero. Make a second tile, change its zero to one, and place it after the first. You now have 01. Copy those two tiles, flip both copied values to obtain 10, and append that pair. The row is now 0110. Repeating the same construction gives the rows above.

Tiles wrap onto another line when the screen is narrow, but the string still reads left to right, then from the end of one line to the start of the next. The line breaks are a drawing choice, not another mathematical operation. Reset returns to the single starting zero.

02

Why it starts to make sense

A complement pairs every zero with a one

Every zero in the old half has a one at the corresponding position in the new half, and every one has a zero. Consequently each completed doubling contains exactly as many zeroes as ones. This statement concerns complete power-of-two rows. A shorter such as 011 need not be balanced.

Turning off the flip produces 0, then 00, then 0000, so the control is a different . Its simplicity helps isolate which operation creates the structure. The Thue-Morse claims on this page do not apply to that altered rule.

03

The key idea

A can be determined without building the previous bits

Number the positions from zero. Write a position in , count its ones and keep the of that count: an even count gives zero and an odd count gives one. Position six is 110 in binary, with two ones, so the there is zero. Position seven is 111, with three ones, so its bit is one.

The - table compares this direct calculation with the copied construction. These are two descriptions of one , rather than two unrelated patterns that happen to look alike. The below explains why their agreement continues beyond the displayed rows.

04

Formal statement

Finite construction rows define an infinite

Let and , where the bar exchanges zero and one in every position and juxtaposition means . Each row starts with the previous row, so every position eventually has a fixed value. Those values define the infinite .

If counts the ones in the of , then

The is equivalent to the and . The finite construction stops at 256 here for readability, not because the mathematical rule ends.

05

Proof

A new leading explains the complemented half

The first row agrees with the rule at position zero. Suppose a row of length agrees at all its positions. Every new position is , with . Its is that of , padded to places, with an additional leading one. Its digit-sum parity is therefore the opposite of the parity at . Appending the complement produces exactly those opposite . proves the parity description at all positions.

Balance has a shorter argument: if the old row has zeroes and ones, its complement has zeroes and ones. Their has of each. Neither depends on how the tiles are coloured or how many fit on a screen.

06

Limits and further questions

Local repetition and global periodicity are different

The certainly repeats short pieces: 01 and 10 occur many times. A requires one fixed positive shift to work at every position, or at every sufficiently late position for . Testing a chosen shift can find a mismatch, but passing a finite test does not establish that the shift works forever.

For example, 0110 has only one comparison at shift three, and it agrees. In 01101001, positions two and five disagree, ruling out three from the beginning. The period view states both the tested range and any witness rather than calling a short agreement a repeating infinite .

The infinite is known to be , a stronger stated in the linked Allouche-Shallit survey. It follows that it has no three consecutive identical non-empty blocks, whereas any tail contains such a triple. That proves non-periodicity using a published theorem, not using this page's finite checks. The deeper result is cited rather than presented as something established by the animation.

What is actually established

Every statement on this page, with its status, its exact scope, and the date that status was last checked.

Proved

At position n, the Thue-Morse bit is the parity of the number of ones in n’s binary representation.

Scope
Every non-negative integer position, for the copy-and-complement rule starting at 0.
Why
Positions in the next half have the form 2^m + j. Their binary representation adds one leading 1 to j, so their parity is the complement of the earlier bit. Induction proves agreement at every constructed length.
Status checked
Proved

Every completed construction row after the first doubling has equal numbers of zeroes and ones.

Scope
The power-of-two prefix after any positive number of copy-and-complement rounds. This does not say every arbitrary prefix is exactly balanced.
Why
A bit and its complemented copy contribute one zero and one one. Pairing the two halves proves the count without sampling.
Status checked
Proved

The infinite Thue-Morse sequence is not eventually periodic.

Scope
The infinite complemented construction, not the finite displayed prefix or the unflipped control.
Why
The cited overlap-free theorem implies cube-freeness, whereas an eventually periodic tail contains three consecutive copies of its period block. The page proves the elementary parity and balance results, not the overlap-free theorem.
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.

  1. Jean-Paul Allouche, Jeffrey Shallit, The ubiquitous Prouhet-Thue-Morse sequence. Link

    Author-hosted survey. Section 2 gives the binary digit-sum definition; section 3 states the overlap-free theorem and the substitution rule. The elementary parity and balance arguments are supplied on this page.

    Bibliographic record checked. This is not an independent verification of the proof.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: source text.

    Author-hosted survey confirms title, authors and the sequence definitions.

Connected by how they work, not by sharing a topic label.