a note of ins-primitive words

16
This article was downloaded by: [Florida International University] On: 19 December 2014, At: 09:28 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK International Journal of Computer Mathematics Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/gcom20 A note of ins-primitive words H. K. Hsiao a , Y. T. Yeh b & S. S. Yu c a Liberal Arts Center , Da-Yeh University , 112, Shan-Jeau Rd., Da- Tsuen, Chang-Hwa, Taiwan 515 b Institute of Information and Mathematical Sciences , Massey University at Albany , Private Bag 102 904, North Shore MSC Auckland, New Zealand c Department of Computer Science , National Chung-Hsing University , Taichung, Taiwan 402 Published online: 25 Jan 2007. To cite this article: H. K. Hsiao , Y. T. Yeh & S. S. Yu (2004) A note of ins-primitive words, International Journal of Computer Mathematics, 81:8, 917-929, DOI: 10.1080/00207160410001715320 To link to this article: http://dx.doi.org/10.1080/00207160410001715320 PLEASE SCROLL DOWN FOR ARTICLE Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) contained in the publications on our platform. However, Taylor & Francis, our agents, and our licensors make no representations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of the Content. Any opinions and views expressed in this publication are the opinions and views of the authors, and are not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon and should be independently verified with primary sources of information. Taylor and Francis shall not be liable for any losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoever or howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use of the Content. This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. Terms &

Upload: s-s

Post on 14-Apr-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A note of ins-primitive words

This article was downloaded by: [Florida International University]On: 19 December 2014, At: 09:28Publisher: Taylor & FrancisInforma Ltd Registered in England and Wales Registered Number: 1072954 Registeredoffice: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK

International Journal of ComputerMathematicsPublication details, including instructions for authors andsubscription information:http://www.tandfonline.com/loi/gcom20

A note of ins-primitive wordsH. K. Hsiao a , Y. T. Yeh b & S. S. Yu ca Liberal Arts Center , Da-Yeh University , 112, Shan-Jeau Rd., Da-Tsuen, Chang-Hwa, Taiwan 515b Institute of Information and Mathematical Sciences , MasseyUniversity at Albany , Private Bag 102 904, North Shore MSCAuckland, New Zealandc Department of Computer Science , National Chung-HsingUniversity , Taichung, Taiwan 402Published online: 25 Jan 2007.

To cite this article: H. K. Hsiao , Y. T. Yeh & S. S. Yu (2004) A note of ins-primitivewords, International Journal of Computer Mathematics, 81:8, 917-929, DOI:10.1080/00207160410001715320

To link to this article: http://dx.doi.org/10.1080/00207160410001715320

PLEASE SCROLL DOWN FOR ARTICLE

Taylor & Francis makes every effort to ensure the accuracy of all the information (the“Content”) contained in the publications on our platform. However, Taylor & Francis,our agents, and our licensors make no representations or warranties whatsoever as tothe accuracy, completeness, or suitability for any purpose of the Content. Any opinionsand views expressed in this publication are the opinions and views of the authors,and are not the views of or endorsed by Taylor & Francis. The accuracy of the Contentshould not be relied upon and should be independently verified with primary sourcesof information. Taylor and Francis shall not be liable for any losses, actions, claims,proceedings, demands, costs, expenses, damages, and other liabilities whatsoeveror howsoever caused arising directly or indirectly in connection with, in relation to orarising out of the use of the Content.

This article may be used for research, teaching, and private study purposes. Anysubstantial or systematic reproduction, redistribution, reselling, loan, sub-licensing,systematic supply, or distribution in any form to anyone is expressly forbidden. Terms &

Page 2: A note of ins-primitive words

Conditions of access and use can be found at http://www.tandfonline.com/page/terms-and-conditions

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 3: A note of ins-primitive words

International Journal of Computer MathematicsVol. 81, No. 8, August 2004, pp. 917–929

A NOTE OF INS-PRIMITIVE WORDS

H. K. HSIAOa,∗, Y. T. YEHb,† and S. S. YUc,‡

aLiberal Arts Center, Da-Yeh University, 112, Shan-Jeau Rd., Da-Tsuen, Chang-Hwa, Taiwan 515;bInstitute of Information and Mathematical Sciences, Massey University at Albany,

Private Bag 102 904, North Shore MSC Auckland, New Zealand;cDepartment of Computer Science, National Chung-Hsing University, Taichung, Taiwan 402

(Revised 10 April 2003; In final form 1 May 2003)

The aim of this article is to investigate the properties of primitive words with respect to insertion operation, called ins-primitive words. This includes the investigation of properties concerning primitive words (with respect to catenationoperation) in order to show our result concerning the self-insertion of a word. We also show that the set of allins-primitive words is not only dense but also disjunctive (hence not regular).

Keywords: Insertion; Primitive; Disjunctive

AMS Subject Classification: 68R15

C.R. Category: F.4.3

1 INTRODUCTION AND PRELIMINARIES

The longest repeating segment problem is one of the most important problems of sequence com-paring in molecular biology since high biomolecular sequence similarity often indicates sig-nificant functional or structural similarity [1]. Moreover, the study of primitivity of sequences(words) is often the first step towards the understanding of sequences. This is because a prim-itive sequence, which cannot be obtained by repeating any other sequence, is often related tosome isolated characters of functions or structures. This provides the motivation to study theprimitivity of words with respect to a given operation. Furthermore, biomolecular sequencerearrangements caused by changes, such as temperature and pressure changes, are betterdescribed mathematically by insertion of words rather than the more standard catenation ofwords. Hence, investigation of fundamental properties concerning insertion primitive wordsis essential. The insertion of words and the insertion primitive words were considered by Kariand Thierrin [2]. However, they left the detailed properties of insertion primitive words behind.In this article, we explore basic properties concerning insertion primitive words.

∗ E-mail: [email protected]† E-mail: [email protected]‡ Corresponding author. E-mail: [email protected]

ISSN 0020-7160 print; ISSN 1029-0265 online c© 2004 Taylor & Francis LtdDOI: 10.1080/00207160410001715320

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 4: A note of ins-primitive words

918 H. K. HSIAO et al.

Let X be a finite alphabet. The catenation of u and v is uv. A word u ∈ X+ is said to beprimitive if it is not a power of another word, that is, u is primitive if u = pn with p ∈ X+implies n = 1. Let Q denote the set of all primitive words.

The insertion of u into w is defined as: w ← u = {xuy|w = xy, x, y ∈ X∗}. We defineL1 ← L2 = ⋃

u∈L1,v∈L2u ← v for any two languages L1 and L2 and often identify singleton

sets with their elements. The iterated insertion-operation ←i is defined by L1 ←0 L2 = L1

and L1 ←i L2 = (L1 ←i−1 L2) ← L2 whenever i ≥ 1 for languages L1 and L2. The ithinsertion-power of a nonempty language L is defined as L←0 = {1} and L←i = L ←i−1 L

for i ≥ 1. A nonempty word w is called ins-primitive if w ∈ u←ifor some word u and i ≥ 1

yields i = 1 andw = u. The ith word-autoinsertion-power of a nonempty languageL is definedas L←(i) = ⋃

u∈L u←ifor i ≥ 0.

It is clear that every ins-primitive word is a primitive word. Let Qins denote the set of allins-primitive words. Clearly, Qins ∩ Q

←(i)ins = ∅ for any i ≥ 2.

Let X be a finite alphabet with at least two elements without special mention in the sequel.For a given language L ⊆ X∗, the principal congruence PL determined by L is defined asfollows:

u ≡ v(PL) ⇐⇒ (xuy ∈ L ⇐⇒ xvy ∈ L, ∀x, y ∈ X∗).

It is well known that the language L is accepted by a finite automaton if and only if L hasfinitely many PL congruence classes, that is, PL is of finite index.A language which is acceptedby a finite automaton is called a regular language [3]. A language L such that PL is the identityis called a disjunctive language. Clearly, no disjunctive language is regular.

The article is organized as follows: Following this introduction, Section 2 is dedicatedto the study of properties concerning primitive words which are needed in Section 3. Weshow some conditions for primitive words p, q and integers m, n, s such that pmqspnx isnot primitive for some words x. Then in Section 3, we investigate words u ∈ X+ such thatu←2

contains the word pmqspnqs for some distinct primitive words p and q and integersm, n, s ≥ 1. In Ref. [4], it is shown that every word in X+ is a power of a unique primi-tive word. If u = pn for some p ∈ Q, then p is called the primitive root of u, denotedby λ(u) = p. But the uniqueness of primitive power expression does not hold for the ins-primitive power expression. That is, there are two distinct ins-primitive words u and v suchthat u←i ∩ v←i = ∅ for some i ≥ 2. The result obtained in Section 3 provides the first stepfor the study of words in u←2

for some words u. Section 4 is dedicated to the study of thedisjunctivities of Q

←(i)ins for i ≥ 1. A language L is said to be dense if L ∩ X∗wX∗ = ∅ for any

w ∈ X∗. It is clear that L←(i) is dense for any dense language and any i ≥ 1. In Ref. [5], itis shown that Qins is dense. It is known that a language is dense if and only if it contains adisjunctive subset [6]. We show that Qins and Q

←(i)ins for any i ≥ 2 are not only dense but also

disjunctive.Items not defined here or in the subsequent sections can be found in Ref. [3]. We identify

singleton sets with their elements without special mention in the sequel.

2 SOME PROPERTIES CONCERNING PRIMITIVE WORDS

Before showing properties of ins-primitive words, we first introduce and propose some prop-erties of primitive words. This provides the necessary properties to show the conditions for aword pmqspnqs being expressed as u2

1u22.

LEMMA 2.1 ([4]) Let uv = vu, u = 1 and v = 1. Then λ(u) = λ(v).

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 5: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 919

For u, v, w ∈ X∗, if u = vw, then v is a prefix of u, denoted by v ≤p u, and w is a suffixof u, denoted by w ≤s u. Next, we show the following decomposition property of a powerof a primitive word which is used in the sequel for checking the repeating segments of aword.

PROPOSITION 2.2 For p ∈ Q, if pi = xpy for some x, y ∈ X∗ and i ≥ 1 then x, y ∈ p∗.

Proof Let p ∈ Q and pi = xpy for some x, y ∈ X∗. Suppose x /∈ p∗. Then x = pjp1

for some j ≥ 0 and p1 ∈ X+ with p1 <p p. There is p2 ∈ X+ such that p = p1p2. Thusp2p1p2p

i−j−2 = p2pi−j−1 = py = p1p2y and so p2p1 = p1p2. By Lemma 2.1, λ(p1) =

λ(p2) which contradicts the fact that p ∈ Q. Thus x ∈ p∗. By cancelling common factors,we have y ∈ p∗. �

LEMMA 2.3 ([7]) Let u ∈ X+ and q ∈ Q\{λ(u)}. Then qmu ∈ Q for all m ≥ lg(u) + 1.

LEMMA 2.4 ([4]) Let f, g ∈ Q with f = g. Then f mgn ∈ Q for all m, n ≥ 2.

The following property concerns the conditions of two distinct primitive words p andq such that pqm is not primitive for some m ≥ 2 which provides a detail information ofthe relation between these two primitive words and is necessary for further study of relatedcases.

LEMMA 2.5 ([7]) Let p, q ∈ Q with p = q. If pqm = gk for some m, k ≥ 2 and g ∈ Q, thenone of the following two statements holds:

(1) p = (xqm)k−1x for some x ∈ X+;(2) p = (yxqm−1)k−2yxqm−2xy and q = x(yx)j for some x = y ∈ X+, j ≥ 1.

LEMMA 2.6 ([8]) Let uv = f i , u, v ∈ X+, f ∈ Q, i ≥ 1. Then vu = gi for some g ∈ Q.

LEMMA 2.7 ([9]) Let u1, u2, v1, v2 ∈ X+. If u1v1 ∈ Q, u1v1 = u2v2, and v1u1 = v2u2 thenu1 = u2 and v1 = v2.

LEMMA 2.8 ([4]) If u and v have powers um and vn with a common initial segment of lengthlg(u) + lg(v), then u and v are powers of a common word.

PROPOSITION 2.9 Let p, q ∈ Q with p = q. Then p1pmqspnqs ∈ Q for any s ≥ 1, m ≥ n ≥

max(lg(qs) + 1, 3) and p1 ∈ X+ with p1 <s p.

Proof Suppose p1pmqspnqs ∈ Q for some s ≥ 1, m ≥ n ≥ max(lg(qs) + 1, 3) and 1 =

p1 <s p. Then there exist f ∈ Q and r ≥ 2 such that p1pmqspnqs = p1p

i(pnqs)2 = f r

where i = m − n. As p and q are distinct primitive words and n ≥ lg(qs) + 1, by Lemma 2.3,pnqs ∈ Q. Suppose p1p

i ∈ Q. Then p1pi = gt for some g ∈ Q and t ≥ 2. If g = pnqs , then

p1pi = (pnqs)t . Write p = p2p1 where p2 ∈ X+. From Lemma 2.6, it follows that p1p2 ∈ Q.

Since nt = 0 and p = p2p1, i = 0 and thus p1p2 = p2p1. By Lemma 2.1, λ(p1) = λ(p2),which contradicts the fact that p ∈ Q. Thus g = pnqs . By Lemma 2.4, f r = p1p

i(pnqs)2 =gt (pnqs)2 ∈ Q and so r = 1, a contradiction. Hence p1p

i ∈ Q. Then, as p1pi and pnqs are

distinct primitive words, by Lemma 2.5, we have the following two cases.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 6: A note of ins-primitive words

920 H. K. HSIAO et al.

(1) p1pi = (x1(p

nqs)2)r−1x1 for some x1 ∈ X+. Then i > 0 and

p1pi = (p1p2)

ip1 = x1p2(p1p2)n−1p1q

sp2(p1p2)n−1p1q

s(x1(pnqs)2)r−2x1.

By Proposition 2.2, p1p2 ∈ Q, x1p2(p1p2)n−1p1q

sp2 <p (p1p2)i , and n ≥ 3 imply

x1p2(p1p2)n−2 ∈ (p1p2)

∗ and x1p2(p1p2)n−1p1q

sp2 ∈ (p1p2)∗.

This yields that p1p2p1qsp2 ∈ (p1p2)

∗; hence qs ∈ (p2p1)∗ = p∗. Clearly, q = p,

a contradiction.(2) p1p

i = (y1x1pnqs)r−2y1x1x1y1 and pnqs = x1(y1x1)

j for some x1, y1 ∈ X+ with x1 =y1 and j ≥ 1. Consider the following subcases:

(2.1) r > 2. As y1 <s p1pi , y1 = y2p

k for some k ≥ 0 and y2 <s p. There exists y3 ∈X+ such that p = y3y2.

(2.1.1) k > 0. As k > 0, y2y3y2 = y2p <p y1 <p p1pi = p1p2p1p

i−1. This together withlg(y2y3) = lg(p) = lg(p1p2) yields y2y3 = p1p2. This in conjunction withy3y2(=p) = p2p1 ∈ Q yields y2 = p1 by Lemma 2.7. Thus pi = pkx1p

nqs

(y1x1pnqs)r−3y1x1x1y1. By Proposition 2.2, pkx1 ∈ p∗; hence x1 ∈ p∗. As x1 ∈

X+, x1 = pt for some t > 0. Since ptp1pk = x1y1 <s p1p

i , pt−1p2p1p1 = ptp1 <s

p1pi−k = (p1p2)

i−k−1p1p2p1. This yields that p2p1 = p1p2. By Lemma 2.1,λ(p1) = λ(p2), which contradicts the fact that p ∈ Q.

(2.1.2) k = 0. Then y1 <s p. Note that as pnqs = x1(y1x1)j and lg(qs) + lg(y1) < n +

lg(p) < n lg(p) = lg(pn), lg(x1y1) = (lg(pnqs) lg(y1))/(j + 1) = (lg(pn) + lg(qs)

+ lg(y1))/(j + 1) < (lg(pn) + lg(pn))/(j + 1) ≤ lg(pn). Hence x1y1 <p pn. Thenthere exists k1 ≥ 0 such that x1y1 = pk1x2 for some x2 <p p. Then p = x2x3 forsome x3 ∈ X+. If k1 = 0, then x1y1 <p p and so lg(x1y1) < lg(p). Since pnqs =x1(y1x1)

j = (x1y1)j x1 and n ≥ 3, pn and (x1y1)

j have a common initial segment oflength lg(x1y1) + lg(p). By Lemma 2.8, p and x1y1 are powers of a common word.This contradicts the fact that p ∈ Q and lg(x1y1) < lg(p). Hence k1 > 0. This yieldsthat x2x3x2 = px2 ≤s pk1x2 = x1y1 <s p1p

i = p1pi−1x2x3. Hence x3x2 = x2x3. If

x2 = 1, then by Lemma 2.1 λ(x2) = λ(x3), which implies p /∈ Q, a contradiction.Thus x2 = 1 and so x1y1 = pk1 . This yields p1p

i−k1 = (y1x1pnqs)r−2y1x1. This

implies y1x1 = pk1 = x1y1 as lg(y1x1) = lg(x1y1) = lg(pk1). Then by Lemma 2.1λ(x1) = λ(y1), which implies pnqs(=x1(y1x1)

j ) /∈ Q, a contradiction.(2.2) r = 2. Then p1p

i = y1x1x1y1.(2.2.1) i = 0. Then p1 = y1x1x1y1. This together with p1 <s p implies lg(y1x1x1y1) <

lg(p). In view of lg(x1y1) < lg(p) and pnqs = (x1y1)j x1, we obtain j > n. This in

conjunction with n ≥ 3 yields that pn and (x1y1)j have a common initial segment of

length lg(p) + lg(x1y1). By Lemma 2.8, p and x1y1 are powers of a common word.This contradicts the fact that p ∈ Q and lg(x1y1) < lg(p).

(2.2.2) i = 0, i.e. i ≥ 1. Since p1 <s p, lg(x1y1) < lg(pi) and thus x1y1 <s pi . It followsthat x1y1 = x2p

k1 for some k1 ≥ 0 and x2 <s p. Then p = x3x2 for somex3 ∈ X+. If k1 ≥ 1 then x2x3x2 = x2p <p x1y1 <p pnqs = x3x2p

n−1qs . Hence x2x3 =x3x2. If x2 = 1, then by Lemma 2.1 λ(x2) = λ(x3) and so p /∈ Q, a contradiction. Thusx2 = 1 and so x1y1 = pk1 . This yields p1p

i−k1 = y1x1. Hence lg(pk1) = lg(x1y1) =lg(y1x1) = lg(p1p

i−k1). Hence lg(p)| lg(p1), which contradicts the fact that 1 =p1 <s p. We hence conclude that k1 = 0 and so x1y1 <s p and lg(x1y1) < lg(p).As pnqs = x1(y1x1)

j = (x1y1)j x1 and n ≥ 3, pn and (x1y1)

j have a common initialsegment of length lg(p) + lg(x1y1). By Lemma 2.8, p and x1y1 are powers of acommon word. This contradicts the fact that p ∈ Q and lg(x1y1) < lg(p). �

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 7: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 921

Now, we consider the case that p, q ∈ Q and x ∈ X∗ such that pmqsprx /∈ Q for somem, s ≥ 1 and r ≥ 0 with m ≥ 2 lg(qs) + 2. First, we characterize words p, q and x such thatpmqsx /∈ Q, i.e. r = 0.

LEMMA 2.10 Let p, q ∈ Q, p = q, m, r ≥ 0, s ≥ 1, m + r ≥ lg(qs) + 1. Then pmqspr ∈ Q.

Proof Since m + r ≥ lg(qs) + 1, by Lemma 2.3, qspm+r ∈ Q. Then by Lemma 2.6pmqspr ∈ Q. �

LEMMA 2.11 ([7]) Let qmu = gk for some m, k ≥ 1, u ∈ X+ and g, q ∈ Q with u /∈ q+. Thenq = g and lg(g) > lg(qm−1).

PROPOSITION 2.12 Let p, q ∈ Q, p = q, s ≥ 1, m ≥ 2 lg(qs) + 2 and x ∈ X∗ with x <p p

or x <p qs . Then pmqsx /∈ Q if and only if x ∈ X+ and qsx ∈ p+.

Proof If x ∈ X+ and qsx ∈ p+ then clearly pmqsx ∈ pmp+; hence pmqsx /∈ Q. Nowlet pmqsx = gn for some g ∈ Q and n ≥ 2. By Lemma 2.10, pmqs ∈ Q. Thus x = 1,i.e. x ∈ X+. Suppose qsx /∈ p+. By Lemma 2.11, lg(g) > lg(pm−1). For the case x <p

p, as m ≥ 2 lg(qs) + 2 and n ≥ 2, lg(gn) = n lg(g) > 2 lg(pm−1) ≥ lg(pm−1) + lg(p) +lg(plg(qs )) + lg(qs) > lg(pmqsx), which contradicts the fact thatpmqsx = gn. For the other casex <p qs , lg(gn) = n lg(g) > 2 lg(pm−1) ≥ lg(pm−1) + lg(p) + 2 lg(qs) > lg(pmqsx), whichcontradicts the fact that pmqsx = gn. Thus qsx ∈ p+. �

LEMMA 2.13 ([4]) If um = vn, u, v ∈ X+, and m, n ≥ 1 then λ(u) = λ(v).

COROLLARY 2.14 For p, q ∈ Q, if qip ≤p pj or pqi ≤s pj for some i, j ≥ 1 then p = q.

Proof Let p, q ∈ Q be such that qip ≤p pj for some i, j ≥ 1. By Proposition 2.2, qi ∈ p∗.From Lemma 2.13, it follows that q = p. �

For r ≥ 1, we consider the following example: let X = {a, b}, p = ababa, q = ba,x = (ab)2 and r = m − 2 for some m ≥ 2 lg(qs) + 2. Then pmq2prx = (pm−1x)2 /∈ Q. Thisshows that when r = 0, pmqsprx /∈ Q does not imply that qsprx ∈ p+. We characterizeprimitive words p, q and a word x such that pmqsprx /∈ Q for some m, s, r ≥ 1 withm ≥ 2 lg(qs) + 2 as follows.

PROPOSITION 2.15 Let p, q ∈ Q, p = q, s, r ≥ 1 and m ≥ 2 lg(qs) + 2 be such thatpmqsprx = gn for some g ∈ Q, n ≥ 2 and x ∈ X∗ with either x <p p or x <p qs and p ≤p x.Then n = 2, x = 1 and one of the following statements holds:

(i) There is y ∈ X+ such that xy = p and yqs = pk where k = m − r − 1 ≥ 1;(ii) qs = ps1xps2 for some s1, s2 ≥ 0 with m + s1 = s2 + r .

Proof Suppose that there are p, q ∈ Q with p = q, s, r ≥ 1, m ≥ 2 lg(qs) + 2 and x ∈ X∗with either x <p p or x <p qs and p ≤p x such that pmqsprx = gn for some g ∈ Q andn ≥ 2. As m + r ≥ lg(qs) + 1, by Lemma 2.10, pmqspr ∈ Q. Thus x = 1. Note that asp = q, by Lemma 2.13, pi = qj for any i, j ≥ 1, i.e. qj /∈ p+. Then by Proposition 2.2qsprx /∈ p+. Hence, by Lemma 2.11, lg(g) > lg(pm−1). Since x <p p or x <p qs andp ≤p x, lg(x) < lg(g). Hence we have lg(pm−1) < lg(g) < lg(pmqspr). We then work onpossible lengths of g in the following four cases.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 8: A note of ins-primitive words

922 H. K. HSIAO et al.

(1) g = pm−1u and p = uv for some u, v ∈ X+. The fact that g2 = pm−1upm−1u ≤p

pmqsprx implies pm−1u ≤p vqsprx. Hence v <p p.As m ≥ 2 lg(qs) + 2, lg(pm−1u) =(m − 1) lg(p) + lg(u) ≥ (2 lg(qs) + 1) lg(p) ≥ lg(qs) + 2 lg(p) > lg(vqsp). Thus pm

= pm−1uv = vqspz for some z ∈ X+. By Proposition 2.2, vqs ∈ p+, i.e. vqs = pk forsome k ≥ 1. Then gn = (pm−1u)n = pmqsprx = pm−1uvqsprx = pm−1upk+rx, i.e.(pm−1u)n−1 = pk+rx. If n ≥ 3 then pm−1upm−1 <p pk+rx. This yields that uppm−2 <p

p2pk+r−m−1x. This implies that uuv = up = pu. By Lemma 2.1, λ(u) = λ(p), whichcontradicts the fact that p ∈ Q and u <p p. Hence n = 2, i.e. pm−1upm−1u = pmqsprx.This in conjunction with m ≥ 2 lg(qs) + 2, p ≤p x and either x <p p or x <p qs yieldspxv <s pm−1uv = pm. By Proposition 2.2, xv ∈ p+.As p ≤p x and lg(v) < lg(p), x =u. Hence k = m − r − 1. Note that vqs = pk . The assertion (i) holds.

(2) g = pm. Then m = 1, which contradicts the fact that m ≥ 2 lg(qs) + 2.(3) g = pmqs1q1 for some s > s1 ≥ 0 and 1 = q1 ≤p q. There exists q2 ∈ X∗ such that q =

q1q2. Then g2 = pmqs1q1pmqs1q1 ≤p pmqsprx. Hence pmqs1q1 ≤p q2q

s−s1−1prx.As m ≥ 2 lg(qs) + 2, q2q

s−s1−1p ≤p pm. This in conjunction with Proposition 2.2yields that q2q

s−s1−1 = pm1 for some m1 ≥ 0. Suppose n ≥ 3. Then qs1q1pmqs1q1 =

qs1q1g ≤p pr−m+m1x. As m ≥ 2 lg(qs) + 2, qs1q1p ≤p pr−m+m1 . That is, there existsz ∈ X+ such that qs1q1pz = pr−m+m1 . By Proposition 2.2, qs1q1 = pm2 for somem2 ≥ 1. This together with q2q

s−s1−1 = pm1 yields that qs = qs1q1q2qs−s1−1 = pm1+m2 ,

which contradicts the fact that p = q. Hence n = 2. Then pmqs1q1pmqs1q1 = g2 =

pmqsprx implies that qs1q1 = pr−m+m1x. Thus qs = pr−m+m1xpm1 . The assertion (ii)holds with s1 = r − m + m1 and s2 = m1.

(4) g = pmqspr1p1 for some r > r1 ≥ 0 and p1 <p p such that pr1p1 = 1. There existsp2 ∈ X+ such that p = p1p2. Then pmqspr1p1p

mqspr1p1 = g2 ≤p pmqsprx impliesp1p1p2p

m−1qspr1p1 ≤p p1p2p1p2pr−r1−2x. Hence p1p2 = p2p1. If p1 = 1, then by

Lemma 2.1 λ(p1) = λ(p2), which contradicts the fact that p1p2 = p ∈ Q. Hencep1 = 1 and g = pmqspr1 where r1 ≥ 1. Then pmqspr1pmqspr1 = g2 ≤p pmqsprx, i.e.qspr1 ≤p pr−r1−mx. Suppose n ≥ 3. Then qspr1pmqspr1 ≤p pr−r1−mx. This togetherwith m ≥ 2 lg(qs) + 2 and either x <p p or x <p qs yields qsp ≤p pr−r1−m. ByProposition 2.2, qs ∈ p+, which contradicts the fact that p, q ∈ Q with p = q. Hencen = 2 and then qspr1 = pr−r1−mx. Consider the following subcases:

(4.1) x <p qs . Since r1 ≥ 1 and x <p qs , r − r1 − m ≥ 1. If lg(qs) ≤ lg(pr−r1−m), then qs =pm1p1 for some m1 ≥ 0 and p1 <p p. By Lemma 2.13, p1 = 1. There exists p2 ∈ X+such that p = p1p2. Then pm1p1p1p2 ≤p pr−r1−mx. As x <p qs = pm1p1 and qspr1 =pr−r1−mx, there exists w ∈ X∗ such that pr−r1−mx = pm1p1p2p1w. This together withpm1p1p1p2 ≤p pr−r1−mx yields p1p2 = p2p1. By Lemma 2.1, λ(p1) = λ(p2), whichcontradicts the fact that p1p2 = p ∈ Q. Hence lg(qs) > lg(pr−r1−m) and so lg(x) >

lg(pr1) ≥ lg(p). This in conjunction with x <p qs <p pr−r1−mx yields p <p x, a contra-diction.

(4.2) x <p p. Then there is p1 ∈ X+ such that p = xp1. Since r1 ≥ 1 and x <p p, r − r1 −m ≥ 1. Then qspr1−1xp1 = qspr1 = pr−r1−mx = pr−r1−m−1xp1x. Hence xp1 = p1x.Note that x, p1 ∈ X+. By Lemma 2.1, λ(x) = λ(p1) which contradicts the fact thatxp1 = p ∈ Q. �

3 THE SELF-INSERTION OF A WORD

Let {a, b} ⊆ X and u = aibs for some i, s ≥ 1. Then for m, n ≥ 0, ambsanbs ∈ u ← u if andonly if m ≥ n and m + n = 2s. But, in general, for u = piqs and pmqspnqs ∈ u ← u with

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 9: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 923

two distinct primitive words p and q, it is not necessarily true that m ≥ n. For example: letp = ab, q = aba and u = p3q = (ab)4a. Then ababa((ab)4a)baba = ab(aba)(ab)5(aba) =pqp5q ∈ u ← u. In this section, we investigate the case of words pmqspnqs in the self-insertion of the word piqs for some i, s ≥ 1, m, n ≥ 0 and p, q ∈ Q with p = q.

LEMMA 3.1 ([7]) Let p, q ∈ Q with p = q. Then piqj (prqj )m ∈ Q for j, m ≥ 1, i ≥ 0and r ≥ 2 with i = r .

LEMMA 3.2 ([10]) Let p, q ∈ Q. If p2 = qkw for some k ≥ 2 and w ≤p q then p = q.

Remark 1 Let u, v ∈ X+. If u2 = vkw for some k ≥ 2 and w ≤p v, then λ(u) = λ(v).

LEMMA 3.3 ([4]) If uv = vw for some u, v, w ∈ X∗ with u = 1, then there exist x, y ∈ X∗and k ≥ 0 such that u = xy, v = x(yx)k and w = yx.

PROPOSITION 3.4 Let p ∈ Q. If pp1 = u2 for some p1 ∈ X+ and u ∈ X+ with p1 <p p, thenthere exist x, y ∈ X+ and i ≥ 0 such that λ(x) = λ(y), p1 = x(yx)i and p = x(yx)i+1xy.

Proof Clearly, lg(u) < lg(p). There exists p2 ∈ X+ such that p = up2 and u = p2p1. Thusp = p2p1p2. As p ∈ Q, λ(p1) = λ(p2). Consider the following cases:

(1) lg(p1) < lg(p2). Then p2 = p1p3 and p = p1p3p1p1p3 for some p3 ∈ X+ with λ(p1) =λ(p3). Let x = p1 and y = p3. Then p = xyxxy and i = 0.

(2) lg(p1) > lg(p2). Then p1 = p2p3 for some p3 ∈ X+ with p3 <p p1. By Lemma 3.3,there exist x, y ∈ X∗ and k ≥ 0 such that p3 = x(yx)k , p2 = xy and p1 = x(yx)k+1.As λ(p1) = λ(p2), x, y ∈ X+ and λ(x) = λ(y). Then p = x(yx)k+2xy and i = k + 1.

(3) lg(p1) = lg(p2). Then p1 = p2, which contradicts the fact that λ(p1) = λ(p2). �

PROPOSITION 3.5 Let p, q ∈ Q, p = q, s ≥ 1 and m, n ≥ 2 lg(qs) + 3. If pmqspnqs ∈u ← u for some u ∈ X+, then m + n is an even number and one of the following statementsholds:

(i) m ≥ n and u = p(m+n)/2qs ,(ii) m > n, qs = p1p

m−n−1 and u = pm−1p2p(m−n)/2 for some p1, p2 ∈ X+ with p3p1 =

p2p3 = p for some p3 ∈ X+,(iii) u = p(m+n)/2qs and qs = ps1p1 for some s1 ≥ 0 and p1 ∈ X+ such that p1 <p p,(iv) qs = ps1xps2 for some x ∈ X+\p+X∗, s1 ≥ 0 and s2 > 0 such that s2 is an even number

and u = pm+s1xps2/2, or(v) n − m = 2i, qs = pn−m+s1p1 and u = p(3n/2)+s1−(m/2)p1 for some i ≥ 1, s1 ≥ 0, and

p1 ∈ X+ with p1 <p p.

Proof Let m, n ≥ 2 lg(qs) + 3 be numbers such that pmqspnqs ∈ u ← u for some u ∈ X+.Clearly, lg(u) = lg(qs) + (1/2) lg(pm+n). Say pmqspnqs = u2

1u22 for some u1, u2 ∈ X∗ such

that u = u1u2.According to the possible locations of u21 in the prefix of pmqspnqs , we consider

the following five cases:

(1) u1 = 1 or u2 = 1. Then pmqspnqs = u2. By Lemma 3.1, pmqspnqs ∈ Q wheneverm = n. Thus m = n. Clearly, m + n is an even number and u = pmqs . Theassertion with statement (i) holds with ((m + n)/2) = m.In the following cases, let u1, u2 ∈ X+.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 10: A note of ins-primitive words

924 H. K. HSIAO et al.

(2) lg(u21) ≤ lg(pm). As p ∈ Q, u2

1 = p. Consider the following subcases:(2.1) lg(p2) ≤ lg(u2

1). By Remark 1, λ(p) = λ(u1). Since p ∈ Q, u1 = pi for somei ≥ 1. As lg(u2

1) ≤ lg(pm), m ≥ 2i. Then u22 = pm−2iqspnqs . By Lemma 3.1,

m − 2i = n. Thus m > n, m + n = 2(i + n) is an even number and u =p(m+n)/2qs . The assertion with statement (i) holds with m > n.

(2.2) lg(p) < lg(u21) < lg(p2). Then u2

1 = pp1 for some p1 ∈ X+ with p1 <p p. ByProposition 3.4, there exist x, y ∈ X+ and k ≥ 0 such that λ(x) = λ(y), p1 =x(yx)k and p = x(yx)k+1xy. Then u2

2 = yxxypm−2qspnqs . By Proposition 2.9,m − 2 < n. Note that lg(u2) = lg(yxqs) + (1/2) lg(pm+n−2). Consider thefollowing subcases:

(2.2.1) m + n is even. Then u2 = yxxypm−2qsp(n−m)/2x(yx)k+1 = xyp(m+n−2)/2qs . Thisyields xy = yx. By Lemma 2.1, λ(x) = λ(y), a contradiction.

(2.2.2) m + n is odd. Then there exist z1, z2 ∈ X+ such that lg(z1) = lg(z2), z1z2 =x(yx)k = p1 and u2 = yxxypm−2qsp(n−m+1)/2z1 = z2yxxyp(m+n−3)/2qs . Let p2 =yxxy, p3 = z1 and p4 = z2yxxy. Then

p1p2 = p = p3p4. (1)

As n > m − 2 and q ∈ Q, note that ((m + n − 3)/2) ≥ m − 2 > 2 lg(qs) ≥ 2.Then p2p1 = yxxyp1 <p yxxyp <p yxxypm−2qsp(n−m+1)/2z1 = u2 and p4p3 =z2yxxyz1 <p z2yxxyp <p z2yxxyp(m+n−3)/2qs = u2. Hence

p2p1 = p4p3. (2)

Then by Lemma 2.7, Eqs. (1) and (2) imply p1 = p3, i.e. z1z2 = z1. Hence z2 = 1,a contradiction.

(2.3) lg(u21) < lg(p). Then p = u2

1p1 for some p1 ∈ X+. Clearly, p1 <s p. Thusu2

2 = p1pm−1qspnqs . By Proposition 2.9, m − 1 < n. Note that lg(u2) = lg(qs) +

(1/2) lg(p1pm+n−1). Consider the following subcases:

(2.3.1) m + n is even. Then

u2 = p1pm−1qsp(n−m)/2u1 = u1p1p

((n+m)/2)−1qs. (3)

As m ≥ 2 lg(qs) + 3, m − 1 > 0. Hence, Eq. (3) implies p1(u1u1p1)pm−2qs

p(n−m)/2u1 = u1p1p((n+m)/2)−1qs . Hence p1u1 = u1p1.As u1 = 1 and p1 = 1, we

have λ(p1) = λ(u1). Hence p = u21p1 /∈ Q, a contradiction.

(2.3.2) m + n is odd. Then there exist z1, z2 ∈ X+ such that p1 = z1z2, lg(z1) = lg(z2)

and

u2 = p1pm−1qsp(n−m−1)/2u2

1z1 = z2p(n+m−1)/2qs. (4)

As n ≥ m ≥ 2 lg(qs) + 3, m − 1 > 0 and ((n + m − 1)/2) > 0. Hence, Eq. (4)implies (z1z2)(u

21p1)p

m−2qsp((n−m−1)/2)u21z1 = z2u

21z1z2p

((n+m−3)/2)qs . This inconjunction with lg(z1) = lg(z2) yields z1 = z2. Then z2u

21 = u2

1z1 = u21z2. As

u1 = 1 and z2 = 1, we have λ(u21) = λ(z2). Then p = u2

1z1z2 = u21z

22 /∈ Q, a

contradiction.(3) lg(pm) < lg(u2

1) ≤ lg(pmqs). As m ≥ 2 lg(qs) + 3, by Lemma 2.3, pmz ∈ Q forany z ∈ X+ with z /∈ p+ and z ≤p qs . Thus u2

1 = pmpi1 for some i1 ≥ 1. Since p

and q are distinct primitive words, qs /∈ p+. There exists q1 ∈ X+\p+ such thatqs = pi1q1 and u2

2 = q1pn+i1q1. Consider the following subcases:

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 11: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 925

(3.1) n + i1 is even. Let i2 = (n + i1)/2. Then u2 = q1pi2 = pi2q1. By Lemma 2.1,

λ(q1) = λ(p). This yields that qs(=pi1q1) and p are powers of a common word,which contradicts the fact that p = q.

(3.2) n + i1 is odd. Let i2 = (n + i1 − 1)/2 and p1, p2 ∈ X+ be such that lg(p1) =lg(p2) and p = p1p2. Then u2 = q1p

i2p1 = p2pi2q1. Since n ≥ 2 lg(qs) + 3,

i2 > lg(q1) + 1. Consider the following subcases:(3.2.1) lg(q1) = lg(p1). Then q1 = p1 = p2, which contradicts the fact that p1p2 =

p ∈ Q.(3.2.2) lg(q1) < lg(p1). There exist q2, q3 ∈ X+ such that p1 = q2q1 and p2 = q1q3. Then

p = q2q1q1q3 and pi2q2 = q3pi2 . Thus, q3q2q1q1q3 <p pi2q2 = q2q1q1q3p

i2−1q2

and q2q1q1q3q2 <s q3pi2 = q3p

i2−1q2q1q1q3. Hence, q3q2q1q1 = q2q1q1q3 andq1q1q3q2 = q2q1q1q3. From Lemma 2.1, we get that λ(q3) = λ(q2q1q1)

and λ(q2) = λ(q1q1q3). This yields that λ(q2q1q1q3) = λ(q2) = λ(q3), whichcontradicts the fact that q2q1q1q3 = p ∈ Q.

(3.2.3) lg(q1) > lg(p1) = lg(p2). Since i2 > lg(q1) + 1, there exists i3 ≥ 0 such thatq1 = p2p

i3p3 for some p3 <p p. Then p = p3p4 for some p4 ∈ X+. Sincep2 ∈ X+ and i2 > lg(q1) + 1, i2 − i3 ≥ 2. Thus p3p3p4 = p3p <p pi2−i3q1 =p3p4p3p4p

i2−i3−2q1 implies p3p4 = p4p3. If p3 = 1, then by Lemma 2.1,λ(p3) = λ(p4), which contradicts the fact that p3p4 = p ∈ Q. Thus p3 = 1 andq1 = p2p

i3 . As lg(q1) > lg(p2), i3 ≥ 1. Since q1pi2p1 = p2p

i2q1, p1p2 = p <s

q1 <s q1pi2p1 = q1p

i2−1p1p2p1. Thus p1p2 = p2p1 with p1 = 1 and p2 = 1.By Lemma 2.1, λ(p1) = λ(p2), which contradicts the fact that p1p2 = p ∈ Q.

(4) lg(pmqs) < lg(u21) ≤ lg(pmqspn). There exists n1 ≥ 0 such that u2

1 = pmqspn1p1

for some p1 <p p. As p = q, by Lemma 2.10, pmqspn1 ∈ Q. Hence p1 = 1.As p1 <p p, p = p1p2 for some p2 ∈ X+. If n1 = 0, i.e. u2

1 = pmqsp1, then byProposition 2.12,qsp1 ∈ p+. Sayqsp1 = pk for some k > 0. Thenu2

2 = p2pn−1qs .

This yields that pn−1qsp2 /∈ Q. As n − 1 ≥ 2 lg(qs) + 2, by Proposition 2.12,qsp2 ∈ p+. Since lg(p1) < lg(p) and lg(p2) < lg(p), qsp1 = qsp2. Thus p1 =p2, which contradicts the fact that p1p2 = p ∈ Q. Hence n1 > 0. In view ofProposition 2.15, we have the following two possible cases:

(4.1) p2qs = pk , where k = m − n1 − 1 > 0. Note that u2

1 = pmqspn1p1 = (pm−1p1)2

andu22 = p2p

n−n1−1qs = (p2p1)n−n1−1p2q

s = (p2p1)n−n1−1pk . Sincep ∈ Q and

p1, p2 ∈ X+, p2p1 ∈ Q by Lemma 2.6. In view of Lemma 2.1, we have p =p2p1. By Lemma 2.4, (p2p1)

n−n1−1pk ∈ Q whenever n − n1 − 1, k ≥ 2. Thusn − n1 − 1 ≤ 1 or k = 1. If n − n1 − 1 = 0 then u2

2 = pk and qs = p3pk−1 for

some p3 ∈ X+ such that p2p3 = p. In this case, u = pm−1p1pk/2 where k = m − n

and p1p2 = p. The assertion with statement (ii) holds. Now consider n − n1 − 1 =1 or k = 1. If n − n1 − 1 = 1 and k = 1, then u2

2 = p2p1p. Hence u2 = p2p1 = p,a contradiction. Consider the case: n − n1 − 1 > 1 and k = 1. If n − n1 − 1 ≥3, then lg(u2) > (n − n1 − 2) lg(p2p1) ≥ lg(p2p1p) by Lemma 2.11. This con-tradicts the fact that u2

2 = (p2p1)n−n1−1pk . Hence n − n1 − 1 = 2. Thus u2

2 =(p2p1)

2p. There exist p3, p4 ∈ X+ with lg(p3) = lg(p4) such that p2p1 = p3p4

and p3p4p3 = p2p1p3 = u2 = p4p. This yields that p3 = p4, which contradictsthe fact that p2p1 ∈ Q. Similarly, the case that n − n1 − 1 = 1 and k > 1 isimpossible.

(4.2) qs = ps1p1ps2 for some s1, s2 ≥ 0 with m + s1 = n1 + s2. Then u2

2 =p2p

n−n1−1qs = p2pn−n1−1+s1p1p

s2 Consider the following subcases:(4.2.1) lg(p2p

n−n1−1+s1) = lg(p1ps2). Then u2 = p2p

n−n1−1+s1 = p1ps2 . This yields

p1 = p2, which contradicts the fact that p1p2 = p ∈ Q.In the following cases, let lg(p2p

n−n1−1+s1) = lg(p1ps2).

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 12: A note of ins-primitive words

926 H. K. HSIAO et al.

(4.2.2) n − n1 − 1 + s1 = s2 = 0. Then u22 = p2p1. By Lemma 2.6, p = p1p2 /∈ Q,

a contradiction.(4.2.3) n − n1 − 1 + s1 = 0 and s2 ≥ 1. Then u2

2 = p2p1ps2 . Thus lg(u2) ≥ lg(p).

Consider the following subcases:(4.2.3.1) s2 is odd. Let i1 = (s2 − 1)/2. Then u2 = p2p1p

i1 = ppi1 = p1p2pi1 . Hence

p2p1 = p1p2. By Lemma 2.1, λ(p1) = λ(p2), which contradicts the fact thatp1p2 = p ∈ Q.

(4.2.3.2) s2 is even. Let i1 = (s2 − 2)/2. Then u2 = p2p1pi1p3 = p4p

i1+1 for some p3,

p4 ∈ X+ with p3p4 = p and lg(p3) = lg(p4). Note that p3 <s p. Hence p3 = p4,which contradicts the fact that p(=p2

3) ∈ Q.(4.2.4) u2

2 = p2pn−n1−1+s1p1p

s2 , n − n1 − 1 + s1 ≥ 1 and s2 = 0. Then lg(u2) ≥ lg(p).Consider the following subcases:

(4.2.4.1) n − n1 − 1 + s1 is odd. Let i1 = (n − n1 − 2 + s1)/2. Then u2 = p2pi1p1.

As u21 = pmqspn1p1 and qs = ps1p1, u2

1 = (pm+s1p1)2. Hence u1u2 =

pmps1p1p2pi1p1 = pm+s1+i1+1p1 = pm+i1+1qs . In this case, m + s1 = n1, 2m +

2i1 + 2 = m + (m + 2i1 + 2) = m + (m + n − n1 − 2 + s1) + 2 = m + n. Theassertion with statement (iii) holds.

(4.2.4.2) n − n1 − 1 + s1 is even. Let i1 = (n − n1 − 1 + s1)/2. Then i1 ≥ 1. Consider thefollowing subcases:

(4.2.4.2.1) lg(p2) > lg(p1). There exist p3, p4 ∈ X+ such that u2 = p2pi1−1p3 = p4p

i1p1

with lg(p4) = (1/2)(lg(p2) − lg(p1)), lg(p2p3) = lg(p4pp1), and p3p4 = p.lg(p2p3) = lg(p4pp1) implies lg(p3) > lg(p1) and so p1 <p p3 (≤pp

i1−1p3).In addition, p3 <p p ≤p pi1p1. Then p2p1 <p p2p

i1−1p3 = u2 and p4p3 <p

p2pi1−1p3 = u2. Hence p2p1 = p4p3. As p1p2 = p = p3p4 and p1, p2, p3,

p4 ∈ X+, by Lemma 2.7, p1 = p3 and p2 = p4, which contradicts the fact thatlg(p4) = (1/2)(lg(p2) − lg(p1)).

(4.2.4.2.2) lg(p2) = lg(p1). Then u2 = p2pi1 = pi1p1, i.e., p2p1p2p

i1−1 = p1p2pi1−1p1.

Hence p2 = p1, which contradicts the fact that p1p2 = p ∈ Q.(4.2.4.2.3) lg(p2) < lg(p1). By an analogous argument of (4.2.4.2.1), it leads to a

contradiction.(4.2.5) n − n1 − 1 + s1 ≥ 1 and s2 ≥ 1. Then u2

2 = p2pn−n1−1+s1p1p

s2 , Thus lg(u2) >

lg(p). From (4.2.1), we only need to consider lg(p2pn−n1−1+s1) > lg(p1p

s2)

or lg(p2pn−n1−1+s1) < lg(p1p

s2).(4.2.5.1) lg(p2p

n−n1−1+s1) > lg(p1ps2). Then there exist p3, p4 ∈ X∗ and i1, i2 ≥ 0 such

that u2 = p2pi1p3 = p4p

i2p1ps2 , p = p3p4 and i1 + i2 + 1 = n − n1 − 1 + s1.

If i1 = 0 then u2 = p2p3. This in conjunction with lg(u2) > lg(p) yieldsthat lg(p2p3) = lg(u2) > lg(p) = lg(p3p4), i.e. lg(p2) > lg(p4). As p2 <s p

and p4 <s p, p4 <s p2. Thus p4p3 <s p2p3 = u2. If i1 > 0 then p4p3 <s

p2pi1−1(p3p4)p3 = p2p

i1p3 = u2. Both imply that p4p3 <s u2 = p4pi2p1p

s2 =p4p

i2p1ps2−1(p3p4) as s2 ≥ 1. Hence p4p3 = p3p4. If p3, p4 ∈ X+, then by

Lemma 2.1, λ(p3) = λ(p4), which contradicts the fact that p3p4 = p ∈ Q. Thenp3 = 1 or p4 = 1, that is, u2 = p2p

i3 = pi4p1ps2 for some i3 ≥ s2 ≥ 1 and

i4 ≥ 0 with i3 + i4 = n − n1 − 1 + s1. As lg(p2pn−n1−1+s1) > lg(p1p

s2), i4 ≥ 1.Thus u2 = p2p1p2p

i3−1 = p1p2pi4−1p1p

s2 . Hence p2p1 = p1p2. As p1, p2 ∈X+, by Lemma 2.1, λ(p1) = λ(p2), which contradicts the fact that p1p2 = p ∈ Q.

(4.2.5.2) lg(p2pn−n1−1+s1) < lg(p1p

s2). By an analogous argument of (4.2.5.1), it leads toa contradiction.

(5) lg(pmqspn) < lg(u21) < lg(pmqspnqs). Let u2

1 = pmqspnq1 for some 1 = q1 <p

qs . Then qs = q1u22 and q1 = ps1q2 for some s1 ≥ 0 and q2 ∈ X∗ with q2 /∈

p+X∗. If q2 = 1, then u21 = pmqspn+s1 ∈ Q, a contradiction. Thus q2 = 1. Then

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 13: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 927

u21 = pm+s1q2u

22p

n+s1q2. As p = q, λ(q2u22) = λ(p). From Proposition 2.15, we

have the following two possible cases:(5.1) There is y ∈ X+ such that p = q2y and yq2u

22 = pk where k = m − n − 1 ≥ 1.

Then q2y = p = yq2. By Lemma 2.1, λ(q2) = λ(y), which contradicts the factthat p ∈ Q.

(5.2) q2u22 = ps2q2p

s3 for some s2, s3 ≥ 0 with m + s2 = s3 + n. Consider the followingsubcases:

(5.2.1) s2 = 0. Then u22 = ps3 , u2

1 = pm+s1q2pn+s1+s3q2 with m = n + s3, qs = ps1q2p

s3

and u = pm+s1q2ps3/2. Statement (iv) holds.

(5.2.2) s3 = 0. Then q2u22 = ps2q2. Clearly, s2 ≥ 1.As q2 /∈ p+X∗, q2 <p p. Let p = q2q3

for some q3 ∈ X+. Then u22 = q3p

s2−1q2 = (q3q2)s2 . As p ∈ Q, by Lemma 2.6,

q3q2 ∈ Q. Thus n − m = s2 = 2i for some i ≥ 1. In addition, so u2 = (q3q2)s2/2

and qs = q1u22 = ps1q2(q3q2)

s2 = ps1+s2q2 = pn−m+s1q2. Then u21 = pmqspnq1

= pm+s1+s2q2pn+s1q2 with m + s2 = n and so u = pm+s1+s2q2(q3q2)

(s2/2) =pm+s1+(3s2/2)q2 = p(3n/2)+s1−(m/2)q2. Statement (v) holds.

(5.2.3) s2, s3 ≥ 1. This in conjunction with q2 /∈ p+X∗ yields q2 <p p. Let p = q2p1 forsome p1 ∈ X+. Then u2

2 = (p1q2)s2ps3 . Analogous to the subcase (4.1) of case (4),

we can show that this case is impossible when s2, s3 ≥ 1. �

4 PROPERTIES OF Qins

In Ref. [11], it is shown that for any u ∈ X+, (u+)←(2) is regular if and only if u ∈ a+ for somea ∈ X. On the other hand, it is also shown that Q←(2) and (X+)←(2) are disjunctive. In thissection, we show that sets Qins and Q

←(i)ins for any i ≥ 2 are not only dense but also disjunctive

by showing that (Qins, Q←(i)ins ) is a quasi-disjunctive pair (Proposition 4.3). This is achieved

by using Proposition 4.2 which allows us to construct ins-primitive words by any two distinctwords with same length.

First, from the definition of iterated insertion-operation, we have the following propertiesimmediately.

Remark 2 Let v ∈ u←iand a ∈ X. Then a ≤p u iff a ≤p v, a ≤s u iff a ≤s v. Moreover,

as ≤p u ⇒ as ≤p v and as ≤s u ⇒ as ≤s v.

Remark 3 Let {a, b} ⊆ X, u ∈ X+ and v ∈ u←ifor some i ≥ 1. Then u = yarbs for some

y ∈ X∗\X∗a and r, s ≥ 1 if and only if v = xambn for some x ∈ X∗\X∗a and m, n ≥ 1 withn ≥ s.

PROPOSITION 4.1 Let {a, b} ⊆ X, u = yarbs for some y ∈ X∗\X∗a and r, s ≥ 1 and v =xambn for some x ∈ X∗\X∗a and m, n ≥ 1 with n ≥ s. Then v ∈ u←i

for some i ≥ 1 implies

(1) m ≤ r whenever y = 1,(2) �m/r� ≤ �n/s� whenever y = 1.

Proof Let u = yarbs for some y ∈ X∗\X∗a and r, s ≥ 1, v = xambn for some x ∈ X∗\X∗aand m, n ≥ 1 with n ≥ s, and v ∈ u←i

for some i ≥ 1. If i = 1, then v = u and the assertionholds. Assume that the assertion holds whenever i ≤ I for some I ≥ 1. Let i = I + 1 andw ∈ u←i−1

such that v ∈ w ← u. Then i ≥ 2 and v = w1uw2 for some w1, w2 ∈ X∗ withw1w2 = w. Consider the following cases.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 14: A note of ins-primitive words

928 H. K. HSIAO et al.

(1) y = 1. If w2 = bk for some k ≥ 0, then yarbs+k ≤s v. This yields m = r . If w2 = w3ajbk

for some j, k ≥ 1 and w3 ∈ X∗\X∗a, then j = m and k = n. By assumption, m = j ≤ r .(2) y = 1. If w2 = bk for some k ≥ 0, then yarbs+k ≤s v, m = r and n = s + k. Thus

�m/r� = �r/r� = 1 ≤ �(s + k)/s� = �n/s�. If w2 = w3ajbk for some j, k ≥ 1 and

w3 ∈ X∗\X∗a, then j = m and k = n. By assumption, �m/r� = �j/r� ≤ �k/s� = �n/s�.

By mathematical induction, the assertion holds. �

Let X = {a, b}, u = a and v = b. By virtue of Remark 3 and Proposition 4.1, it is notdifficult to show that uba8b = aba8b ∈ Qins, vba8b = bba8b ∈ Qins and uba8b(vba8b)k =aba8b(bba8b)k ∈ Qins for any k ≥ 1. The general case is shown as the following proposition.

PROPOSITION 4.2 Let {a, b} ⊆ X and lg(u) = lg(v) = n ≥ 1 for two distinct wordsu, v ∈ X∗. If m > 2(n + 2) is an integer such that m + n + 2 is a prime number, thenubamb(vbamb)k ∈ Qins for arbitrary nonnegative integer k.

Proof Let x = ubamb(vbamb)k = u(bambv)kbamb, where m is an integer greater than2(n + 2) such that m + n + 2 is a prime number. We want to show that x ∈ Qins. Supposeon the contrary that x ∈ w←i

for some w ∈ Qins, k ≥ 0 and i ≥ 2. Then x = w1ww2 andw1w2 ∈ w←i−1

for some w1, w2 ∈ X∗. In view of Remark 3, we have w = yarb for somey ∈ X∗\X∗a and r ≥ 1. By Proposition 4.1, r > m/2 > n + 2 whenever y is the empty word.In this case, we get an+1 <p ar <p x. This in conjunction with ub <p x and lg(u) = n yieldsan+1 = ub, which leads to a contradiction. Thus y ∈ X+. One may apply Proposition 4.1 againto obtain r ≥ m. Since ar is a subword of x, we get r = m. Now, we assume that y ∈ X∗c forsome c ∈ X\{a, b}. Then camb is a subword of x, which is not possible. Hence y = y1b for somey1 ∈ X∗. Note that x ∈ y1bamb←i

and i ≥ 2. This together with lg(u) = n < m yields k ≥ 1and so ubamb ∈ Qins. By observing w as a subword of x (∈ w←i

), there exists z ≤s ambv

or z ≤s u such that w = zbamb(vbamb)j for some j < k. In view of x ∈ w←i, we have

lg(x) = i lg(w) which yields (k + 1)(m + n + 2) = i(t + m + 2 + j (m + n + 2)), where t =lg(z). This in conjunction with 2 ≤ i ≤ k + 1 and the fact that m + n + 2 is a prime numberyields that (k + 1)/i is an integer. Let s = (k + 1)/i. Then t + m + 2 = (s − j)(n + m + 2).This together with t = lg(z) ≤ m + n + 1 yields t = n. Note that z ≤s ambv or z ≤s u.It follows that z = v or z = u. Since x ∈ w←i

, one may extract w from x repeatedly to getu = v eventually. This contradiction completes the proof. �

A pair (L1, L2) of two disjoint languages L1 and L2 is said to be a quasi-disjunctive pair iffor any two distinct words u and v with lg(u) = lg(v), there exist x, y ∈ X∗ such that xuy ∈ L1

and xvy ∈ L2 or vice versa.

PROPOSITION 4.3 (Qins, Q←(i)ins ) is a quasi-disjunctive pair for any i ≥ 2.

Proof Let {a, b} ⊆ X and u and v be two distinct words in X∗ with lg(u) = lg(v) = n forsome n ≥ 1. In view of Proposition 4.2, there exists m > 2(n + 2) such that ubamb(vbamb)k ∈Qins, whereas vbamb(vbamb)k ∈ Q

←(k+1)ins for any k ≥ 1. Thus (Qins, Q

←(i)ins ) is a quasi-

disjunctive pair for any i ≥ 2. �

In Ref. [6], Reis and Shyr showed that a language L is disjunctive if and only if for anytwo distinct words u and v with the same length, u ≡ v(PL). This yields that (L1, L2) beinga quasi-disjunctive pair implies that both L1 and L2 are disjunctive languages. Therefore,Proposition 4.3 also shows that Qins and Q

←(i)ins are disjunctive.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 15: A note of ins-primitive words

PRIMITIVE WORDS INSERTION 929

By definition, Qins ⊆ Q. The set Q\Qins is infinite. For example, let {a, b} ⊆ X. Thenanbn ∈ Q ∩ ab←n

for any n ≥ 1. Thus {anbn | n ≥ 2} ⊆ Q\Qins. Furthermore, we show thatQ\Qins is dense.

PROPOSITION 4.4 Q\Qins is dense.

Proof Let {a, b} ⊆ X. For any w ∈ X∗, clearly, λ(wb) = λ(a). By Lemma 2.4, (wb)2a2 ∈Q. This together with (wb)2a2 ∈ wba←2

implies that (wb)2a2 ∈ Q\Qins. Thus, (Q\Qins) ∩X∗wX∗ = ∅ for any w ∈ X∗. �

Acknowledgement

This paper was supported by the National Science Council R.O.C. under Grant NSC 91-2115-M-005-004.

References

[1] Gusfield, D. (1997). Algorithms on Strings, Trees, and Sequences. Cambridge University Press.[2] Kari, L. and Thierrin, G. (1998). Words insertions and primitivity. Utilitas Math., 53, 49–61.[3] Hopcroft, J. E. and Ullman, J. D. (1969). Formal Languages and Their Relation to Automata. Addison-Wesley

Pub. Company.[4] Lyndon, R. C. and Schutzenberger, M. P. (1962). The equation aM = bNcP in a free group. Mich. Math. J., 9,

289–298.[5] Hsiao, H. K., Huang, C. C. and Yu, S. S. (2002). Word operation closure and primitivity of languages. JUCS,

8(2), 243–256.[6] Reis, C. M. and Shyr, H. J. (1978). Some properties of disjunctive languages on a free monoid. Inf. Control,

37(3), 334–344.[7] Shyr, H. J. andYu, S. S. (1994). Non-primitive words in the language p+q+. Soochow J. Math., 24(4), 535–546.[8] Shyr, H. J. and Thierrin, G. (1977). Disjunctive languages and codes. Fundamentals of Computation Theory,

Proceedings of the 1977 Inter. FCT-Conference, Poznan, Poland, Lecture Notes in Computer Science. Vol. 56,Springer-Verlag, pp. 171–176.

[9] Yu, S. S. (2000). Palindrome words and reverse closed languages. Int. J. Comput. Math., 75, 389–402.[10] Chu, D. D. and Town, T. S. (1978). Another proof on a theorem of Lyndon and Schutzenberger in a free monoid.

Soochow J. Math., 4, 143–146.[11] Hsiao, H. K., Yu, S. S. and Zhao, Y. K. (2004). Word-paired insertions of languages, Int. J. Comput. Math., 81,

169–181.

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14

Page 16: A note of ins-primitive words

Dow

nloa

ded

by [

Flor

ida

Inte

rnat

iona

l Uni

vers

ity]

at 0

9:28

19

Dec

embe

r 20

14