Approximating Bernoulli words of irrational numbers by α -words

Approximating Bernoulli words of irrational numbers by α -words

Discrete Mathematics 343 (2020) 111746 Contents lists available at ScienceDirect Discrete Mathematics journal homepage: www.elsevier.com/locate/disc...

405KB Sizes 0 Downloads 49 Views

Discrete Mathematics 343 (2020) 111746

Contents lists available at ScienceDirect

Discrete Mathematics journal homepage: www.elsevier.com/locate/disc

Approximating Bernoulli words of irrational numbers by α -words Wai-Fong Chuan, Yu-Jau Lin



Department of Applied Mathematics, Chung Yuan Christian University, 200, Chung Pei Rd., Chung Li District, Taoyuan City, 32023, Taiwan, R.O.C

article

info

Article history: Received 21 September 2018 Received in revised form 15 August 2019 Accepted 12 November 2019 Available online xxxx Keywords: Bernoulli word Characteristic word Sturmian word α -word Standard word Continued fraction

a b s t r a c t The Bernoulli word B(ξ ) of an irrational number ξ is an infinite word over the alphabet {a, b}, in which the nth letter is a if [(n + 1)ξ + 12 ] − [nξ + 12 ] = 0 and is b if [(n + 1)ξ + 12 ] − [nξ + 12 ] = 1 (n ≥ 1). It is known that both B(ξ ) and the characteristic word C (ξ ) of ξ are Sturmian words, and C (ξ ) is the limit of a sequence of standard words corresponding to ξ . In this paper, we determine a sequence of α -words corresponding to ξ which converges to B(ξ ). Our results are mainly based on the continued fraction expansion of ξ and a result appears in a book of Venkov (1970). © 2019 Published by Elsevier B.V.

1. Introduction Let X = {a, b} be an alphabet. A Sturmian word is an infinite word over X that has n + 1 factors of length n (n ≥ 0). An infinite word over X is a lower irrational mechanical word if there are two real numbers ξ and ρ with ξ irrational and 0 < ξ < 1 such that its nth letter is a b

if if

⌊(n + 1) ξ + ρ ⌋ − ⌊n ξ + ρ ⌋ = 0 ⌊(n + 1) ξ + ρ ⌋ − ⌊n ξ + ρ ⌋ = 1

(n ≥ 0). Denote this word by sξ ,ρ . The definition of an upper irrational mechanical word s′ξ ,ρ is the same as the lower one except that the floor function ⌊x⌋ is replaced by the ceiling function ⌈x⌉ (see [10]). It is known that an infinite word over X is a Sturmian word if and only if it is irrational mechanical (see [10]). Let ξ be an irrational number between 0 and 1. The Sturmian words sξ ,mξ and s′ξ ,mξ (integer m) are called simple Sturmian words of ξ (see [7]) and the simple Sturmian word sξ ,ξ (= s′ξ ,ξ ) is the well known characteristic word C (ξ ) of ξ (see [10]). There are two biinfinite extensions of C (ξ ). One uses the floor function and the other uses the ceiling function. Simple Sturmian words of ξ are precisely the suffixes of these biinfinite extensions. There are many ways to generate C (ξ ) using the continued fraction expansion ξ = [0; a1 , a2 , . . .] of ξ in which an (n ≥ 1) are positive integers. The definition of continued fraction will be given in Section 2. For example, it is well known a −1 a that the standard words xn (n ≥ 1), defined by x−1 = b, x0 = a, x1 = x01 x−1 , xn = xnn−1 xn−2 (n ≥ 2), are prefixes of C (ξ ). In other words, C (ξ ) is the limit of xn ∗ Corresponding author. E-mail address: [email protected] (Y.-J. Lin). https://doi.org/10.1016/j.disc.2019.111746 0012-365X/© 2019 Published by Elsevier B.V.

(1.1)

2

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

(see, for example, [10]). Let un (n ≥ 1) be the words defined by a −1

u−1 = b, u0 = a, u1 = u01

a −1

u−1 , un = unn−1 un−2 un−1

(n ≥ 2).

Then C (ξ ) has a representation (or factorization) C (ξ ) = u1 u2 u3 · · ·

(1.2)

(See, for example [6,12]). As a consequence, C (ξ ) is the limit of the words u1 u2 · · · un (n ≥ 1). The standard words and the words un (n ≥ −1) mentioned above belong to the class of α -words having directive sequence a1 − 1, a2 , a3 , . . . (see [5]). These construction methods of C (ξ ) have been generalized to simple Sturmian words by Chuan, Liao and Yu using α -words (see [6,7,9]). The definition of α -word and examples of such generalization will be given in Section 2. Among these results, singular words are also used. (See [2,4,5,13] for the basic properties of singular words.) We now turn to the problem of constructing the Bernoulli words of irrational numbers. From the following definition, it follows immediately that each Bernoulli word is a Sturmian word which is not a simple one. The Sturmian word sξ ,ξ + 1 (= s′ 1 ) is called the Bernoulli word of ξ (see [12]), and is denoted by B(ξ ). In [12] a 2

ξ ,ξ + 2

method for constructing B(ξ ) is given. The idea of the construction was given without proof by Johann Bernoulli, who first considered this problem, and was proved by A. A. Markov. A brief description of this method is as follows: since B(ξ ) can be obtained from B(1 − ξ ) by switching the letters a 1 and b, we may assume, without loss of generality, that 0 < ξ < 21 . Write = s + ξ1 , where s is a positive integer and 2ξ 0 < ξ1 < 1. Let C (ξ1 ) be the characteristic word of ξ1 . Let ψ be a morphism mapping infinite words over the alphabet Y = {aa, ab, ba, bb} into infinite words over the alphabet X = {a, b} defined by

ψ (aa) = a2s−1 b, ψ (ab) = ψ (ba) = a2s b, ψ (bb) = a2s+1 b. Then B(ξ ) = as−1 bψ (C (ξ1 )).

(1.3)

Note that Eq. (1.3) relates B(ξ ) to C (ξ1 ). This relation provides a good way to understand more about B(ξ ) via the structure of C (ξ1 ), and, undoubtedly, it can be used to construct B(ξ ). In fact, this is the only construction method of B(ξ ) in the literature that we know of besides the definition. For any given continued fraction of ξ , the process of using Eq. (1.3) to construct B(ξ ) consists of three steps: 1. Use the continued fraction of ξ to compute the continued fraction of ξ1 , which is usually not given in the beginning. 2. Construct C (ξ1 ). As mentioned above, there are many ways to do it. (In the example given in [12], Eq. (1.2) is used.) 3. Apply the mapping ψ to C (ξ1 ) and then adjoin the word as−1 b on the left of the word so obtained. The resulting word is B(ξ ). It is quite clear that this Bernoulli–Markov construction method of B(ξ ) depends on another irrational number ξ1 , the characteristic word of ξ1 , and the mapping ψ (which is not a Sturmian morphism). Motivated by Eq. (1.1) and similar results for simple Sturmian words mentioned above, we find, in this paper, a sequence of α -words {wn } corresponding to ξ , which converges to B(ξ ) (see Theorem 4.2). This sequence of finite words can be constructed recursively using its label R. A simple formula expressing R in terms of the continued fraction of ξ is obtained in Section 6 (see Table 6.1). Naturally, Eq. (1.3) is used in the proofs of our results. The interesting thing is that the results so obtained provide us a new, simple and direct method to construct B(ξ ). An example of a Bernoulli word and a sequence of α -words converging to it will be given in Example 6.8. The J-sequence of a sequence of positive integers is a basic tool used throughout Sections 3–6. In Section 3, we obtain an algorithm that doubles a continued fraction, finite or infinite. A candidate of R will be given in Section 4, and the convergence assertion (part(b) of Theorem 4.2) will be proved in Section 5. Incidentally, we obtain a morphism ϕ mapping words over the alphabet Y into words over X which satisfies B(ξ ) = ϕ (C (ξ1 )).

(1.4)

This morphism ϕ and Eq. (1.4) will be used, instead of ψ and Eq. (1.3), to prove the convergence assertion. 2. Preliminaries Let S = (b0 , b1 , b2 , . . .) be a finite or infinite sequence of integers with bk ≥ 1 for k ≥ 1 and b0 ≥ 0. Define simple continued fractions 1 [ b0 ; b1 , b2 , . . . , bk ] = b0 + (k ≥ 1) 1 b1 + 1 b2 +

..

.+

1 bk−1 + 1 bk

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

3

and

[b0 ; b1 , b2 , b3 , . . .] = b0 +

1 b1 +

( if S is infinite).

1 1

b2 +

b3 +

..

.

Define p−2 = 0,

p−1 = 1,

pk = bk pk−1 + pk−2

(k ≥ 0)

(2.1)

q−2 = 1,

q−1 = 0,

qk = bk qk−1 + qk−2

(k ≥ 0)

(2.2)

Then the following results are true: pk [b0 ; b1 , . . . , bk ] = (k ≥ 0), qk pk if S is infinite, [b0 ; b1 , b2 , . . .] = lim k→∞ qk pk qk−1 − qk pk−1 = (−1)k−1

(k ≥ 1)

(2.3) (2.4) (2.5)

pk

is called the kth convergent of the continued fraction [b0 ; b1 , b2 , . . .]. It is well known that every positive qk irrational number has a unique expansion as an infinite simple continued fraction. Throughout the paper, let X = {a, b} be an alphabet, and let X + denote the set of all finite nonempty words over X . If w = c1 c2 · · · cn , where ci ∈ X (1 ≤ i ≤ n), the positive integer n is called the length of the word w, and is denoted by |w|. If u, v, w are words over X , where u is finite and w is finite or infinite, such that w = uv , then u is called a prefix of w , and is denoted by u < w . Let a1 , a2 , . . . be a finite or infinite sequence of integers with a1 ≥ 0 and ai ≥ 1 (i ≥ 2). A word w ∈ X + is called an α -word if w ∈ X or there are integers r1 , r2 , . . . , rn , where n ≥ 1, 0 ≤ ri ≤ ai (1 ≤ i ≤ n), and words w−1 , w0 , . . . , wn ∈ X + such that For k ≥ 0,

a −r

r

w−1 = b, w0 = a, wi = wi−i 1 i wi−2 wi−i 1 (1 ≤ i ≤ n), w = wn . In the latter case, the integer n, the sequences a1 , a2 , . . . , an and r1 , r2 , . . . , rn are called the order, the directive sequence and the label of the α -word w respectively. Denote w by wn (r1 r2 · · · rn ) or simply w (r1 r2 · · · rn ). We sometimes say that a1 , a2 , . . . is the directive sequence of w . Let ξ be an irrational number with a simple continued fraction expansion ξ = [0; T ], where T = (a1 , a2 , a3 , . . .) is an infinite sequence of positive integers. We say that w is an α -word corresponding to ξ if w is an α -word having directive sequence T = (a1 − 1, a2 , . . .). A sequence of α -words w1 , w2 , . . . corresponding to ξ is said to have label R = (r1 , r2 , . . .) if wn = wn (r1 r2 · · · rn ) (n ≥ 1). It is known that the set of α -words corresponding to ξ is closed under conjugation and taking reversals; the reversal of an α -word having label (r1 , r2 , . . . , rn ) has a label (a1 − 1 − r1 , a2 − r2 , . . . , an − rn ) (see [5]). Clearly, the standard words xn and the words un (n ≥ 1) that appear in Eqs. (1.1) and (1.2) are α -words corresponding to ξ that have labels (0, 0, 0, . . .) and (0, 1, 1, . . .) respectively. Since α -words are exactly conjugates of standard words (see [5]), it follows that the lower Christoffel word and the upper Christoffel word (see [10] for definitions) having the same lengths and heights as xn are α -words corresponding to ξ that have labels (0, a2 , 0, a4 , . . .) and (a1 − 1, 0, a3 , 0, . . .) respectively (n ≥ 1) (see [5,10]). It is known that the sequence of lower (resp., upper) Christoffel words converges to aC (ξ ), i.e., sξ ,0 (resp., bC (ξ ), i.e., s′ξ ,0 ), and the sequence of reversals of x2n (resp., x2n−1 ) converges to baC (ξ ), i.e., sξ ,−ξ (resp., abC (ξ ), i.e., s′ξ ,−ξ ) (see [6], and [10, p. 104–105]). 3. Doubling a continued fraction Let b1 , b2 , b3 , . . . be a given finite or infinite sequence of positive integers and b0 a nonnegative integer. In this section, we compute a sequence of integers a0 , a1 , a2 , . . ., where a0 ≥ 0, ai ≥ 1 (i ≥ 1) such that 2[b0 ; b1 , b2 , . . .] = [a0 ; a1 , a2 , . . .]

(3.1)

In [1], a procedure which goes back to Hurwitz serves this purpose. Incidentally, the problem of doubling a continued fraction has been extended by Hall [8] and Raney [11]. However, when solving Eq. (3.1), their methods are more complicated than either Hurwitz’ method or Procedure TAEZ that we introduce here. The justification of Procedure TAEZ is based on the J-sequence of the sequence b1 , b2 , b3 , . . ., or equivalently, the standard decomposition of b1 , b2 , b3 , . . ., which is useful throughout the rest of the paper. We first define the J-sequence of a sequence of positive integers. Procedure J-sequence Let S = (b1 , b2 , . . .) be a finite or infinite sequence of positive integers. This procedure defines the J-sequence J = (J1 , J2 , J3 , . . .) of S, starting with J1 = F .

4

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746 Table 3.1 Rules for procedure J-sequence, starting with J1 = F . Rule

bk

Jk

1 2 3

even odd even

F F N

−→

Jk+1

Rule

bk

Jk

L N N

4 5 6

odd and ≥ 3 1 odd or even

N N L o 1L

−→

Jk+1 L 1L F

Example 3.1. Let S = (3, 4, 2, 1, 5, 8, 3, 7, . . .). Using Procedure J-sequence, we have J = (F , N , N , N , 1L, F , L, F , . . .). The following lemma is later useful in proving Lemma 3.4, Theorem 4.2 and Lemma 5.7. Lemma 3.2. For k ≥ 1, the following statements are true. (a)

Jk+2 = F ⇐⇒ Jk+1 = L or 1L

(b)

Jk+1 = N ⇐⇒ either (bk is odd and Jk = F ) or (bk is even and Jk = N)

(c)

Jk+1 = 1L ⇐⇒ bk = 1 and Jk = N

⇐⇒ either (bk is even and Jk = F ) or (bk is odd and Jk = N)

We will see that the J-sequence of S plays an important role in finding the solution T = (a0 , a1 , a2 , . . .) of Eq. (3.1). The following procedure TAEZ (Termwise Appending and Eliminating Zeros), starting with T = (2b0 ), is applied to S term by term from left to right. In each step, TAEZ produces a lengthened T . TAEZ rules are given below. Note that if bk is even, bk+1 exists and Jk = F , then, by combining Rules 1 and 8, respectively, we have

Similarly, if bk is odd, bk+1

bk

, 2bk+1 ) and Jk+2 = F . 2 exists and Jk = N, then by combining Rules 6 and 9, Rules 7 and 8, respectively, we have

(1’) bk is even and Jk = F −→ i := i + 2, T := (T ,

(6’) bk = 1 and Jk = N −→ T := T + 2bk+1 and Jk+2 = F (i remains unchanged) bk − 1 (7’) bk ≥ 3 is odd and Jk = N −→ i := i + 2, T := (T , , 2bk+1 ) and Jk+2 = F . 2 The following theorem solves Eq. (3.1) for both finite and infinite sequences S. Theorem 3.3. Let (b0 , b1 , b2 , . . .) be a finite or infinite sequence of integers, with bk ≥ 1 for k ≥ 1, b0 ≥ 0. Starting with T = (2b0 ), let T = (a0 , a1 , a2 , . . .) be the sequence obtained by applying Procedure TAEZ to S = (b1 , b2 , . . .). Then 2[b0 ; S ] = 2[b0 ; b1 , b2 , . . .] = [a0 ; a1 , a2 , . . .]

(3.2)

We first prove the following lemma, which will be used to prove Theorem 3.3. p′ p′ p′ p0 p1 p2 , , , . . . , (resp. ′0 , ′1 , ′2 , . . .) be the convergents of the continued fraction [b0 ; S ] = [b0 ; b1 , b2 , . . .] (resp. Let q0 q1 q2 q0 q1 q2 [a0 ; a1 , a2 , . . .]) defined by Eqs. (2.1) and (2.2). Lemma 3.4. Suppose that S = (b1 , b2 , . . .), finite or infinite. For k ≥ 1, let T = (a0 , a1 , . . . , aik −1 , cik ) be the sequence obtained right after Procedure TAEZ is applied to the term bk . For simplicity, write i = ik . (a) If either (bk is even and Jk = F ) or (bk ≥ 3 is odd and Jk = N), then p′i−1 = 2pk−1

q′i−1 = qk−1

p′i = pk

q′i =

1 2

(3.3)

qk

(3.4)

(b) If either (bk is odd and Jk = F ) or (bk is even and Jk = N), then ci = 1 p′i−1 = pk + pk−1 p′i = 2pk

(3.5) q′i−1 =

1

(qk + qk−1 ) 2 q′i = qk

(3.6) (3.7)

(c) If bk = 1 and Jk = N, then p′i−1 = 2pk−1 − pk p′i = pk

q′i−1 = qk−1 − q′i =

1 2

qk

1 2

qk

(3.8) (3.9)

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

5

Table 3.2 Rules for procedure TAEZ, starting with T = (2b0 ), i = 0, k = 1, J1 = F . Rule

bk

Jk

i :=

T :=

1

even

F

i+1

(T ,

2

1

F

i+1

(T + 1, 1)

3

odd and ≥ 3

F

i+3

(T ,

4

2

N

i+1

(T + 1, 1)

N

5

even and ≥ 4

N

i+3

(T ,

N

6

1

N

i−1

bk −2 2 −1

T1

7

odd and ≥ 3

N

i+1

(T ,

8

even or odd

L

i+1

(T , 2bk )

F

9

even or odd

1L

i+1

(T , 1 + 2bk )

F

−→

−1

T + M means last term of T increased by M. T 1 i + 1 is the number of terms of T

bk 2

Jk+1 := )

bk −1 2

L

, 1, 1) , 1, 1)

bk −1 ) 2

N N

1L L

means T with last term omitted;

(d) If Jk = L or 1L, then p′i−1 = pk−1

q′i−1 =

1

qk−1 2 q′i = qk

p′i = 2pk

(3.10) (3.11)

Proof. Rules in Table 3.2 will be used throughout this proof. When k = 1, it is straightforward to show that (a) and (b) are true by starting with the iterative initial relations (2.1) and (2.2). Now assume that (a)–(d) hold for 1, 2, . . . , k. We next consider bk+1 . Among all the possible cases, we only prove the case bk+1 is odd and Jk+1 = N and the case Jk+1 = 1L. The proofs of the rest of the cases are similar. Case 1. Since Jk+1 = N, part (b) of Lemma 3.2 implies that the condition of (b) is satisfied by bk and Jk . By the inductive hypothesis, Eqs. (3.5)–(3.7) hold. There are two subcases to consider. Subcase 1.1. bk+1 ≥ 3 is odd and Jk+1 = N: Let bk = 2m + 1, where m ≥ 1. By Rule 7, the lengthened T is given by T = (a0 , a1 , . . . , ai , ci+1 ), with ai = ci , ci+1 = m. Then, by Eqs. (3.6) and (3.7), p′i = 2pk , p′i+1



q′i = qk p′i−1

= m pi + = m(2pk ) + (pk + pk−1 ) = (2m + 1) pk + pk−1 = pk+1

q′i+1 = m q′i + q′i−1 = mqk +

1 2

(qk + qk−1 )

1 ( (2m + 1) qk + qk−1 ) = qk+1 2 2 Thus, Eqs. (3.3) and (3.4) hold with k + 1, i + 1 in place of k, i, respectively. Subcase 1.2. bk+1 = 1 and Jk+1 = N: The shortened T is given by

=

1

T = (a0 , a1 , . . . , ai−2 , ai−1 ), according to Rule 6. Now by Eq. (3.6), p′i−1 = pk + pk−1 = pk+1

q′i−1 =

1 2

(qk−1 + qk ) =

1 2

qk+1

(3.12)

Also, by Eqs. (3.5), (3.7) and (3.12), p′i−2 = p′i − p′i−1 = 2pk − pk+1

q′i−2 = q′i − q′i−1 = qk −

1

qk+1 2 Thus, Eqs. (3.8) and (3.9) hold with k + 1, i − 1 in place of k and i, respectively.

6

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

Case 2. Jk+1 = 1L: Part (c) of Lemma 3.2 implies that bk = 1 and Jk = N. By the inductive hypothesis, Eqs. (3.8) and (3.9) hold. Let bk+1 = M. According to Rule 9, the lengthened T is given by T = (a0 , a1 , . . . , ai , ci+1 )

with ci+1 = 1 + 2M .

By Eqs. (3.8) and (3.9), p′i = pk , p′i+1

1

q′i = ′

= (2M + 1)pi +

2

p′i−1

qk

= (2M + 1)pk + (2pk−1 − pk ) = 2(Mpk + pk−1 ) = 2pk+1

q′i+1 = (2M + 1)q′i + q′i−1 = (2M + 1)

1

qk + (qk−1 −

1

qk ) = Mqk + qk−1 = qk+1 2 2 Thus, Eqs. (3.10) and (3.11) hold with k + 1, i + 1 in place of k, i, respectively. □ Proof of Theorem 3.3. If S = (b1 , b2 , . . . , bK ) is finite, then, by letting k = K in Eqs. (2.3), (3.4), (3.7), (3.9) and (3.11), and aiK = ciK in T , we have 2[b0 ; b1 , b2 , . . . , bK ] =

2pK

=

qK

p′i

K

q′i

= [a0 ; a1 , . . . , aiK ].

K

Now suppose S = (b1 , b2 , . . .) is infinite. We observe that, in Lemma 3.4, the terms a0 , a1 , . . . , aik −1 will not be changed when TAEZ is applied to the next term bk+1 , but cik will be changed ⇐⇒ (bk+1 , Jk+1 ) = (1, F ), (2, N) or (1, N) ⇐⇒ the condition in (b) or (d) holds. Therefore, we consider

p′i

k

q′i

if cik will not be changed, and

k

p′i −1 k

q′i −1

otherwise. In the former case, we use Eqs. (3.4) and (3.9)

k

and, in the latter case, we use Eqs. (3.6) and (3.10). Hence, in any case, either with endpoints

2pk−1 qk−1

and

2pk qk

p′i

k

q′i

k

or

p′i

k −1

q′i

belongs to the closed interval

k −1

. Eq. (3.2) now follows from Eq. (2.4) by taking limit of the convergents as k → ∞.



Example 3.5. Let ξ = [b0 ; b1 , b2 , . . . , b6 ] = [0; 4, 3, 5, 8, 2, 1]. k 0 1 2 3 4 5 6

bk 0 4 3 5 8 2 1

Jk −→ F L F N N N

i 0 1 2 5 8 9 8

T 0 0,2 0,2,6 0,2,6,2,1,1 0,2,6,2,1,1,3,1,1 0,2,6,2,1,1,3,1,2,1 0,2,6,2,1,1,3,1,2

Jk+1 F L F N N N 1L

TAEZ Rule used (initiation) 1 8 3 5 4 6

pk

qk

0 1 3 16 131 278 409

1 4 13 69 565 1199 1764

Here the notations for the convergents are as in Lemma 3.4, and the values of the convergents Eqs. (2.1) and (2.2). By Eq. (2.3) , we have

ξ = [0; 4, 3, 5, 8, 2, 1] = [0; 2, 6, 2, 1, 1, 3, 1, 2] =

p6 q6 p′8 ′

q8

= =

409 1764 409 882

p6 p′8 , are computed using q6 q′8

, = 2ξ ,

as asserted by Theorem 3.3. 4. Procedure TASM Let ξ be an irrational number with 0 < ξ <

1

, and let s and ξ1 be the integral and fractional parts of 21ξ respectively. 2 (Note that s ≥ 1.) In this section, the continued fraction expansion ξ1 = [0; S ] = [0; b1 , b2 , . . .] of ξ1 will be used to determine the continued fraction expansion ξ = [0; T ] of ξ and a candidate of the label R of a sequence of α -words which are prefixes of B(ξ ).

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

7

Table 4.1 Rules for procedure TASM, starting with T = (2s), R = (s), k = 1 and J1 = F . Rule

bk

Jk →

T :=

1

even

F

(T ,

2

1

F

(T + 1, 1)

3

odd and ≥ 3

F

(T ,

4

2

N

(T + 1, 1)

5

even and ≥ 4

N

(T ,

bk 2

, 2bk+1 )

bk −1 2

bk −2 2

, 1, 1) , 1, 1)

6

1

N

T + 2bk+1

7

odd and ≥ 3

N

(T ,

bk −1 2

, 2bk+1 )

R :=

k :=

Jk :=

(R, 0, bk+1 )

k+2

F

(R + 1, 0)

k+1

N

(R, 0, 1, 0)

k+1

N

(R + 1, 0)

k+1

N

(R, 0, 1, 0)

k+1

N

R + bk+1

k+2

F

(R, 0, bk+1 )

k+2

F

To obtain T and R from s and S, we start with T = (2s), R = (s) and J1 = F and apply, to the term or terms of S, a procedure called Termwise Appending and Synchronized Modification (or TASM) to lengthen T and R. The rules for TASM are given in Table 4.1, in which the rules for computing T are precisely the TAEZ Rules, with Rules 1’, 6’, 7’ and s in place of Rules 1, 6, 7 and b0 , respectively. Example 4.1. Let ξ , s and ξ1 be as described at the beginning of this section, ξ1 = [0; S ] = [0; b1 , b2 , . . .]. Let bk (1 ≤ k ≤ 14) be given and s = 3. We apply Procedure TASM to S to find T and R, starting with T = (2s) and R = (s). k

bk

1 2 4 5 6 8 10 12 13

1 1 1 2 1 2 6 9 1

bk+1

3

2 2 1 2

T := 6 7,1 7,7 7,8,1 7,8,2,1 7,8,2,5 7,8,2,5,1,4 7,8,2,5,1,4,3,2 7,8,2,5,1,4,3,2,4,1,1 7,8,2,5,1,4,3,2,4,1,5

R := 3 4,0 4,3 4,4,0 4,4,1,0 4,4,1,2 4,4,1,2,0,2 4,4,1,2,0,2,0,1 4,4,1,2,0,2,0,1,0,1,0 4,4,1,2,0,2,0,1,0,1,2

k := 1 2 4 5 6 8 10 12 13 15

Jk := F N F N N F F F N F

Rule used (initiation) 2 6 2 4 6 1 1 3 6

Theorem 4.2. Let ξ , s and ξ1 be as described at the beginning of this section. Let ξ1 = [0; S ]. Let T = (a1 , a2 , . . .) and R = (r1 , r2 , . . .) be the sequences obtained by applying Procedure TASM to (s, S). Then (a) a1 ≥ 2, 0 ≤ r1 ≤ a1 − 1, 0 ≤ ri ≤ ai (i ≥ 2). (b) ξ = [0; T ]. (c) With directive sequence T = (a1 − 1, a2 , a3 , . . .) and label R = (r1 , r2 , . . .), the sequence of α -words wn = wn (r1 , r2 , . . . , rn ), n ≥ 1, converges to B(ξ ). More precisely

w1 ≤ w2 a−1 < wn < B(ξ ) (n ≥ 3)

if a1 = 2 and a3 = 1;

(4.1)

wn < B(ξ ) (n ≥ 1),

otherwise.

(4.2)

Note that in terms of s and S = (b1 , b2 , . . .), the condition in Eq. (4.1) is equivalent to b1 ≥ 3 is odd and s = 1. Proof. Clearly, part (a) follows from the TASM rules and Lemma 3.2. Since 1

ξ

= 2(s + ξ1 ) = 2[s; S ] = [a1 ; a2 , a3 , . . .],

(4.3)

part(b) follows. The proof of part (c) will be given in the next section. □ 5. Approximating the Bernoulli word B(ξ ) by α-words Let ξ , ξ1 , T , S , R, J be as in Section 4. To prove part (b) of Theorem 4.2, we need some lemmas. Define the sequence of standard words: x−1 = b, x0 = a, x1 = ab1 −1 b b

k xk = xk− 1 xk−2

(k ≥ 2).

8

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

The standard words are α -words corresponding to ξ1 having label (0, 0, 0, . . .). Some known basic results on standard words are contained in the following two lemmas (see, for example, [5,6,10]). Lemma 5.1. x2k (k ≥ 3), xk xk−1 (k ≥ 2), xk (k ≥ 1), x1 x0 (if x1 begins with the letter a) are prefixes of C (ξ1 ). Lemma 5.2. xk xk−1 and xk−1 xk differ by the last two letters only, if k ≥ 0. More precisely, if k is even, xk xk−1 and xk−1 xk end in ab and ba respectively, and if k is odd, they end in ba and ab respectively. Definition 5.3. Let alphabet Y = {aa, ab, ba, bb} and define the morphisms ψ, ϕ mapping words over Y into words over X by

⎧ ⎨ aa ↦→ a2s−1 b ψ: ab, ab ↦ → a2s b ⎩ bb ↦→ a2s+1 b p

⎧ ⎨ aa ↦→ as−1 bas and ϕ : ab, ba ↦ → as−1 bas+1 ⎩ bb ↦→ as−1 bas+2 . p−1

p

Corollary 5.4. (a) ϕ (xk xk−1 ) = ϕ (xk xk−1 xk ) if p ≥ 1, k ≥ 0, and |xk xk−1 | is even. (b) ϕ (xk xck+1 xk ) = ϕ (x2k )(ϕ (xk+1 ))c if c, k are integers, c ≥ 1, k ≥ 0, and |xk+1 | is even. Proof. Part (a) is an immediate consequence of Lemma 5.2. p (b) Let p be a nonnegative integer such that xk+1 = xk xk−1 . If p = 0, then k = 0 and so x1 = b would have odd length. Hence p ≥ 1, and

ϕ (xk xck+1 xk ) = ϕ (xk (xpk xk−1 )c xk ) = ϕ (x2k (xpk−1 xk−1 xk )c ) = ϕ (x2k )(ϕ (xpk xk−1 ))c (by part (a)) = ϕ (x2k )(ϕ (xk+1 ))c . □ Lemma 5.5. as−1 b ψ (w ) = ϕ (w )as−1 b, for w ∈ Y + having even lengths. Proof. as−1 b ψ (aa) = (as−1 bas )as−1 b = ϕ (aa)as−1 b, as−1 b ψ (ba) = as−1 b ψ (ab) = (as−1 bas+1 )as−1 b = ϕ (ab)as−1 b = ϕ (ba)as−1 b, as−1 b ψ (bb) = (as−1 bas+2 )as−1 b = ϕ (bb)as−1 b. □ Lemma 5.6. (a) B(ξ ) = as−1 bψ (C (ξ1 )) (Eq. (1.3) is restated here). (b) B(ξ ) = ϕ (C (ξ1 )). (c) ϕ (xk ) (if |xk | is even, and k ≥ 1), ϕ (xk xk−1 ) (if |xk | and |xk−1 | are odd, and k ≥ 2), ϕ (x2k ) (k ≥ 3) are prefixes of B(ξ ). Proof. (b) Since x2k has even length, it belongs to Y + . It then follows from Lemmas 5.1 and 5.5, and part (a) that

ϕ (x2k ) < ϕ (x2k )as−1 b = as−1 b ψ (x2k ) < B(ξ ) Hence the result follows. Part (c) follows from Lemma 5.1 and part(b).



Lemma 5.7. For k ≥ 1, let T = (a1 , a2 , . . . , ai−1 , ci ) and R = (r1 , r2 , . . . , ri−1 , di ) be the sequences obtained right after Procedure TASM is applied to the term bk and let w1 , w2 , . . . , wi−1 , vi be the α -words having directive sequence T and label R. (a) If k > 1, bk is arbitrary, and either (a1) bk−1 is even and Jk−1 = F , or (a2) bk−1 is odd and Jk−1 = N, then wi−1 = ϕ (xk−1 ), vi = ϕ (x2k ), |xk−1 | is even, and |xk | is odd;

(5.1)

(b) If either (b1) bk is odd and Jk = F , or (b2) bk is even and Jk = N, then wi−1 = ϕ (xk xk−1 ), vi = ϕ (x2k ) and both |xk−1 | and |xk | are odd;

(5.2)

ci = 1, di = 0.

(5.3)

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

9

Moreover, the following prefix relations hold:

w1 ≤ w2 a−1 < w3 < · · · < wi−1 < vi (for i ≥ 3),

if b1 ≥ 3 is odd and s = 1;

w1 < w2 < · · · < wi−1 < vi ,

otherwise.

(5.4)

We remark that Procedure TASM is applied to two terms bk−1 and bk at the same time (resp., the term bk only) if either condition (a1) or (a2) (resp., (b1) or (b2)) is satisfied. The sequences a1 , a2 , . . . , ai−1 , r1 , r2 , . . . , ri−1 , and w1 , w2 , . . . , wi−1 in the statement of Lemma 5.7 are determined and will not be changed when we apply TASM to the next term bk+1 , but the numbers ci , di and the word vi in part(a) (resp., (b)) will be changed when and only when bk+1 = 1 (resp. bk+1 = 1 or 2). Proof of Lemma 5.7. Rules in Table 4.1 will be used throughout this proof. We first consider the cases k = 2 in (a) and k = 1 in (b). Recall that we already have T = (2s), R = (s), i = 1. Case b1 is even and J1 = F : Write (b1 , b2 ) = (2m, M). Then |x1 | = |a2m−1 b | is even and |x2 | = |xM 1 a| is odd. Let w1 , w2 , v3 the α -words with directive sequence T and label R, where the lengthened T = (2s, m, 2M), R = (s, 0, M) are given by Rule 1. Then

w1 = as−1 bas = ϕ (a2 ), w1 a = as−1 bas+1 = ϕ (ab) w2 = w1m a = w1m−1 w1 a = (ϕ (a2 ))m−1 ϕ (ab) = v3 = = =

ϕ (a2m−1 b) = ϕ (x1 ) w2M w1 w2M = (ϕ (x1 ))M ϕ (a2 )ϕ (x1 )M M ϕ (xM 1 )ϕ (ax1 a) (by Corollary 5.4 (b)) 2 ϕ (x2 ).

Hence

w1 < w2 < v3 .

(5.5)

Thus T , R and the α -words satisfy conditions (5.1) with k = 2 and i = 3. Case b1 = 2p + 1 is odd and J1 = F : Clearly both x0 = a, x1 = a2p b have odd lengths. If b1 ̸ = 1, that is, p ̸ = 0, let w1 , w2 , w3 , v4 be the α -words having directive sequence T and label R, where the lengthened T = (2s, p, 1, 1) and R = (s, 0, 1, 0) are given by Rule 3. Then

w1 = as−1 bas = ϕ (a2 ) w1 a = as−1 bas+1 = ϕ (ab) = ϕ (ba) w2 = w1p a = (ϕ (a2 ))p−1 ϕ (ab) = ϕ (a2p−1 b) w3 = w1 w2 = w1 w1p a = ϕ (a2 )p ϕ (ba) = ϕ (a2p ba) = ϕ (x1 x0 ) v4 = w3 w2 = w3 w1p−1 w1 a = ϕ (x1 x0 )(ϕ (a2 ))p−1 ϕ (ab) = ϕ (x1 a2p b) = ϕ (x21 ) Clearly

w1 ≤ w2 a−1 < w3 < v4 w1 < w2 < w3 < v4

(if s = 1), (if s ̸ = 1).

(5.6)

Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3) with k = 1, i = 4. If b1 = 1, that is, p = 0, then x1 = b. Let w1 , v2 be the α -words having directive sequence T and label R, where the lengthened T = (2s + 1, 1) and R = (s + 1, 0) are given by Rule 2. Then

w1 = as−1 bas+1 = ϕ (ba) = ϕ (x1 x0 ) v2 = w1 a = ϕ (b2 ) = ϕ (x21 ) Clearly,

w1 < v2 . Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3) with k = 1, i = 2.

(5.7)

10

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

Now we assume that k ≥ 2 in (a) and k ≥ 1 in (b) and proceed by induction. Suppose that the sequences T = (a1 , a2 , . . . , ai , ci ), R = (r1 , r2 , . . . , ri , di ) and the α -words w1 , w2 , . . . , wi−1 , vi , with the required properties, have been constructed right after TASM is applied to the term bk . Case 1. Jk+1 = F : By Lemma 3.2, either Condition (a1) or (a2) is satisfied. By the inductive hypothesis, Eq. (5.1) holds. M Subcase 1.1. bk+1 is even: Write (bk+1 , bk+2 ) = (2m, M). Then clearly |xk+1 | = |x2m k xk−1 | is even and |xk+2 | = |xk+1 xk | is odd. By Rule 1, the lengthened T and R are given by T = (a1 , a2 , . . . , ai+1 , ci+2 ), R = (r1 , r2 , . . . , ri+1 , di+2 ) where ai = ci , ri = di , (ai+1 , ci+2 ) = (m, 2M), (ri+1 , di+2 ) = (0, M). Hence the α -words w1 , w2 , . . . , wi+1 , vi+2 having directive sequence T and R satisfy

wi = vi = ϕ (x2k ),

)m ( wi+1 = wim wi−1 = ϕ (x2k ) ϕ (xk−1 ), vi+2

= ϕ (x2m k xk−1 ) = ϕ (xk+1 ) 2 M = wiM+1 wi wiM+1 = ϕ (xM k+1 )ϕ (xk ) (ϕ (xk+1 )) M = ϕ (xM k+1 xk xk+1 xk ) (by Corollary 5.4 (b))

= ϕ (x2k+2 ) Clearly,

vi = wi < wi+1 < vi+2 .

(5.8)

Therefore, the sequences T , R and the α -words satisfy Eq. (5.1) with k + 2, i + 2, in place of k, i, respectively. 2p+1 Subcase 1.2. bk+1 = 2p + 1 is odd: Clearly, |xk | and |xk+1 | = |xk xk−1 | are both odd. If bk+1 ̸ = 1, that is, p ̸ = 0, let w1 , w2 , . . . , wi , wi+1 , wi+2 , vi+3 be the α -words having directive sequence T and label R, where the lengthened T and R are given by T = (a1 , a2 , . . . , ai+2 , ci+3 ), with ai = ci , ri = di , (ai+1 , ai+2 , ci+3 ) = (p, 1, 1),

R = (r1 , r2 , . . . , ri+2 , di+3 ), (ri+1 , ri+2 , di+3 ) = (0, 1, 0),

according to Rule 3. Then

wi = vi = ϕ (x2k ), wi+1 = wip wi−1 = ϕ (x2p k xk−1 ), +1 xk−1 ) = ϕ (xk xk+1 ) = ϕ (xk+1 xk ) wi+2 = wi wi+1 = ϕ (xk x2p k 2 vi+3 = wi+2 wi+1 = ϕ (xk+1 xk x2p k xk−1 ) = ϕ (xk+1 ).

Clearly, 2p+2 vi = wi < wi+1 = ϕ (x2p ) < wi+2 < vi+3 k xk−1 ) < ϕ (xk

(5.9)

Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3), with k + 1, i + 3 in place of k, i, respectively. If bk+1 = 1, that is, p = 0, let w1 , w2 , . . . , wi , vi+1 be the α -words having directive sequence T and label R, where the lengthened T = (a1 , a2 , . . . , ai , ci+1 ), R = (r1 , r2 , . . . , ri , di+1 ), with (ai , ci+1 ) = (ci + 1, 1), (ri , di+1 ) = (di + 1, 0), according to Rule 2. Then (c +1)−(di +1)

wi = wi−i 1

vi+1

= = = =

d +1

c −d

d

wi−2 wi−i 1 = (wi−i 1 i wi−2 wi−i 1 )wi−1

vi wi−1 = ϕ (x2k )ϕ (xk−1 ) (by Eq. (5.2)) ϕ (x2k xk−1 ) = ϕ (xk xk−1 xk ) (by Corollary 5.4(a)) ϕ (xk+1 xk ) wi wi−1 = ϕ (xk+1 xk )ϕ (xk−1 ) = ϕ (x2k+1 )

Clearly,

vi < wi < vi+1 .

(5.10)

Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3) with k + 1, i + 1 in place of k, i, respectively. Case 2. Jk+1 = N: By Lemma 3.6, either Condition (b1) or (b2) is satisfied. By the inductive hypothesis, Eqs. (5.2) and (5.3) hold.

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

11

Subcase 2.1. bk+1 = 2m is even: Clearly |xk | and |xk+1 | = |x2m k xk−1 | are both odd. If m ̸ = 1, let w1 , w2 , . . . , wi+2 , vi+3 be the α -words having directive sequence T and label R, where the lengthened T and R are given by T = (a1 , a2 , . . . , ai , ai+1 , ai+2 , ci+3 ), R = (r1 , r2 , . . . , ri , ri+1 , ri+2 , di+3 ) with ai = ci , ri = di , (ai+1 , ai+2 , ci+3 ) = (m − 1, 1, 1), (ri+1 , ri+2 , di+3 ) = (0, 1, 0) according to Rule 5. Then

wi = vi = ϕ (x2k ) −1 xk−1 ) wi+1 = wim−1 wi−1 = ϕ (x2k )m−1 ϕ (xk xk−1 ) = ϕ (x2m k wi+2 = wi wi+1 = wi wim−1 wi−1

vi+3

= ϕ (x2k )m ϕ (xk−1 xk ) = ϕ (x2m k xk−1 xk ) = ϕ (xk+1 xk ) −1 = wi+2 wi+1 = ϕ (xk+1 xk )ϕ (x2m xk−1 ) k 2 = ϕ (xk+1 x2m k xk−1 ) = ϕ (xk+1 ).

−1 vi = wi < wi+1 = ϕ (x2m xk−1 ) < ϕ (x2m k ) < wi+2 < vi+3 k

(5.11)

Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3) with k + 1, i + 3 in place of k, i, respectively. If m = 1, let w1 , w2 , . . . , wi , vi+1 be the α -words having directive sequence T and label R, where the lengthened T and R are given by T = (a1 , a2 , . . . , ai , ci+1 ), R = (r1 , r2 , . . . , ri , di+1 ), with (ai , ci+1 ) = (ci + 1, 1) = (2, 1), (ri , di+1 ) = (di + 1, 0) = (1, 0), according to Rule 4 and Eq. (5.3). Then

wi = = vi+1 = =

wi−1 wi−2 wi−1 = vi wi−1 = ϕ (x2k )ϕ (xk−1 xk ) ϕ (x2k xk−1 xk ) = ϕ (xk+1 xk ) wi wi−1 = ϕ (xk+1 xk )ϕ (xk xk−1 ) ϕ (xk+1 x2k xk−1 ) = ϕ (x2k+1 ).

Clearly,

vi < wi < vi+1 .

(5.12)

Thus T , R and the α -words satisfy Eqs. (5.2) and (5.3) with k + 1, i + 1 in place of k, i respectively. 2q+1 Subcase 2.2. bk+1 is odd: Write (bk+1 , bk+2 ) = (2q + 1, M). Then clearly |xk+1 | = |xk xk−1 | is even, |xk+2 | = |xM k+1 xk | is odd. If q ̸ = 0, let w1 , w2 , . . . , wi , wi+1 , vi+2 be the α -words having directive sequence T and label R, where the lengthened T and R are given by T = (a1 , a2 , . . . , ai+1 , ci+2 ), R = (r1 , r2 , . . . , ri+1 , di+2 ), with ai = ci , ri = di , (ai+1 , ci+2 ) = (q, 2M), (ri+1 , di+2 ) = (0, M), according to Rule 7. Then

wi = vi = ϕ (x2k ) wi+1 = wiq wi−1 = ϕ (x2k )q ϕ (xk xk−1 ) +1 = ϕ (x2q xk−1 ) = ϕ (xk+1 ) k

vi+2 = wiM+1 wi wiM+1 = (ϕ (xk+1 ))M ϕ (x2k )(ϕ (xk+1 ))M M = ϕ (xM k+1 xk xk+1 xk ) (by Corollary 5.4 (b))

= ϕ (x2k+2 ) Clearly,

vi = wi < wi+1 < vi+2 . Thus T , R and the α -words satisfy Eq. (5.1) with k + 2, i + 2 in place of k, i, respectively.

(5.13)

12

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

If q = 0, let w1 , w2 , . . . , wi−1 , vi′ be the α -words having directive sequence T and label R, where T = (a1 , a2 , . . . , ai−1 , ′ ′ ci ), R = (r1 , r2 , . . . , ri−1 , di ), ci′ = ci + 2M, di = di + M, as given by Rule 6. Then ′

ci′ = 1 + 2M ,



di = 0 + M = M

(by Eq. (5.3))

wi−1 = ϕ (xk xk−1 ) = ϕ (xk+1 ) vi′ = wiM−+1 1 wi−2 wiM−1 = wiM−1 vi wiM−1 = (ϕ (xk+1 ))M ϕ (x2k )(ϕ (xk+1 ))M M = ϕ (xM k+1 xk xk+1 xk ) (by Corollary 5.4(b)) = ϕ (x2k+2 ), Clearly,

wi−1 < vi′ .

(5.14) ′

Thus T , R and the α -words satisfy Eq. (5.1) with k + 2, ci , di , vi in place of k, ci , di , vi respectively, and i remains the same. Eqs. (5.4) follows immediately from Eqs. (5.5)–(5.14). This completes the proof. □ ′



Proof of part (b) of Theorem 4.2. From Eqs. (5.1) and (5.2), we have wi−1 = ϕ (xk−1 ) or ϕ (xk xk−1 ) and vi = ϕ (x2k ) in each step. Therefore, the result follows from part (c) of Lemma 5.6, and the prefix relation (5.4). This completes the proof. □ In Section 6, we will compute a prefix of B(ξ ) of length 3794, where ξ = [0; 7, 8, 2, 5, 1, 6, . . .]. 6. Expressing R in terms of T Let ξ = [0; T ], ξ1 = [0; S ], and let S be as in Section 4. In this section, we will prove that the procedure TASM, applying to the terms of S, actually leads to the standard decomposition of T , and a formula expressing the label R in terms of T . Definition 6.1. Let T a finite or infinite sequence of positive integers. (a) T is said to be Type 1 if it has exactly 2 terms, the first of which is even and the second is arbitrary. (b) T is said to be Type 2 if it is a finite sequence with at least 3 terms, the first and the last but one term of S are odd, those terms in between are even, and the last term is arbitrary. (c) T is said to be Type 3 if it is an infinite sequence in which only the first term is odd. (d) T is said to be nearly Type i if (T , M) is Type i for any positive integer M, (i = 1, 2). When T is a concatenation of finitely or infinitely many subsequences T1 , T2 , T3 , . . . of the above types, we write T = (T1 , T2 , T3 , . . .), or T = T1 T2 T3 · · ·. It is clear that, if T is an infinite sequence of positive integers, then T is uniquely decomposed into a concatenation of subsequences of the three types. This decomposition is called the standard decomposition of T . Definition 6.2. Let T = (a1 , a2 , . . .) be a finite or infinite sequence of positive integers. Define

⎧ a1 ⎪ if T is Type 1; ⎨( 2 , 0) aj−2 aj−1 −1 χ (T ) = a1 +1 a2 a3 ( , , , . . . , 2 , 2 , 0) if T is Type 2 and has j terms; ⎪ ⎩ a12+1 a22 a23 ( 2 , 2 , 2 , . . .) if T is Type 3. If T is infinite and T = T1 T2 · · · is the standard decomposition of T , define

χ (T ) = (χ (T1 ), χ (T2 ), . . .) = χ (T1 )χ (T2 ) · · · Lemma 6.3. For k ≥ 1, after TASM is applied to the kth term bk of S, we have T = (T1 , T2 , . . . , Tt −1 , Kt ),

R = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht )

(6.1)

T1 , T2 , . . . , Tt −1 are Type 1 or Type 2

(6.2)

Kt is nearly Type 1 or nearly Type 2,

(6.3)

χ (Kt , M) = (Ht , 0) for all positive integer M.

(6.4)

More precisely, (a) Kt is nearly Type 1 if (bk−1 , bk ) is Type 1. (b) Kt is nearly Type 2 if one of the following three conditions holds:

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

13

(i) bk is odd, and Jk = F (ii) bk is even, and Jk = N (iii) bk−1 is odd, Jk−1 = N and bk is arbitrary. Note that Eqs. (6.3) and (6.4) imply that Kt and Ht are of the following forms: Kt = (2m), Ht = (m) if Kt is nearly Type 1;

(6.5)

Kt = (2p + 1, 2m1 , 2m2 , . . . , 2mj , 2q + 1), Ht = (p + 1, m1 , m2 , . . . , mj , q) if Kt is nearly Type 2.

(6.6)

Proof. We prove by induction on k. First note that right before we work on b1 , the starting sequences T = (2s) = K1 and R = (s) = H1 clearly satisfy Conditions (6.1)–(6.4). Thus, with J1 = F , we can proceed at once to the inductive step. Suppose that T and R have been constructed satisfying Conditions (6.1)–(6.4) and Jk has been computed right before TASM is applied to bk . Case 1. bk is even and Jk = F (bk+1 is arbitrary): By Rule 1, the lengthened T and R are given by

= (T1 , T2 , . . . , Tt −1 , Kt , b2k , 2bk+1 ) = (T1 , T2 , . . . , Tt , Kt +1 ) = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht , 0, bk+1 ) = (χ (T1 ), χ (T2 ), . . . , χ (Tt ), Ht +1 ) where Tt = (Kt , bk /2) is Type 1 or Type 2, χ (Tt ) = (Ht , 0) (by Condition (6.4)), Kt +1 = (2bk+1 ) is nearly Type 1, Ht +1 = (bk+1 ), χ (Kt +1 , M) = χ (2bk+1 , M) = (bk+1 , 0) = (Ht +1 , 0) for any positive integer M. T R

Case 2. (bk , Jk ) = (1, F ) or (2, N): By Rule 2 or Rule 4, the lengthened T and R are given by T = (T1 , T2 , . . . , Tt −1 , Kt + 1, 1) = (T1 , T2 , . . . , Tt −1 , Kt′ ) R = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht + 1, 0) = (χ (T1 ), χ (T2 ) · · · , χ (Tt −1 ), Ht′ ), where Kt′ = (Kt + 1, 1), Ht′ = (Ht + 1, 0). By Eqs. (6.5) and (6.6), it is easily seen that Kt′ is nearly Type 2 and χ (Kt′ , M) = (Ht′ , 0) for any positive integer M. Case 3. bk is odd, bk ≥ 3 and Jk = F : By Rule 3, the lengthened T and R are given by T = (T1 , T2 , . . . , Tt −1 , Kt , where Tt = (Kt ,

bk − 1

, 1, 1) = (T1 , T2 , . . . , Tt , Kt +1 ) 2 is of the same type as Kt ,

bk −1 ) 2

Kt +1 = (1, 1) is clearly nearly Type 2,

R = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht , 0, 1, 0) = (χ (T1 ), χ (T2 ), . . . , χ (Tt ), Ht +1 ) where χ (Tt ) = (Ht , 0) by Condition (6.4), Ht +1 = (1, 0),

χ (Kt +1 , M) = (1, 0, 0) = (Ht +1 , 0) for all positive integer M.

Case 4. bk = 1 and J = N (bk+1 is arbitrary): By Rule 6, the next T and R are given by T = (T1 , T2 , . . . , Tt −1 , Kt + 2bk+1 ) = (T1 , T2 , . . . , Tt −1 , Kt′ ),

R = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht + bk+1 ) = (χ (T1 ), χ (T2 ), . . . , χ (Tt −1 ), Ht′ ) where Kt′ = Kt + 2bk+1 and Ht′ = Ht + bk+1 .

By Eqs. (6.5) and (6.6), it is easy to see that Kt′ and Kt are of the same type and

χ (Kt′ , M) = χ (Kt + 2bk+1 , M) = (Ht + bk+1 , 0) = (Ht′ , 0). Therefore, in each of the above cases, Conditions (6.1)–(6.4), (a), and (b) hold for the lengthened T and R after Procedure TASM is applied to bk . The proofs for the other cases are similar. □ Definition 6.4. (a) S is Type 2A if S = (1, 2, 2, . . . , 2, 1, M) or (1, 1, M); (b) S is Type 3A if S = (1, 2, 2, 2, . . .). Lemma 6.5 (Notations as in Lemma 6.3). Let S = S1 S2 · · · be the standard decomposition of an infinite sequence S. If there exists j ≥ 1 such that all Sr (r ≥ j) are Type 2A or Type 3A, except possibly that Sj is Type 2 or Type 3 and Sj has a common ending segment Q with a Type 2A or Type 3A sequence, and Q contains at least 2 terms, then T has a finite standard decomposition, in which the last subsequence is Type 3.

14

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746 Table 6.1 Rules for procedure label starting with k = 1 and J1 = F . Rule

ak

Jk

1

even

F

rk

Jk+1 L

N

ak 2 ak 2 ak +1 2 ak −1 2

2

even

N

3

odd

F

4

odd

5

odd or even

L

0

F

−→

N N L

Proof. Write Sj = PQ , where P may be empty, and S1 S2 · · · Sj−1 P = (b1 , b2 , . . . , bk ). By Lemma 6.3, after TASM is applied to bk , the corresponding sequences T and R satisfy conditions (6.1)–(6.4) and (a), (b). Suppose that (bk+1 , Jk+1 ) = (1, F ), (2, N), or (1, N). By condition (b) and the proof of Lemma 6.3, the next T has the same number of subsequences as T , and the last one Kt′ of which is nearly Type 2, and has more terms than Kt , except when (bk+1 , Jk+1 ) = (1, N), Kt′ and Kt have the same number of terms. ′′ In this exceptional case, (bk+3 , Jk+3 ) = (1, F ) and so the last subsequence Kt of the corresponding T is still nearly Type ′ 2 and has more terms than Kt . Thus the result follows. □ Now it is clear from Lemma 6.3 and 6.5 that the decomposition T = T1 T2 T3 · · ·, obtained by applying TASM to S, is the standard decomposition of T and the equation R = χ (T ) = χ (T1 )χ (T2 ) · · · provides a simple formula for computing R in terms of T . The following theorem follows immediately from the above observation and part (c) of Theorem 4.2. Theorem 6.6. Let ξ = [0; T ], where T = T1 T2 T3 · · · is the standard decomposition of T . Then the sequence of α -words having directive sequence T and label R = χ (T ) = (χ (T1 ), χ (T2 ), . . .) converges to the Bernoulli word B(ξ ) of ξ . In practice, instead of using the standard decomposition of T to compute the label R, we use the J-sequence of T . By identifying 1L with L, it is clear from Table 3.1 that the standard decomposition of an infinite sequence T = (a1 , a2 , . . .) is determined by the J-sequence J = (J1 , J2 , . . .) of T (or the set of k ≥ 1 such that Jk = F ), and vice versa. In other words, (a) Jk = F if ak is the first term of a subsequence in the standard decomposition of T . (b) Jk = L if ak is the last term of a subsequence. (c) Jk = N if ak is neither the first term nor the last term of a subsequence. Type

Subsequence in the standard decomposition of T

The counterpart of J.

1

(2m, M) (2p + 1, 2m1 , . . . , 2mj , 2q + 1, M) or (2p + 1, 2q + 1, M) (2p + 1, 2m1 , 2m2 , . . .)

(F , L) (F , N , N , . . . , N , L) or (F , N , L) (F , N , N , . . .)

2 3

Let T = (a1 , a2 , . . .) and let J = (J1 , J2 , . . .) be the J-sequence of T . Let R = (r1 , r2 , . . .) be the label of the α -words that converge to B(ξ ). From Definition 6.2, it is easy to see that the equation R = χ (T ) in Theorem 6.6 leads to Procedure Label which computes Jk+1 and rk with ak given. Again we identify 1L with L. Example 6.7 (cf. Example 4.1). Let ξ = [0; T ], where T = (a1 , a2 , a3 , . . .) and ak (1 ≤ k ≤ 11) are given. We compute the first 11 terms of the label R = (r1 , r2 , . . .) using Procedure Label. k ak Jk rk Rule used

1 7 F 4 3

2 8 N 4 2

3 2 N 1 2

4 5 N 2 4

5 1 L 0 5

6 4 F 2 1

7 3 L 0 5

8 2 F 1 1

9 4 L 0 5

10 1 F 1 3

11 5 N 2 4

Example 6.8. Let ξ , T and R be as in Example 6.7. According to Theorem 4.2, the α -words w1 , w2 , . . . having directive sequence T and label R are prefixes of the Bernoulli word B(ξ ). The first few words in this sequence are computed below: Applying the recursive formula

w−1 = b,

w0 = a,

a −1−r1

w1 = w01

rn n −rn wn = wna− 1 wn−2 wn−1

(n ≥ 2)

r

w−1 w01

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

15

we have

w1 = a2 b a4 w2 = w14 w0 w14 = (a2 b a4 )4 a (a2 b a4 )4 w3 = w2 w1 w2 = (a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4 )3 ( w4 = w33 w2 w32 = (a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4 (a2 b a4 )4 a (a2 b a4 )4 ) ( 2 44 2 4 9 2 4 4 2 (a b a ) a (a b a ) a (a b a )

)3 w5 = w4 w3 = (a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4 (a2 b a4 )4 a (a2 b a4 )4 ) ( 2 44 2 4 9 2 4 4 3 (

(a b a ) a (a b a ) a (a b a )

w6 = w w4 w = 2 5

2 5

((

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

(

((

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

(

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

)3

(a2 b a4 )4 a (a2 b a4 )4

)2 )

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

(

(a2 b a4 )4 a (a2 b a4 )4

)3 )2

(a2 b a4 )4 a (a2 b a4 )9 a (a2 b a4 )4

((

)3

)3

(a2 b a4 )4 a (a2 b a4 )4

)3 )2

Note that |w4 | = 662, |w5 | = 783, |w6 | = 3794. 7. Concluding remarks For any given (b0 , S), Procedure TAEZ is used in Section 3 to compute the solution T = (a0 , a1 , a2 , . . .) of Eq. (3.5). The original idea of the computation consists of two steps: Eliminating Zeros Appending (b0 , S) − −−−−−−−→ (2b0 , Γ (S)) −−−−−−−−−−−−−→ T

(7.1)

In the first step ‘‘Appending’’, we make use of the standard decomposition of S and a function Γ defined below. Definition 7.1. Let S = (b1 , b2 , . . .) be a finite or infinite sequence of positive integers. Define

⎧ b1 ⎪ if S is Type 1, ⎨( 2 , 2b2 ), bj−2 −2 bj−1 −1 b1 −1 b2 − 2 Γ (S) = ( 2 , 1, 1, 2 , 1, 1, . . . , 2 , 1, 1, 2 , 2bj ), if S is Type 2 and have j terms, ⎪ ⎩( b1 −1 , 1, 1, b2 −2 , 1, 1, b3 −2 , 1, 1, . . .), if S is Type 3. 2 2 2 In case S is a proper initial segment of some Type i sequence S ′ (i.e., S is incomplete Type i), i = 1, 2, define Γ (S) to be the counterpart of S in Γ (S ′ ). For example, the sequences (5), (5, 8), (5, 8, 6, 1) are incomplete Type 2, and

Γ (5) = (2, 1, 1), Γ (5, 8) = (2, 1, 1, 3, 1, 1), Γ (5, 8, 6, 1) = (2, 1, 1, 3, 1, 1, 2, 1, 1, 0) In analogy to the infinite case, we define the standard decomposition of a finite sequence of S of positive integers as the unique decomposition of S of the form S = S1 S2 · · · Sn , where each Sj is Type 1 or Type 2, except perhaps Sn , which may be incomplete Type 1 or incomplete Type 2. Let S be a finite or infinite sequence having standard decomposition S = S1 S2 · · ·, define

Γ (S) = Γ (S1 )Γ (S2 ) · · · . Now go back to our problem. Note that when Γ (S) has no zero terms, the equation 2[b0 ; S ] = [2b0 ; Γ (S)]

(7.2)

holds, that is, T = (2b0 , Γ (S)) is the solution of Eq. (3.2). In case Γ (S) has some zero terms, we have to go one step further. In the second step in Eq. (7.1), the following formula will be used repeatedly to eliminate all the zeros that occur in Γ (S) and thus obtain the solution T . Eliminating-Zeros Formula (or EZ Formula). Let c0 , c1 , c2 , . . . be a sequence of integers with cn ≥ 0 and cn + cn+1 ≥ 1 for all n ≥ 0.

16

W.-F. Chuan and Y.-J. Lin / Discrete Mathematics 343 (2020) 111746

Then EZ Formula replaces ( c0 , c1 , c2 , . . .) by

⎧ if c1 = 0 and c2 exists, ⎨(c0 + c2 , c3 , c4 , . . .) (c0 , c1 , . . . , ci−1 + ci+1 , ci+2 , . . .) if ci = 0, i > 1 and ci+1 exists, ⎩ (c0 , c1 , . . . , ci−2 ) if ci = 0, i ≥ 2 and ci is the last term. In practice, instead of using Eq. (7.1) (which is easy to remember), or Subsequencewise Appending and Eliminating Zeros, we use Termwise Appending and Eliminating Zeros (or TAEZ). This explains why J-sequence is used and how TAEZ rules are obtained. With this choice, the proof of Theorem 3.3 is simpler. In Section 4, Procedure TASM is used to compute the sequence T such that ξ = [0; T ] and the label R. By Eq. (4.3), T can be computed from (s, S) by applying TAEZ to S, starting with T = (2s). Now the idea of computing T and R at the same time is Appending

(s, S) − −−−−−−−→

(

(2s, Γ (S)) (s, ∆(S))

)

Synchronized Modification

−−−−−−−−−−−−−−−−−−→

( )

T . R

(7.3)

The function ∆ is defined below. Definition 7.2. Let S = (S1 , S2 , S3 , . . .) be a finite or infinite sequence of positive integers. Define

⎧ (0, b2 ), if S is Type 1, ⎪ ⎪ ⎨ ( (0, 1, 0), (0, 1, 0), . . . , (0, 1, 0), 0, bn ) , a concatenation of n − 2 subsequences ∆(S) = ⎪ (0, 1, 0) and (0, bn ), if S is Types 2 and has n terms, ⎪ ⎩ ((0, 1, 0), (0, 1, 0), . . .), if S is Type 3. If S = (S1 , S2 , . . .) is the standard decomposition of S, define ∆(S) = (∆(S1 ), ∆(S2 ), . . .). Note that if the ith term of (2s, Γ (S)) is zero, so is the ith term of (s, ∆(S)). ‘‘Synchronized Modification’’ eliminates the zeros in (2s, Γ (S)) and, at the same time, the corresponding zeros (s, ∆(S)), using the EZ Formula. Nevertheless, the resulting label R may still contain zero terms. In practice, we use Termwise Appending and Synchronized Modification (or TASM). In the sequel [3] of the present paper, we use the formula R = χ (T ) to prove a representation theorem of B(ξ ) in which the building blocks are standard words (corresponding to ξ ) and their adjoints. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Acknowledgments The authors wish to express their gratitude to the anonymous reviewers for their valuable comments and suggestions and for bringing references [8,11] to their attention. References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

J. Beck, Probabilistic Diophantine Approximation: Randomness in Lattice Point Counting, Springer, 2014, pp. 123–125. W.-T. Cao, Z.-Y. Wen, Some properties of the factors of Sturmian sequences, Theoret. Comput. Sci. 304 (2003) 365–385. W.-F. Chuan, A representation theorem of the Bernoulli words of irrational numbers (submitted for publication). W.-F. Chuan, Subwords of the golden sequence and the Fibonacci words, in: G.E. Bergum, A.N. Philippou, A.F. Horadam (Eds.), Applications of Fibonacci Numbers, vol. 6, Kluwer Acad. Publ, Dordrecht, the Netherlands, 1996, pp. 73–84. W.-F. Chuan, α -Words and factors of characteristic sequences, Discrete Math. 177 (1997) 33–50. W.-F. Chuan, A representation theorem of the suffixes of characteristic sequences, Discrete Appl. Math. 85 (1998) 47–57. W.-F. Chuan, F.-Y. Liao, F. Yu, Markov word patterns and a relation on α -words, Discrete Appl. Math. 214 (2016) 63–87. M. Hall, On the sum and product of continued fractions, Ann. of Math. 48 (1947) 966–993. F.-Y. Liao, W.-F. Chuan, Q-factorization of suffixes of two-way infinite extensions of irrational characteristic words, Discrete Appl. Math. 217 (2017) 243–260. M. Lothaire, Algebraic Combinatorics on Words, Cambridge Univ. Press, 2002, (Chapter 2). G.N. Raney, On continued fractions and finite automata, Math. Ann. 206 (1973) 265–283. B.A. Venkov, Elementary Number Theory, Wolters-Noorhoff, Groningen, the Netherlands, 1970, pp. 67–68, (Translated from the Russian and edited by H. Alderson). Z.-X. Wen, Z.-Y. Wen, Some properties of the singular words of the Fibonacci word, European J. Combin. 15 (1994) 587–598.