ThueMorse - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

ThueMorse

  

generate a Thue-Morse string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ThueMorse( n, a, b )

Parameters

n

-

non-negative integer; specifies that ThueMorse must return then nth Thue-Morse string

a

-

character; (optional) first symbol to use

b

-

character; (optional) second symbol to use

Description

• 

The ThueMorse(n, a, b) command generates the length-n prefix of the (infinite) Thue-Morse string, with initial values a and b. The arguments after the first are optional, and default to the strings 0 and 1, respectively.

• 

The Thue-Morse string is the infinite string defined to be the fixed point of the iterated semigroup morphism 0>01,1>10 on the free semigroup generated by 0,1.

• 

A recursive definition of the Thue-Morse sequence is as follows. t0=0, t2n=tn, t1+2n=1tn.

• 

All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

withStringTools:

seqThueMorsen,n=0..5

,0,01,011,0110,01101

(1)

ThueMorse5,a,b

abbab

(2)

ThueMorse100

0110100110010110100101100110100110010110011010010110100110010110100101100110100101101001100101100110

(3)

See Also

string

StringTools