An isoperimetric inequality for word overlap
Let $A$ and $B$ be sets of words of length $n$ over some finite alphabet. Suppose that no suffix of a word in $A$ coincides with a prefix of a word in $B$. Then we show that the product of densities of $A$ and $B$ is upper bounded by $(1+o(1))/(en)$.…
Authors: Dmitrii Zakharov
AN ISOPERIMETRIC INEQUALITY F OR W ORD O VERLAP DMITRI I ZAKHAR OV Abstract. Let A and B b e sets of words of length n o ver some finite alphab et. Supp ose that no suffix of a w ord in A coincides with a prefix of a word in B . Then w e show that the product of densities of A and B is upper bounded by 1 /n . This bound is sharp up to a factor of e . 1. Introduction Let Ω be a finite set and let n ⩾ 2. Let µ = µ n b e the uniform probability measure on Ω n . W e sa y that an ordered pair of words ( w, u ) ∈ Ω n × Ω n overlaps if a final segmen t of w coincides with an initial segment of u . That is, if we denote w = ( w 1 , . . . , w n ), u = ( u 1 , . . . , u n ) then for some j ∈ { 1 , . . . , n } we ha v e ( w n − j +1 , . . . , w n ) = ( u 1 , . . . , u j ). Note that w e in particular allo w u = w . W e are in terested in the follo wing extremal question: supp ose that A, B ⊂ Ω n are sets of w ords suc h that no tw o w ords w ∈ A and u ∈ B o v erlap. F or what pairs of densities α, β ∈ (0 , 1) is it possible to ha v e µ ( A ) ⩾ α and µ ( B ) ⩾ β ? There is a related question ab out non-ov erlapping co des (also known as ‘cross-bifix-free’ co des) that has b een extensively studied in the computer science literature [2, 3, 4, 8, 9]. In our notation, the question is to determine the size of a largest co de A ⊂ Ω n suc h that no t w o distinct wor ds in A ov erlap (see [4] for an asymptotically sharp construction). So the question we consider can be though t of as a bipartite v arian t of this and, to the b est of our kno wledge, it has not been studied b efore. Define the shift map s = s n : Ω n → Ω n − 1 b y s ( w 1 , . . . , w n ) = ( w 2 , . . . , w n ) . F or a subset A ⊂ Ω n w e can define the set of w ords which do not o v erlap with A as follo ws: U = U ( A ) = Ω n \ n − 1 [ j =0 s j ( A ) × Ω j . It is easy to see that U ( A ) is precisely the set of all u such that the pair ( w , u ) does not o v erlap for all w ∈ A . Let γ ( α, n ) b e the largest p ossible measure of the set U ( A ) o ver all A ⊂ Ω n of measure α and all finite sets Ω. Here we consider the uniform measure on the space Ω n . Note that if A ⊂ A ′ then w e ha ve the inclusion U ( A ′ ) ⊂ U ( A ). This means that γ ( α, n ) is a monotone decreasing function in α . F or example, it is an easy exercise to sho w that γ ( α, 2) = max { (1 − α ) 2 , 1 − α 1 / 2 } holds for an y α ∈ (0 , 1). Our result is the follo wing estimate. Theorem 1.1. We have γ ( α , n ) ⩽ (1 − α )(1 − (1 − α ) n ) αn for al l n ⩾ 1 and α ∈ (0 , 1) . 1 2 DMITRII ZAKHARO V So if we hav e a pair of non-ov erlapping sets A, B ⊂ Ω n with densities α and β then we ha v e αβ n ⩽ (1 − α )(1 − (1 − α ) n ) ⩽ 1. The pro of of Theorem 1.1 is presented in the next section. The rough idea is to split the set Ω n \ U ( A ) into sev eral disjoint pieces and use inclusion-exclusion to lo w er bound the size of eac h piece. This then giv es a certain recursive relationship b et w een v arious densities asso ciated with A and U ( A ) and their shifts. This relationship can b e in terpreted in terms of a certain random w alk leading to the desired estimate. W e close this section b y considering some examples essen tially matc hing the upp er bound in Theorem 1.1. Let S ⊂ Ω be an arbitrary subset. Then for A = S n one can chec k that U ( A ) = (Ω \ S ) × Ω n − 1 and so we get µ ( U ( A )) = 1 − α 1 /n = log(1 /α ) n + O log 2 (1 /α ) n 2 . This is a goo d bound for α ∈ (1 / 2 , 1). Similarly , for A = Ω n − 1 × S one can c hec k that U ( A ) = (Ω \ S ) n so that we get µ ( U ( A )) = (1 − α ) n . This is a goo d bound for α ∈ (0 , 1 /n ). W e can in terp olate b etw een these tw o examples by taking A = Ω n − k × S k for some 1 ⩽ k ⩽ n . Then the set U = U ( A ) is given b y U = { ( w 1 , . . . , w n ) : w 1 ∈ S, { w j +1 , . . . , w j + k } ⊂ S, j = 0 , . . . , n − k } . The exact form ula for µ ( U ) is a bit complicated (it in v olves generalized Fibonacci num b ers, see [4]) but w e can use a simple P oisson appro ximation inequality due to [1] (see also [5, 6, 7]) to get a go o d estimate of the measure of U . Denote p = | S | / | Ω | so that α = p k . Let Z 1 , . . . , Z n − 1 ∼ Ber( p ) b e iid Bernoulli random v ariables. Let R n − 1 b e the length of the longest run of 1-s in the sequence ( Z 1 , . . . , Z n − 1 ). The measure of U can then b e computed in terms of R n − 1 : µ ( U ) = (1 − p ) Pr[ R n − 1 < k ] . Indeed, w e can view w 2 , . . . , w n ∈ Ω as iid v ariables uniformly distributed on Ω and select Z i = 1 w i +1 ∈ S . By [1, Example 3] w e hav e the follo wing estimate on this probability: Pr[ R n − 1 < k ] − e − λ ⩽ λ (2 k + 1) n − 1 + 2 p k , λ = p k (( n − 2)(1 − p ) + 1) Let k = [ nα log (1 /α )]. Then for 1 /n ≪ α ≪ 1 w e ha v e p = α 1 /k = e − log(1 /α ) k = 1 − 1+ o (1) nα . This gives λ = 1 + o (1) and Pr[ R n − 1 < k ] = e − 1 + o (1) and so we ha v e µ ( U ) = e − 1 + o (1) αn , where o (1) tends to zero as min( α − 1 , nα ) → ∞ . This matc hes the b ound in Theorem 1.1 for all α ∈ (1 /n, 1 / 2) up to a constant factor. AN ISOPERIMETRIC INEQUALITY F OR WORD OVERLAP 3 2. Proof of Theorem 1.1 and a corollar y W e will rep eatedly use the follo wing simple observ ation. F or A ⊂ Ω n , r ⩽ n and w ∈ Ω r w e denote A ( w ) = { u ∈ Ω n − r : ( w, u ) ∈ A } . Observ ation 2.1. L et A ⊂ Ω n and B ⊂ Ω r for some r ⩽ n . Then we have µ ( A ∩ ( B × Ω n − r )) ⩽ λµ ( B ) , wher e λ = max w ∈ Ω r µ ( A ( w )) . Indeed, we simply apply the definition of λ for eac h w ∈ B and sum o ver. F or j ⩽ n denote A j = s n − j ( A ) ⊂ Ω j and let α j = µ ( A j ), j = 1 , . . . , n . F or 1 ⩽ r ⩽ j − 1 define λ j,r = max w ∈ Ω r µ ( A j ( w )) . Note that for an y w ∈ Ω r w e hav e A j ( w ) ⊂ s r ( A j ) = A j − r . This implies that α j − r ⩾ λ j,r . Denote B j = j [ i =1 A i × Ω j − i ⊂ Ω j and denote β j = µ ( B j ). By the definition of U it follows that B j = Ω j \ U ( A j ). W e trivially hav e β 1 = α 1 . Since A j = s ( A j +1 ), w e ha v e the inclusion A j +1 ⊂ Ω × A j . W e ha v e B j +1 = ( B j × Ω) ∪ A j +1 and, in particular B j × Ω ⊂ B j +1 . T ogether these observ ations imply the following c hain of inequalities: β n ⩾ . . . ⩾ β 1 = α 1 ⩾ . . . ⩾ α n . No w let us define sets D j as follows: D j = A j \ ( B j − 1 × Ω) = B j \ ( B j − 1 × Ω) , where for j = 1 we put D 1 = A 1 = B 1 . In particular, since B j − 1 × Ω ⊂ B j , w e can write B j as a disjoint union ( B j − 1 × Ω) ⊔ D j and µ ( D j ) = β j − β j − 1 for all j = 1 , . . . , n (where we set β 0 = 0). Note that we can write B j = D j ⊔ ( B j − 1 × Ω) = D j ⊔ ( D j − 1 × Ω) ⊔ ( B j − 2 × Ω 2 ) = . . . = D j ⊔ ( D j − 1 × Ω) ⊔ ( D j − 2 × Ω 2 ) ⊔ . . . ⊔ ( D 1 × Ω j − 1 ) = A j ∪ ( D j − 1 × Ω) ⊔ ( D j − 2 × Ω 2 ) ⊔ . . . ⊔ ( D 1 × Ω j − 1 ) . Using Observ ation 2.1, w e ha ve the follo wing b ounds for i = 1 , . . . , j − 1: µ ( A j ∩ ( D i × Ω j − i )) ⩽ λ j,i · µ ( D i ) ⩽ α j − i · µ ( D i ) So since sets D i × Ω j − i are pairwise disjoint, w e obtain µ ( B j ) = µ ( A j ) + j − 1 X i =1 µ ( D i × Ω j − i \ A j ) ⩾ µ ( A j ) + j − 1 X i =1 (1 − α j − i ) µ ( D i ) giving the following relation b etw een α -s and β -s: (1) β j ⩾ α j + j − 1 X i =1 (1 − α j − i )( β i − β i − 1 ) . 4 DMITRII ZAKHARO V Denote γ i = 1 − β i = µ ( U ( A i )) and let δ i = α i − 1 − α i for i = 1 , . . . , n where we put α 0 = 1 and γ 0 = 1. Then (1) can be rewritten as follo ws: (2) γ j ⩽ j − 1 X i =0 γ i δ j − i . W e also hav e the follo wing information ab out γ i , δ i : γ n ⩽ γ n − 1 ⩽ . . . ⩽ γ 1 ⩽ γ 0 = 1 , δ 1 + . . . + δ n = 1 − α, δ i ⩾ 0 , i = 1 , . . . , n. W e will use these prop erties to upp er b ound γ n . The idea is to use (2) to compare γ with a random walk on Z . Let p i = δ i 1 − α and let Z b e the random v ariable supp orted on { 1 , . . . , n } given b y the follo wing distribution: Pr[ Z = i ] = p i . Let Z 1 , . . . , Z n b e i.i.d. copies of Z . Observ ation 2.2. F or every j = 0 , . . . , n we have the fol lowing: (3) γ j ⩽ n X s =0 (1 − α ) s Pr[ Z 1 + . . . + Z s = j ] . Pr o of. W e pro v e this by induction on j . The base case j = 0 is clear since only s = 0 term con tributes. Now for j ⩾ 1 we ha ve b y (2): γ j ⩽ j − 1 X i =0 γ i δ j − i = (1 − α ) j − 1 X i =0 γ i p j − i ⩽ (1 − α ) j − 1 X i =0 X s ⩾ 0 (1 − α ) s Pr[ Z 1 + . . . + Z s = i ] Pr[ Z s +1 = j − i ] = X s ⩾ 0 (1 − α ) s Pr[ Z 1 + . . . + Z s = j ] . 2 So we are lead to estimating the righ t hand side of (3). Summing this inequality o v er all j giv es γ 1 + . . . + γ n ⩽ X s ⩾ 0 (1 − α ) s Pr[1 ⩽ Z 1 + . . . + Z s ⩽ n ] ⩽ n X s =1 (1 − α ) s = (1 − α ) 1 − (1 − α ) n α . No w recalling the monotonicit y γ n ⩽ . . . ⩽ γ 1 , we conclude that γ n ⩽ γ 1 + ... + γ n n ⩽ (1 − α )(1 − (1 − α ) n ) αn holds. This completes the proof. W e ha v e the follo wing corollary of Theorem 1.1, whic h gives a ‘small level set’ estimate for the union of shift sets s j ( A ) × Ω n − j . AN ISOPERIMETRIC INEQUALITY F OR WORD OVERLAP 5 Corollary 2.3. L et A ⊂ Ω n b e a set of me asur e α ∈ (0 , 1) . F or w ∈ Ω n define f ( w ) to b e the numb er of indic es j ∈ { 0 , . . . , n − 1 } such that w ∈ s j ( A ) × Ω j . Then for every inte ger t ∈ [1 , n/ 4] we have the fol lowing level set estimate on f : (4) µ ( { w ∈ Ω n : f ( w ) ⩽ t } ) ⩽ 8 t αn . F or example, by taking t = αn/ 16 and assuming that α ⩾ 1 /n , we obtain that at least half of elemen ts w ∈ Ω n is co vered by at least α n/ 16 man y sets of the form s j ( A ) × Ω j . T aking t = 1 on the other hand recov ers Theorem 1.1 in the range α ∈ (1 /n, 1 / 2), alb eit with a constan t factor loss. Pr o of. If t ⩾ αn/ 2 then there is nothing to prov e, so w e may assume t ⩽ αn/ 2 holds. Let ˜ n = [ n/ 2 t ] and r = n − 2 t ˜ n . By the assumption on t we hav e ˜ n ⩾ 1. Consider a new alphab et ˜ Ω = Ω 2 t and let ˜ s = ˜ s j : ˜ Ω j → ˜ Ω j − 1 denote the shift map defined on w ords ov er the alphab et ˜ Ω. By identifying ˜ Ω j = Ω 2 tj , we get that ˜ s = s 2 t . F or i = 0 , . . . , 2 t − 1 let ˜ A i = s r + i ( A ) × Ω i ⊂ Ω 2 t ˜ n = ˜ Ω ˜ n . Note that µ ( ˜ A i ) ⩾ µ ( A ) = α for i = 0 , . . . , 2 t − 1. F or an arbitrary subset ˜ A ⊂ ˜ Ω ˜ n w e denote ˜ U ( ˜ A ) = ˜ Ω ˜ n \ S ˜ n − 1 j =0 ˜ s j ( ˜ A ) × ˜ Ω j , that is the analogue of U ( A ) ov er the new alphab et. Let w ∈ Ω n and denote ˜ w = s r ( w ) ∈ ˜ Ω ˜ n . Note that we hav e ˜ w ∈ ˜ U ( ˜ A i ) precisely when there exists j ∈ { 0 , . . . , ˜ n − 1 } such that ˜ w ∈ ˜ s j ( ˜ A i ) × ˜ Ω j . The latter is in turn equiv alen t to w ∈ s 2 tj + i + r ( A ). It follows that w e hav e # { i ∈ { 0 , . . . , 2 t − 1 } : ˜ w ∈ ˜ U ( ˜ A i ) } ⩽ # { i ∈ { 0 , . . . , n − 1 } : w ∈ s i ( A ) × Ω i } = f ( w ) Th us, if f ( w ) ⩽ t then there are at least 2 t − t = t indices i ∈ { 0 , . . . , 2 t − 1 } suc h that ˜ w ∈ ˜ U ( ˜ A i ). So by the union b ound and Theorem 1.1 applied to each ˜ U ( ˜ A i ) we ha ve tµ ( { w : f ( w ) ⩽ t } ) ⩽ 2 t − 1 X i =0 µ ( ˜ U ( ˜ A i )) ⩽ 2 t (1 − α )(1 − (1 − α ) ˜ n ) α ˜ n ⩽ 2 t α ˜ n . So recalling that ˜ n = [ n/ 2 t ] we get µ ( { w : f ( w ) ⩽ t } ) ⩽ 2 α [ n/ 2 t ] ⩽ 8 t αn pro vided that n ⩾ 4 t , concluding the proof. 2 References [1] Ric hard Arratia, Larry Goldstein, and Louis Gordon, Two moments suffic e for p oisson appr oximations: the chen-stein metho d , The Annals of Probability (1989), 9–25. [2] An tonio Bernini, Stefano Bilotta, Renzo Pinzani, and Vincent V a jnovszki, A gr ay c o de for cr oss-bifix-fr e e sets , Mathematical Structures in Computer Science 27 (2017), 184–196. [3] Simon R Blackburn, Non-overlapping c o des , IEEE T ransactions on Information Theory 61 (2015), 4890– 4894. [4] Y eo w Meng Chee, Han Mao Kiah, Punarbasu Purk a yastha, and Chengmin W ang, Cr oss-bifix-fr e e c o des within a c onstant factor of optimality , IEEE T ransactions on Information Theory 59 (2013), 4668–4674. [5] Anan t P Godb ole, Poisson appr oximations for runs and p atterns of r ar e events , Adv ances in applied probabilit y 23 (1991), 851–865. 6 DMITRII ZAKHARO V [6] Anan t P Go db ole and Andrew A Schaffner, Impr ove d p oisson appr oximations for wor d p atterns , Adv ances in applied probabilit y 25 (1993), 334–347. [7] LJ Guibas and AM Odlyzk o, L ong r ep etitive p atterns in r andom se quenc es , Zeitschrift f ¨ ur W ahrschein- lic hkeitstheorie und verw andte Gebiete 53 (1980), 241–262. [8] VI Levensh tein, De c o ding automata, invariant with r esp e ct to the initial state. problemy kib ernet. 12 (1964), 125-136 . [9] Lidija Stano vnik, Miha Mo ˇ sk on, and Miha Mraz, In sear ch of maximum non-overlapping c o des , Designs, co des and cryptograph y 92 (2024), 1299–1326. Dep ar tment of Ma thema tics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA Email addr ess : zakhdm@mit.edu
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment