HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the Thue–Morse sequence, or Prouhet–Thue–Morse sequence, is the binary sequence (an infinite sequence of 0s and 1s) obtained by starting with 0 and successively appending the Boolean complement of the sequence obtained thus far. The first few steps of this procedure yield the strings 0 then 01, 0110, 01101001, 0110100110010110, and so on, which are prefixes of the Thue–Morse sequence. The full sequence begins: :01101001100101101001011001101001.... The sequence is named after Axel Thue and Marston Morse.


Definition

There are several equivalent ways of defining the Thue–Morse sequence.


Direct definition

To compute the ''n''th element ''tn'', write the number ''n'' in binary. If the number of ones in this binary expansion is odd then ''tn'' = 1, if even then ''tn'' = 0. For this reason
John H. Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many branches o ...
''et al''. called numbers ''n'' satisfying ''tn'' = 1 ''odious'' (for ''odd'') numbers and numbers for which ''tn'' = 0 ''evil'' (for ''even'') numbers. In other words, tn = 0 if ''n'' is an evil number and tn = 1 if ''n'' is an
odious number In number theory, an odious number is a positive integer that has an odd number of 1s in its binary expansion. In computer science, an odious number is said to have odd parity. Examples The first odious numbers are: Properties If a(n) denot ...
.


Fast sequence generation

This method leads to a fast method for computing the Thue–Morse sequence: start with , and then, for each ''n'', find the highest-order bit in the binary representation of ''n'' that is different from the same bit in the representation of . If this bit is at an even index, ''tn'' differs from , and otherwise it is the same as . In pseudo-code form: def generateSequence(seqLength): value = 0 for n = 0 to seqLength-1 by 1: # Note: assumes an even number of bits in the word size, and two's complement arithmetic so that when n

0, x is odd (e.g. 31 or 63) x = indexOfHighestOneBit(n ^ (n - 1)) if ((x & 1)

0): # bit index is even, so toggle value value = 1 - value yield value
The resulting algorithm takes constant time to generate each sequence element, using only a logarithmic number of bits (constant number of words) of memory.


Recurrence relation

The Thue–Morse sequence is the sequence ''tn'' satisfying the recurrence relation :\begin t_0 &= 0,\\ t_ &= t_n,\\ t_ &= 1 - t_n, \end for all non-negative integers ''n''.


L-system

The Thue–Morse sequence is a morphic word: it is the output of the following
Lindenmayer system An L-system or Lindenmayer system is a parallel rewriting system and a type of formal grammar. An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into so ...
:


Characterization using bitwise negation

The Thue–Morse sequence in the form given above, as a sequence of bits, can be defined recursively using the operation of bitwise negation. So, the first element is 0. Then once the first 2''n'' elements have been specified, forming a string ''s'', then the next 2''n'' elements must form the bitwise negation of ''s''. Now we have defined the first 2''n''+1 elements, and we recurse. Spelling out the first few steps in detail: * We start with 0. * The bitwise negation of 0 is 1. * Combining these, the first 2 elements are 01. * The bitwise negation of 01 is 10. * Combining these, the first 4 elements are 0110. * The bitwise negation of 0110 is 1001. * Combining these, the first 8 elements are 01101001. * And so on. So * ''T''0 = 0. * ''T''1 = 01. * ''T''2 = 0110. * ''T''3 = 01101001. * ''T''4 = 0110100110010110. * ''T''5 = 01101001100101101001011001101001. * ''T''6 = 0110100110010110100101100110100110010110011010010110100110010110. * And so on.


Infinite product

The sequence can also be defined by: : \prod_^ \left(1 - x^\right) = \sum_^ (-1)^ x^j, where ''t''''j'' is the ''j''th element if we start at ''j'' = 0.


Properties

The Thue–Morse sequence contains many ''squares'': instances of the string XX, where X denotes the string A, \overline, A \overlineA, or \overlineA \overline, where A=T_ for some k\ge 0 and \overline is the bitwise negation of A. For instance, if k=0, then A=T_=0 . The square A \overlineAA \overlineA = 010010 appears in T starting at the 16th bit. Since all squares in T are obtained by repeating one of these 4 strings, they all have length 2^n or 3\cdot2^n for some n\ge 0. T contains no ''cubes'': instances of XXX. There are also no ''overlapping squares'': instances of 0X0X0 or 1X1X1. The
critical exponent Critical or Critically may refer to: *Critical, or critical but stable, medical states **Critical, or intensive care medicine * Critical juncture, a discontinuous change studied in the social sciences. * Critical Software, a company specializing ...
of T is 2. The Thue–Morse sequence is a
uniformly recurrent word In mathematics, a recurrent word or sequence is an infinite word over a finite alphabet in which every factor occurs infinitely many times.Lothaire (2011) p. 30Allouche & Shallit (2003) p.325Pytheas Fogg (2002) p.2 An infinite word is recurren ...
: given any finite string ''X'' in the sequence, there is some length ''nX'' (often much longer than the length of ''X'') such that ''X'' appears in ''every'' block of length ''nX''. Notably, the Thue-Morse sequence is uniformly recurrent ''without'' being either periodic or eventually periodic (i.e., periodic after some initial nonperiodic segment). The sequence ''T''2''n'' is a
palindrome A palindrome is a word, number, phrase, or other sequence of symbols that reads the same backwards as forwards, such as the words ''madam'' or ''racecar'', the date and time ''11/11/11 11:11,'' and the sentence: "A man, a plan, a canal – Pana ...
for any ''n''. Furthermore, let ''q''''n'' be a word obtained by counting the ones between consecutive zeros in ''T''2''n'' . For instance, ''q''1 = 2 and ''q''2 = 2102012. Since ''Tn'' does not contain ''overlapping squares'', the words ''qn'' are palindromic squarefree words. The Thue–Morse
morphism In mathematics, particularly in category theory, a morphism is a structure-preserving map from one mathematical structure to another one of the same type. The notion of morphism recurs in much of contemporary mathematics. In set theory, morphisms ...
''μ'' is defined on alphabet by the substitution map ''μ''(0) = 01, ''μ''(1) = 10: every 0 in a sequence is replaced with 01 and every 1 with 10. If ''T'' is the Thue–Morse sequence, then ''μ''(''T'') is also ''T''. Thus, ''T'' is a fixed point of ''μ''. The morphism ''μ'' is a prolongable morphism on the free monoid with ''T'' as fixed point: ''T'' is essentially the ''only'' fixed point of ''μ''; the only other fixed point is the bitwise negation of ''T'', which is simply the Thue–Morse sequence on (1,0) instead of on (0,1). This property may be generalized to the concept of an automatic sequence. The ''generating series'' of ''T'' over the binary field is the
formal power series In mathematics, a formal series is an infinite sum that is considered independently from any notion of convergence, and can be manipulated with the usual algebraic operations on series (addition, subtraction, multiplication, division, partial s ...
:t(Z) = \sum_^\infty T(n) Z^n \ . This power series is algebraic over the field of rational functions, satisfying the equation :Z + (1+Z)^2 t + (1+Z)^3 t^2 = 0


In combinatorial game theory

The set of ''evil numbers'' (numbers n with t_n=0) forms a subspace of the nonnegative integers under nim-addition (
bitwise In computer programming, a bitwise operation operates on a bit string, a bit array or a binary numeral (considered as a bit string) at the level of its individual bits. It is a fast and simple action, basic to the higher-level arithmetic operat ...
exclusive or Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false). It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , ...
). For the game of
Kayles Kayles is a simple impartial game in combinatorial game theory, invented by Henry Dudeney in 1908. Given a row of imagined bowling pins, players take turns to knock out either one pin, or two adjacent pins, until all the pins are gone. Using the n ...
, evil nim-values occur for few (finitely many) positions in the game, with all remaining positions having odious nim-values.


The Prouhet–Tarry–Escott problem

The Prouhet–Tarry–Escott problem can be defined as: given a positive integer ''N'' and a non-negative integer ''k'', partition the set ''S'' = into two disjoint subsets ''S''0 and ''S''1 that have equal sums of powers up to k, that is: : \sum_ x^i = \sum_ x^i for all integers ''i'' from 1 to ''k''. This has a solution if ''N'' is a multiple of 2''k''+1, given by: * ''S''0 consists of the integers ''n'' in ''S'' for which ''tn'' = 0, * ''S''1 consists of the integers ''n'' in ''S'' for which ''tn'' = 1. For example, for ''N'' = 8 and ''k'' = 2, : : The condition requiring that ''N'' be a multiple of 2''k''+1 is not strictly necessary: there are some further cases for which a solution exists. However, it guarantees a stronger property: if the condition is satisfied, then the set of ''k''th powers of any set of ''N'' numbers in arithmetic progression can be partitioned into two sets with equal sums. This follows directly from the expansion given by the binomial theorem applied to the binomial representing the ''n''th element of an arithmetic progression. For generalizations of the Thue–Morse sequence and the Prouhet–Tarry–Escott problem to partitions into more than two parts, see Bolker, Offner, Richman and Zara, "The Prouhet–Tarry–Escott problem and generalized Thue–Morse sequences".


Fractals and turtle graphics

Using turtle graphics, a curve can be generated if an automaton is programmed with a sequence. When Thue–Morse sequence members are used in order to select program states: * If ''t''(''n'') = 0, move ahead by one unit, * If ''t''(''n'') = 1, rotate by an angle of π/3
radians The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that ...
(60°) The resulting curve converges to the
Koch curve The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a fractal curve and one of the earliest fractals to have been described. It is based on the Koch curve, which appeared in a 1904 paper titled "On a Continuous Curv ...
, a fractal curve of infinite length containing a finite area. This illustrates the fractal nature of the Thue–Morse Sequence. It is also possible to draw the curve precisely using the following instructions: *If ''t''(''n'') = 0, rotate by an angle of π radians (180°), * If ''t''(''n'') = 1, move ahead by one unit, then rotate by an angle of π/3 radians.


Equitable sequencing

In their book on the problem of fair division,
Steven Brams Steven J. Brams (born November 28, 1940 in Concord, New Hampshire) is an American game theorist and political scientist at the New York University Department of Politics. Brams is best known for using the techniques of game theory, public choi ...
and Alan Taylor invoked the Thue–Morse sequence but did not identify it as such. When allocating a contested pile of items between two parties who agree on the items' relative values, Brams and Taylor suggested a method they called ''balanced alternation'', or ''taking turns taking turns taking turns . . . '', as a way to circumvent the favoritism inherent when one party chooses before the other. An example showed how a divorcing couple might reach a fair settlement in the distribution of jointly-owned items. The parties would take turns to be the first chooser at different points in the selection process: Ann chooses one item, then Ben does, then Ben chooses one item, then Ann does. Lionel Levine and Katherine E. Stange, in their discussion of how to fairly apportion a shared meal such as an Ethiopian dinner, proposed the Thue–Morse sequence as a way to reduce the advantage of moving first. They suggested that “it would be interesting to quantify the intuition that the Thue–Morse order tends to produce a fair outcome.” Robert Richman addressed this problem, but he too did not identify the Thue–Morse sequence as such at the time of publication. He presented the sequences ''Tn'' as step functions on the interval ,1and described their relationship to the Walsh and Rademacher functions. He showed that the ''n''th
derivative In mathematics, the derivative of a function of a real variable measures the sensitivity to change of the function value (output value) with respect to a change in its argument (input value). Derivatives are a fundamental tool of calculus. ...
can be expressed in terms of ''Tn''. As a consequence, the step function arising from ''Tn'' is
orthogonal In mathematics, orthogonality is the generalization of the geometric notion of '' perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
to
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An exampl ...
s of
order Order, ORDER or Orders may refer to: * Categorization, the process in which ideas and objects are recognized, differentiated, and understood * Heterarchy, a system of organization wherein the elements have the potential to be ranked a number of ...
''n'' − 1. A consequence of this result is that a resource whose value is expressed as a monotonically decreasing
continuous function In mathematics, a continuous function is a function such that a continuous variation (that is a change without jump) of the argument induces a continuous variation of the value of the function. This means that there are no abrupt changes in val ...
is most fairly allocated using a sequence that converges to Thue–Morse as the function becomes flatter. An example showed how to pour cups of
coffee Coffee is a drink prepared from roasted coffee beans. Darkly colored, bitter, and slightly acidic, coffee has a stimulating effect on humans, primarily due to its caffeine content. It is the most popular hot drink in the world. Seeds of ...
of equal strength from a carafe with a
nonlinear In mathematics and science, a nonlinear system is a system in which the change of the output is not proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, mathematicians, and many oth ...
concentration In chemistry, concentration is the abundance of a constituent divided by the total volume of a mixture. Several types of mathematical description can be distinguished: '' mass concentration'', '' molar concentration'', ''number concentration'', ...
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
, prompting a whimsical article in the popular press. Joshua Cooper and Aaron Dutle showed why the Thue–Morse order provides a fair outcome for discrete events. They considered the fairest way to stage a Galois duel, in which each of the shooters has equally poor shooting skills. Cooper and Dutle postulated that each dueler would demand a chance to fire as soon as the other's ''a priori'' probability of winning exceeded their own. They proved that, as the duelers’ hitting probability approaches zero, the firing sequence converges to the Thue–Morse sequence. In so doing, they demonstrated that the Thue–Morse order produces a fair outcome not only for sequences ''Tn'' of length ''2n'', but for sequences of any length. Thus the mathematics supports using the Thue–Morse sequence instead of alternating turns when the goal is fairness but earlier turns differ monotonically from later turns in some meaningful quality, whether that quality varies continuously or discretely. Sports competitions form an important class of equitable sequencing problems, because strict alternation often gives an unfair advantage to one team.
Ignacio Palacios-Huerta Ignacio is a male Spanish and Galician name originating either from the Roman family name Egnatius, meaning born from the fire, of Etruscan origin, or from the Latin name "Ignatius" from the word "Ignis" meaning "fire". This was the name of se ...
proposed changing the sequential order to Thue–Morse to improve the '' ex post'' fairness of various tournament competitions, such as the kicking sequence of a penalty shoot-out in soccer. He did a set of field experiments with pro players and found that the team kicking first won 60% of games using ABAB (or ''T''1), 54% using ABBA (or ''T''2), and 51% using full Thue–Morse (or ''T''n).  As a result, ABBA is undergoing extensive trials in FIFA (European and World Championships) and English Federation professional soccer (
EFL Cup The EFL Cup (referred to historically, and colloquially, as the League Cup), currently known as the Carabao Cup for sponsorship reasons, is an annual knockout competition and major trophy in men's domestic football in England. Organised by t ...
). An ABBA serving pattern has also been found to improve the fairness of tennis tie-breaks. In competitive rowing, ''T''2 is the only arrangement of port- and starboard-rowing crew members that eliminates transverse forces (and hence sideways wiggle) on a four-membered coxless racing boat, while ''T''3 is one of only four rigs to avoid wiggle on an eight-membered boat. Fairness is especially important in player drafts. Many professional sports leagues attempt to achieve competitive parity by giving earlier selections in each round to weaker teams. By contrast, fantasy football leagues have no pre-existing imbalance to correct, so they often use a “snake” draft (forward, backward, etc.; or ''T''1). Ian Allan argued that a “third-round reversal” (forward, backward, backward, forward, etc.; or ''T''2) would be even more fair. Richman suggested that the fairest way for “captain A” and “captain B” to choose sides for a pick-up game of basketball mirrors ''T''3: captain A has the first, fourth, sixth, and seventh choices, while captain B has the second, third, fifth, and eighth choices.


Hash collisions

The initial bits of the Thue–Morse sequence are mapped to 0 by a wide class of polynomial hash functions modulo a
power of two A power of two is a number of the form where is an integer, that is, the result of exponentiation with number two as the base and integer  as the exponent. In a context where only integers are considered, is restricted to non-negat ...
, which can lead to
hash collision In computer science, a hash collision or hash clash is when two pieces of data in a hash table share the same hash value. The hash value in this case is derived from a hash function which takes a data input and returns a fixed length of bits. ...
s.


History

The Thue–Morse sequence was first studied by in 1851,The ubiquitous Prouhet-Thue-Morse sequence by Jean-Paul Allouche and Jeffrey Shallit
/ref> who applied it to
number theory Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Ma ...
. However, Prouhet did not mention the sequence explicitly; this was left to Axel Thue in 1906, who used it to found the study of combinatorics on words. The sequence was only brought to worldwide attention with the work of Marston Morse in 1921, when he applied it to
differential geometry Differential geometry is a mathematical discipline that studies the geometry of smooth shapes and smooth spaces, otherwise known as smooth manifolds. It uses the techniques of differential calculus, integral calculus, linear algebra and mult ...
. The sequence has been discovered independently many times, not always by professional research mathematicians; for example, Max Euwe, a chess grandmaster and mathematics
teacher A teacher, also called a schoolteacher or formally an educator, is a person who helps students to acquire knowledge, competence, or virtue, via the practice of teaching. ''Informally'' the role of teacher may be taken on by anyone (e.g. whe ...
, discovered it in 1929 in an application to
chess Chess is a board game for two players, called White and Black, each controlling an army of chess pieces in their color, with the objective to checkmate the opponent's king. It is sometimes called international chess or Western chess to dist ...
: by using its cube-free property (see above), he showed how to circumvent the threefold repetition rule aimed at preventing infinitely protracted games by declaring repetition of moves a draw. At the time, consecutive identical board states were required to trigger the rule; the rule was later amended to the same board position reoccurring three times at any point, as the sequence shows that the consecutive criterion can be evaded forever.


See also

*
Dejean's theorem Dejean's theorem (formerly Dejean's conjecture) is a statement about repetitions in infinite strings of symbols. It belongs to the field of combinatorics on words; it was conjectured in 1972 by Françoise Dejean and proven in 2009 by Currie and Ram ...
*
Fabius function In mathematics, the Fabius function is an example of an infinitely differentiable function that is nowhere analytic, found by . It was also written down as the Fourier transform of : \hat(z) = \prod_^\infty \left(\cos\frac\right)^m by . The ...
*
Gray code The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). For example, the representa ...
* Komornik–Loreti constant * Prouhet–Thue–Morse constant


Notes


References

* * * * * * * } * * * * * * * * * * * *


Further reading

* *


External links

* * * Allouche, J.-P.; Shallit, J. O
The Ubiquitous Prouhet-Thue-Morse Sequence
(contains many applications and some history) * Thue–Morse Sequence over (1,2) * *
Reducing the influence of DC offset drift in analog IPs using the Thue-Morse Sequence
A technical application of the Thue–Morse Sequence
MusiNum - The Music in the Numbers
Freeware to generate self-similar music based on the Thue–Morse Sequence and related number sequences. * {{DEFAULTSORT:Thue-Morse Sequence Binary sequences Fixed points (mathematics) Parity (mathematics)