Infinite binary sequence generated by repeated complementation and concatenation
In mathematics, the Thue–Morse or Prouhet–Thue–Morse sequence is the binary sequence (an infinite sequence of 0s and 1s) that can be obtained by starting with 0 and successively appending the Boolean complement of the sequence obtained thus far.[1] It is sometimes called the fair share sequence because of its applications to fair division or parity sequence. The first few steps of this procedure yield the strings 0, 01, 0110, 01101001, 0110100110010110, and so on, which are the prefixes of the Thue–Morse sequence. The full sequence begins:
There are several equivalent ways of defining the Thue–Morse sequence.
Direct definition
To compute the nth 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.[2] That is, tn is the even parity bit for n. John H. Conwayet al. deemed numbers n satisfying tn = 1 to be odious (intended to be similar to odd) numbers, and numbers for which tn = 0 to be evil (similar to even) numbers.
Fast sequence generation
This method leads to a fast method for computing the Thue–Morse sequence: start with t0 = 0, 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 n − 1. If this bit is at an even index, tn differs from tn − 1, and otherwise it is the same as tn − 1.
defgenerate_sequence(seq_length:int):"""Thue–Morse sequence."""value=1forninrange(seq_length):# Note: assumes that (-1).bit_length() gives 1x=(n^(n-1)).bit_length()+1ifx&1==0:# Bit index is even, so toggle valuevalue=1-valueyieldvalue
The resulting algorithm takes constant time to generate each sequence element, using only a logarithmic number of bits (constant number of words) of memory.[3]
Recurrence relation
The Thue–Morse sequence is the sequence tn satisfying the recurrence relation
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 2n elements have been specified, forming a string s, then the next 2n elements must form the bitwise negation of s.
Now we have defined the first 2n+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.
defthue_morse_bits(n):"""Return an int containing the first 2**n bits of the Thue-Morse sequence, low-order bit 1st."""bits=0foriinrange(n):bits|=((1<<(1<<i))-1-bits)<<(1<<i)returnbits
Which can then be converted to a (reversed) string as follows:
n=7print(f"{thue_morse_bits(n):0{1<<n}b}")
Infinite product
The sequence can also be defined by:
where tj is the jth element if we start at j = 0.
Properties
The Thue–Morse sequence contains many squares: instances of the string , where denotes the string , , , or , where for some and is the bitwise negation of .[5] For instance, if , then . The square appears in starting at the 16th bit. Since all squares in are obtained by repeating one of these 4 strings, they all have length or for some . contains no cubes: instances of . There are also no overlapping squares: instances of or .[6][7] The critical exponent of is 2.[8]
The Thue–Morse sequence is a uniformly recurrent word: 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.[9][10] Notably, the Thue-Morse sequence is uniformly recurrent without being either periodic or eventually periodic (i.e., periodic after some initial nonperiodic segment).[11]
The sequence T2n is a palindrome for any n. Furthermore, let qn be a word obtained by counting the ones between consecutive zeros in T2n . For instance, q1 = 2 and q2 = 2102012. Since Tn does not contain overlapping squares, the words qn are palindromic squarefree words.
The Thue–Morse morphismμ is defined on alphabet {0,1} by the substitution map μ(0) = 01, μ(1) = 10: every 0 in a sequence is replaced with 01 and every 1 with 10.[12] 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 {0,1}∗ 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.
This power series is algebraic over the field of rational functions, satisfying the equation[13]
In combinatorial game theory
The set of evil numbers (numbers with ) forms a subspace of the nonnegative integers under nim-addition (bitwiseexclusive or). For the game of Kayles, 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 = { 0, 1, ..., N-1 } into two disjoint subsets S0 and S1 that have equal sums of powers up to k, that is:
for all integers i from 1 to k.
This has a solution if N is a multiple of 2k+1, given by:
S0 consists of the integers n in S for which tn = 0,
S1 consists of the integers n in S for which tn = 1.
For example, for N = 8 and k = 2,
0 + 3 + 5 + 6 = 1 + 2 + 4 + 7,
02 + 32 + 52 + 62 = 12 + 22 + 42 + 72.
The condition requiring that N be a multiple of 2k+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 kth 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 nth 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".[14]
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 (60°)
The resulting curve converges to the Koch curve, a fractal curve of
infinite length containing a finite area. This illustrates the fractal nature of the Thue–Morse Sequence.[15]
It is also possible to draw the curve precisely using the following instructions:[16]
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 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.[17]
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.”[18]
Robert Richman addressed this problem, but he too did not identify the Thue–Morse sequence as such at the time of publication.[19] He presented the sequences Tn as step functions on the interval [0,1] and described their relationship to the Walsh and Rademacher functions. He showed that the nth derivative can be expressed in terms of Tn. As a consequence, the step function arising from Tn is orthogonal to polynomials of ordern − 1. A consequence of this result is that a resource whose value is expressed as a monotonically decreasing continuous function 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 of equal strength from a carafe with a nonlinearconcentrationgradient, prompting a whimsical article in the popular press.[20]
Joshua Cooper and Aaron Dutle showed why the Thue–Morse order provides a fair outcome for discrete events.[21] 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[19] or discretely.[21]
Sports competitions form an important class of equitable sequencing problems, because strict alternation often gives an unfair advantage to one team. Ignacio Palacios-Huerta 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.[22] He did a set of field experiments with pro players and found that the team kicking first won 60% of games using ABAB (or T1), 54% using ABBA (or T2), and 51% using full Thue–Morse (or Tn). As a result, ABBA is undergoing extensive trials in FIFA (European and World Championships) and English Federation professional soccer (EFL Cup).[23] An ABBA serving pattern has also been found to improve the fairness of tennis tie-breaks.[24] In competitive rowing, T2 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 T3 is one of only four rigs to avoid wiggle on an eight-membered boat.[25]
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 T1).[26] Ian Allan argued that a “third-round reversal” (forward, backward, backward, forward, etc.; or T2) would be even more fair.[27] Richman suggested that the fairest way for “captain A” and “captain B” to choose sides for a pick-up game of basketball mirrors T3: captain A has the first, fourth, sixth, and seventh choices, while captain B has the second, third, fifth, and eighth choices.[19]
Certain linear combinations of Dirichlet series whose coefficients are terms of the Thue–Morse sequence give rise to identities involving the Riemann Zeta function (Tóth, 2022 [29]). For instance:
where is the term of the Thue-Morse sequence. In fact, for all with real part greater than , we have
History
The Thue–Morse sequence was first studied by Eugène Prouhet [fr] in 1851,[30] who applied it to number theory.
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.
The sequence has been discovered independently many times, not always by professional research mathematicians; for example, Max Euwe, a chess grandmaster and mathematics teacher, discovered it in 1929 in an application to chess: 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.
^Fredricksen, Harold (1992). "Gray codes and the Thue-Morse-Hedlund sequence". Journal of Combinatorial Mathematics and Combinatorial Computing (JCMCC). 11. Naval Postgraduate School, Department of Mathematics, Monterey, California, USA: 3–11.
Krieger, Dalia (2006). "On critical exponents in fixed points of non-erasing morphisms". In Ibarra, Oscar H.; Dang, Zhe (eds.). Developments in Language Theory: Proceedings 10th International Conference, DLT 2006, Santa Barbara, California, USA, June 26-29, 2006. Lecture Notes in Computer Science. Vol. 4036. Springer-Verlag. pp. 280–291. ISBN978-3-540-35428-4. Zbl1227.68074.
Lothaire, M. (2011). Algebraic combinatorics on words. Encyclopedia of Mathematics and Its Applications. Vol. 90. With preface by Jean Berstel and Dominique Perrin (Reprint of the 2002 hardback ed.). Cambridge University Press. ISBN978-0-521-18071-9. Zbl1221.68183.
This article needs to be updated. The reason given is: This hospital network is sueing after it lost its bid to win a hospital in Buncombe County, North Carolina. Please help update this article to reflect recent events or newly available information. (July 2023) Novant HealthTypeNonprofit Health SystemIndustryHealth carePredecessorCarolina Medicorp, Presbyterian Health ServicesFounded1891; 132 years ago (1891) in Winston-Salem, North Carolina, United StatesHeadquarters2085 ...
Cornelis de Houtman Retrato de Cornelis de MeyneInformación personalNacimiento 2 de abril de 1565Gouda, Holanda, Diecisiete ProvinciasFallecimiento 11 de septiembre de 1599Aceh (Sumatra)Nacionalidad Países BajosFamiliaPadres Pieter Jacobszoon de HoutmanInformación profesionalOcupación Explorador y marino[editar datos en Wikidata] Cornelis de Houtman (Gouda, 2 de abril de 1565 - Aceh (Sumatra), 1 de septiembre de 1599) fue un marino y Explorador neerlandés, hermano menor d...
Dieser Artikel behandelt die Gemeinde Görsbach, zum gleichnamigen Fluss in Tschechien siehe Jeřice (Fluss). Wappen Deutschlandkarte ? Hilfe zu Wappen 51.46305555555610.935154Koordinaten: 51° 28′ N, 10° 56′ O Basisdaten Bundesland: Thüringen Landkreis: Nordhausen Erfüllende Gemeinde: Heringen/Helme Höhe: 154 m ü. NHN Fläche: 7,9 km2 Einwohner: 997 (31. Dez. 2022)[1] Bevölkerungsdichte: 126 Einwohner je km2 Postleitzahl...
Шандор Хранек Загальна інформаціяГромадянство УгорщинаНародився 20 січня 1961(1961-01-20) (62 роки)МезйокйовешдВагова категорія перша середнянапівважка Спортивні медалі Представник Угорщина Бокс Чемпіонати світу Бронза Москва 1989 до 81 кг Чемпіонат Європи з боксу Бронза Б
Theodoros Zagorakis Informasi pribadiNama lengkap Theodoros Zagorakis(Θεόδωρος Ζαγοράκης)Tanggal lahir 27 Oktober 1971 (umur 52)Tempat lahir Kavala, YunaniTinggi 1,78 m (5 ft 10 in)Posisi bermain Defensive midfielderKarier senior*Tahun Tim Tampil (Gol) 1988–19921993–19971998–20002000–20042004–20052005–2007 KavalaPAOKLeicester CityAEK AthensBolognaPAOK Total 114 0(6)155 (10)050 0(3)101 0(4)032 0(0)045 0(0)452 (23) Tim nasional1994–2007 Yunani ...
Опис файлу Опис Логотип Teletoon 2007-2011 Джерело https://en.wikipedia.org/wiki/Télétoon#/media/File:Teletoon_logo.svg Автор зображення Ліцензія див. нижче Обґрунтування добропорядного використання для статті «teletoon» [?] Мета використання в якості основного засобу візуальної ідентифікації у верхній ч
المسلمون الأمريكيون من أصل أفريقيمناطق الوجود المميزة الولايات المتحدة الأمريكيةاللغات الإنجليزية، العربية، الفرنسية، البرتغالية، الصومالية، لغة فولافولا ولغات أفريقية أخرىالدين الاسلامالمجموعات العرقية المرتبطةفرع من Muslim Americans (en) أمريكيون أفارقة تعديل - تعديل مصدر...
Leuchtturm am Cap Couronne La Couronne (deutsch „Die Krone“) ist ein Ortsteil der südfranzösischen Gemeinde Martigues im Département Bouches-du-Rhône. Das Dorf liegt am Mittelmeer, an der Côte Bleue. La Couronne – früher trug das Dorf den Namen Queyroun – lebt in erster Linie vom Tourismus. Es ist vor allem für seine alten Steinbrüche und Leuchttürme bekannt. Die Steinbrüche wurden bereits vom Griechen Strabon erwähnt. Ausgrabungen legen nahe, dass sie bereits ab dem 6. Jah...
Kriegsgefangenenlager Bandō Das Kriegsgefangenenlager Bandō (jap. 板東俘虜収容所, Bandō Furyoshūyōjo) war ein japanisches Kriegsgefangenenlager während des Ersten Weltkrieges. Es lag nahe dem gleichnamigen Ort (1959 in Ōasa und dieses 1967 in Naruto eingemeindet), 12 km von der Präfekturhauptstadt Tokushima entfernt, auf Shikoku, der kleinsten der vier japanischen Hauptinseln. Von April 1917 bis Dezember 1919 waren etwa 953 deutsche und österreichisch-ungarische Soldaten ...
PausPius VIIIPius VIII di tempat gestatoria.Awal masa kepausan31 Maret 1829Akhir masa kepausan30 November 1830PendahuluLeo XIIPenerusGregorius XVIImamatTahbisan imam17 Desember 1785Tahbisan uskup17 Agustus 1800oleh Giuseppe Maria Doria PamphiljPelantikan kardinal8 Maret 1816Informasi pribadiNama lahirFrancesco Saverio CastiglioniLahir(1761-11-20)20 November 1761Cingoli, Marche, Negara-negara KepausanMeninggal30 November 1830(1830-11-30) (umur 69)Istana Quirinal, Roma, Negara-negara ...
Federal executive department focusing on transportation USDOT redirects here. For U.S. Treasury Department, see United States Department of the Treasury. United States Department of TransportationSeal of the USDOTFlag of the USDOTHeadquarters of the U.S. Department of TransportationDepartment overviewFormedApril 1, 1967; 56 years ago (1967-04-01)JurisdictionU.S. federal governmentHeadquarters1200 New Jersey Avenue SE, Washington, D.C.38°52′32.92″N 77°0′10.26″Wþ...
1918 civil war in Finland Finnish Civil WarPart of World War I, Russian Civil War and Revolutions of 1917–1923Tampere's civilian buildings destroyed during the Battle of TampereDate 27 January – 15 May 1918 (3 months, 2 weeks and 4 days) LocationFinlandResult Finnish Whites victory Establishment of the Kingdom of Finland German hegemony until November 1918 Division in Finnish societyBelligerents Finnish Whites German Empire[1] Foreign volunteers: Swedish Briga...
American legislative district New Jersey's 27th legislative districtSenatorRichard Codey (D)Assembly membersMila Jasey (D)John F. McKeon (D)Registration43.7% Democratic20.4% Republican35.4% unaffiliatedDemographics61.7% White12.9% Black/African American0.2% Native American13.1% Asian0.0% Hawaiian/Pacific Islander4.1% Other race8.0% Two or more races10.0% HispanicPopulation233,779Voting-age population180,070Registered voters189,871 New Jer...
2006 studio album by Gordon Goodwin's Big Phat BandThe Phat PackStudio album by Gordon Goodwin's Big Phat BandReleasedJune 13, 2006 (2006-06-13)StudioCapitol Records and Conway Studios, Hollywood, California; O'Henry Studios, Burbank; Rimrock Studios, Thousand Oaks; Vertical Sound, Nashville, TennesseeGenreJazz, big bandLength75:05LabelImmergentProducerGordon Goodwin, Evan Johnson, Dan Savant, David TeddsGordon Goodwin's Big Phat Band chronology XXL(2003) The Phat Pack(...
Visual art related to writing Calligrapher redirects here. For the novel, see The Calligrapher. Further information: Handwriting and Script typeface This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: There are many grammatical and formatting errors, thus hampering the clarity and quality of the a...
This article is part of a series aboutBarack Obama Pre-presidency Early life and career Illinois State Senator 2004 DNC keynote address U.S. Senator from Illinois 2004 election sponsored bills 44th President of the United States Presidency timeline Transition Inaugurations Trips international Policies Economy Energy Foreign policy Arctic Europe East Asia Middle East South Asia Obama Doctrine Pardons Social Space Appointments Cabinet Judiciary Sotomayor Kagan Garland Supreme Court candidates F...
СелоСтарый Добротворукр. Старий Добротвір Герб 50°13′11″ с. ш. 24°22′26″ в. д.HGЯO Страна Украина Область Львовская Район Червоноградский Община Добротворская поселковая История и география Основан XI век Площадь 3,328 км² Высота центра 205 м Часовой пояс UTC+2:00, летом...
Fictional character from the BBC soap opera EastEnders Soap opera character Mehmet OsmanEastEnders characterPortrayed byHaluk BilginerDuration1985–1989First appearanceEpisode 3413 June 1985 (1985-06-13)Last appearanceEpisode 43123 March 1989 (1989-03-23)ClassificationFormer; regularCreated byTony Holland and Julia SmithIn-universe informationOccupationCafé ownerMinicab firm ownerFatherHassan OsmanBrothersAli OsmanSistersAyse OsmanWifeGuizin...
Madre PengarangDeeNegaraIndonesiaBahasaIndonesiaGenreDrama & PuisiPenerbitBentang PustakaTanggal terbit2011Halaman160 halamanISBNISBN 978-602-8811-49-1 Madre adalah judul buku ke tujuh yang ditulis oleh Dewi Lestari atau kerap disapa sebagai Dee Lestari.[1] Buku yang ditulis dalam bahasa Indonesia ini merupakan kumpulan cerita fiksi ke tiga hasil karya Dee.[2] Cetakan pertama Madre diterbitkan pada Juni 2011 oleh Penerbit Bentang.[1] Madre terdiri dari 13 kary...