FINITE AUTOMATA AND OPERATIONAL COMPLEXITY dissertation thesis

Veľkosť: px
Začať zobrazovať zo stránky:

Download "FINITE AUTOMATA AND OPERATIONAL COMPLEXITY dissertation thesis"

Prepis

1 COMENIUS UNIVERSITY IN BRATISLAVA FACULTY OF MATHEMATICS, PHYSICS AND INFORMATICS FINITE AUTOMATA AND OPERATIONAL COMPLEXITY disserttion thesis 2020 Mgr. Ivn Krjňáková

2 COMENIUS UNIVERSITY IN BRATISLAVA FACULTY OF MATHEMATICS, PHYSICS AND INFORMATICS FINITE AUTOMATA AND OPERATIONAL COMPLEXITY disserttion thesis Study progrmme: Field of study: Supervising institution: Supervisor: Applied mthemtics Applied mthemtics Mthemticl Institute, Slovk Acdemy of Sciences RNDr. Glin Jirásková, CSc. Brtislv, 2020 Mgr. Ivn Krjňáková

3 UNIVERZITA KOMENSKÉHO V BRATISLAVE FAKULTA MATEMATIKY, FYZIKY A INFORMATIKY KONEČNÉ AUTOMATY A OPERAČNÁ ZLOŽITOSŤ dizertčná prác Študijný progrm: Študijný odor: Školice prcovisko: Školiteľ: Aplikovná mtemtik Aplikovná mtemtik Mtemtický ústv Slovenskej kdémie vied RNDr. Glin Jirásková, CSc. Brtislv, 2020 Mgr. Ivn Krjňáková

4 Comenius University in Brtislv Fculty of Mthemtics, Physics nd Informtics THESIS ASSIGNMENT Nme nd Surnme: Study progrmme: Field of Study: Type of Thesis: Lnguge of Thesis: Secondry lnguge: Mgr. Ivn Krjňáková Applied Mthemtics (Single degree study, Ph.D. III. deg., full time form) Mthemtics Disserttion thesis English Slovk Title: Annottion: Aim: Finite utomt nd opertionl complexity We study the stte complexity of the squre opertion on lnguges represented y deterministic finite utomt with more thn one finl sttes. As result, we get the exct complexity of this opertion on Boolen nd lternting finite utomt. Using known result concerning the reltion etween the size of Boolen utomton for given lnguge nd deterministic utomton for its reversl, we get the complexity of complementtion, difference, symmetric difference, conctention, str, reversl, nd left nd right quotients on Boolen nd lternting finite utomt. We lso otin the complexity of these opertions ssuming tht the opernds re given y nondeterministic utomt while the result is required to e represented y deterministic finite utomton. 1) Provide the stte-of-the-rt concerning the complexity of opertions on lnguges represented y different models of finite utomt 2) Study in detil the stte complexity of the squre opertion on lnguges represented y deterministic finite utomt with more thn one finl sttes nd use these results to get the tightness of known upper ounds on the complexity of the squre opertion on Boolen nd lternting finite utomt 3) Find the complexity of ll sic regulr opertions on lnguges represented y Boolen nd lternting finite utomt. 4) Exmine the NFA-to-DFA trde-offs for sic regulr opertions; here we ssume tht the opernds of n opertion re represented y nondeterministic finite utomton while the result of the opertion is represented y deterministic utomton. Keywords: Tutor: Deprtment: Hed of deprtment: 5) To get ll lower ounds, descrie witness lnguges over n optiml, or t lest over s smll s possile, input lphet. regulr lnguges, regulr opertion, finite utomt, stte complexity RNDr. Glin Jirásková, CSc. FMFI.KAMŠ - Deprtment of Applied Mthemtics nd Sttistics prof. RNDr. Mrek Fil, DrSc.

5 Comenius University in Brtislv Fculty of Mthemtics, Physics nd Informtics Assigned: Approved: prof. RNDr. Antolij Dvurečenskij, DrSc. Gurntor of Study Progrmme Student Tutor

6 Univerzit Komenského v Brtislve Fkult mtemtiky, fyziky informtiky ZADANIE ZÁVEREČNEJ PRÁCE Meno priezvisko študent: Študijný progrm: Študijný odor: Typ záverečnej práce: Jzyk záverečnej práce: Sekundárny jzyk: Mgr. Ivn Krjňáková plikovná mtemtik (Jednoodorové štúdium, doktorndské III. st., denná form) mtemtik dizertčná nglický slovenský Názov: Anotáci: Cieľ: Finite utomt nd opertionl complexity Konečné utomty operčná zložitosť Študujeme stvovú zložitosť operácie štvorec n jzykoch reprezentovných deterministickými konečnými utomtmi s vicerými koncovými stvmi. Ako dôsledok dostávme presnú zložitost tejto operácie n Boleovských lternujúcich konečných utomtoch. Využitím známeho výsledku popisujúceho vzťh medzi veľkosťou Booleovského utomtu pre dný jzyk deterministického utomtu pre jeho zrkdlový orz, dostávme zložitosť operácií doplnok, rozdiel, symetrický rozdiel, zreťzenie, uzáver, zrkdlový orz, lvý prvý kvocient n Booleovských lternujúcich utomtoch. Pre tieto operácie zistíme j ich zložitosť z predpokldu že operndy sú reprezentovné nedeterministickými utomtmi výsledok deterministickým utomtom. 1) Zhrnúť súčsný stv prolemtiky v olsti zložitosti operácií n jzykoch reprezentovných rôznymi modelmi konečných utomtov. 2) Detilne preskúmť zložitosť operácie štvorec n jzykoch reprezentovných deterministickými utomtmi s vicerými koncovými stvmi tieto výsledky využiť n získnie presnej zložitosti tejto operácie n Booleovských lternujúcich utomtoch. 3) Zistiť zložitosť všetkých zákldných regulárnych operácií n Booleovských lternujúcich utomtoch. 4) Študovť zložitosť regulárnych operácií z predpokldu ze operndy sú dné nedeterministickým utomtom, všk poždujeme y výsledok ol popísný deterministickým utomtom. 5) Pri všetkých dolných odhdoch s snžiť o použitie optimálnej, leo spoň čo njmenšej, vstupnej ecedy. Kľúčové slová: Školiteľ: regulárne jzyky, regulárne operácie, konečné utomty, stvová zložitosť RNDr. Glin Jirásková, CSc.

7 Univerzit Komenského v Brtislve Fkult mtemtiky, fyziky informtiky Ktedr: Vedúci ktedry: Dátum zdni: FMFI.KAMŠ - Ktedr plikovnej mtemtiky šttistiky prof. RNDr. Mrek Fil, DrSc. Dátum schváleni: prof. RNDr. Antolij Dvurečenskij, DrSc. grnt študijného progrmu študent školiteľ

8 Declrtion I herey ttest tht I hve written this disserttion thesis without ny prohiited ssistnce of third prties. I hve cknowledged nd cited ll the sources which hve een used in the thesis. Brtislv, Mgr. Ivn Krjňáková

9 Acknowledgments I would like to thnk my tutor Glin Jirásková for ll the time nd knowledge she gve me. I wnt to thnk my friends nd my collegues from Mthemticl Institute of Slovk Acdemy of Sciences for vlule dvice nd supervision. And I thnk ll the people tht re der to me for their support.

10 Astrct We determine how the stte complexity of the squre opertion depends on the numer of finl sttes in deterministic finite utomt for given lnguge. We use this result to descrie inry witness for the squre opertion on lternting finite utomton tht meets the known upper ound 2 n + n + 1. We lso show tht our witnesses cn e used to prove the tightness of the upper ound 2 m + n + 1 for conctention on lternting utomt which provides n lterntive solution of n open prolem stted y Fellh, Jürgensen, Yu [1990, Constructions for lternting finite utomt, Internt. J. Comput. Mth. 35, ]. Then we consider the stte complexity of some other regulr opertions on lnguges represented y Boolen nd lternting finite utomt. We get the tight upper ounds for complementtion (n in oth models), union, intersection, nd difference (m + n nd m + n + 1), symmetric difference (m + n in oth models), str nd reversl (2 n in oth models), right quotient (2 m nd 2 m + 1), nd left quotient (m nd m + 1). To descrie witness lnguges, we use inry lphet for str, reversl, nd quotients, nd the unry lphet otherwise. We lso show tht the inry lphet is lwys optiml in the sense tht the corresponding upper ounds cnnot e met in the unry cse. Finlly, we consider the complexity of regulr opertions ssuming tht the inputs of n opertion re represented y nondeterministic finite utomt while its result hs to e given s deterministic finite utomton. We otin the tight upper ounds for str (2 n ), complementtion (2 n ), reversl (2 n ), left quotient (2 m ), right quotient (2 m ), union (2 m+n ), symmetric difference (2 m+n ), intersection (2 m+n 2 m 2 n + 2), difference (2 m+n 2 n + 1), nd conctention ( 3 4 2m+n ). To prove tightness, we use ternry lphet for inry Boolen opertions nd conctention, nd we get n symptoticlly tight upper ound 2 m+n for these opertions in the inry cse. Our witnesses for the remining opertions re inry, nd we show tht the inry lphet is lwys optiml. Keywords: regulr lnguges, deterministic nd nondeterministic finite utomt, descriptionl complexity, regulr opertions, squre, Boolen nd lternting finite utomt

11 Astrkt Ukážeme ko závisí stvová zložitosť operácie štvorec od počtu koncových stvov v deterministickom konečnom utomte pre dný jzyk. Tento výsledok použijeme n popísnie inárneho jzyk ťžkého pre operáciu štvorec n lternujúcich utomtoch, ktorý doshuje známy horný odhd 2 n +n+1. Tiež ukážeme, že nše dosvedčujúce jzyky s djú použiť v dôkze tesnosti horného odhdu 2 m +n+1 pre zreťzenie n lternujúcich utomtoch, čo je vlstne lterntívnym riešením otvoreného prolému, ktorý formulovli Fellh, Jürgensen, Yu [1990, Constructions for lternting finite utomt, Internt. J. Comput. Mth. 35, ]. Potom uvžujeme stvovú zložitosť niektorých ďlších regulárnych operácií n jzykoch reprezentovných Booleovskými lternujúcimi konečnými utomtmi. Dostávme tesné horné odhdy pre doplnok (n pre o modely), zjednotenie, prienik, rozdiel (m + n m + n + 1), symetrický rozdiel (m + n pre o modely), str zrkdlový orz (2 n pre o modely), prvý kvocient (2 m 2 m + 1) ľvý kvocient (m m + 1). N popísnie dosvedčujúcich jzykov pre str, zrkdlový orz, ľvý prvý kvocient použivme inárnu ecedu, o ktorej ukážeme, že je optimáln, keďže horné odhdy sú nedosihnuteľné v unárnom prípde. Pre osttné operácie použijeme unárnu ecedu n dosvedčujúce jzyky. Nkoniec s zoeráme zložitosťou regulárnych operácií z predpokldu, že vstupné jzyky su dné ko nedeterministické konečné utomty, kým výsledok má yť popísný ko deterministický konečný utomt. Dostávme tk tesné horné odhdy pre operácie str (2 n ), doplnok (2 n ), zreťzenie (2 n ), zrkdlový orz (2 n ), ľvý kvocient (2 m ), prvý kvocient (2 m ), zjednotenie (2 m+n ), symetrický rozdiel (2 m+n ), prienik (2 m+n 2 m 2 n + 2), rozdiel (2 m+n 2 n +1), zreťzenie ( 3 4 2m+n ). Pre inárne Booleovské operácie zreťzenie sme použili ternárnu ecedu pre dosvedčujúce jzyky. N inárnej ecede všk v tomto prípde dostávme symptoticky tesný horný odhd 2 m+n. Všetky osttné dosvedčujúce jzyky pre zvyšné operácie sú inárne v týchto prípdoch je j inárn eced optimáln. Kľúčové slová: regulárne jzyky, deterministické nedeterministické konečné utomty, popisná zložitosť, regulárne operácie, štvorec, Booleovské lternujúce utomty

12 Contents Introduction 1 1 Preliminries 5 2 Known Results Comined Opertions, Self-verifying nd Unmiguous Automt Boolen nd Alternting Automt Squre on Deterministic, Alternting, nd Boolen Finite Automt Corollry for Conctention Opertions on Boolen nd Alternting Finite Automt 23 5 NFA-to-DFA Trde-Off Str Boolen Opertions Reversl, Left nd Right Quotient Conctention Conclusions Summry nd Future Works 50 v

13 Introduction Finite utomt represent simple computtionl model. Nevertheless, some questions concerning finite utomt remin open. For exmple, it is not known how mny sttes re sufficient nd necessry in the worst cse for two-wy deterministic finite utomton to simulte given two-wy nondeterministic finite utomton. This prolem is interesting per se, nd it is lso importnt due to its connection with well-known open prolem whether or not DLOGSPACE equls NLOGSPACE [2]. In the recent yers, finite utomt, regulr lnguges nd regulr opertions hve een intensively investigted from the descriptionl complexity point of view. Descriptionl complexity mesures the cost of description of lnguges or lnguge opertions y using vrious forml systems such s deterministic, nondeterministic or Boolen utomt, regulr expressions or grmmrs. For exmple, the stte complexity of regulr lnguge is the smllest numer of sttes in ny deterministic finite utomton (DFA) recognizing this lnguge. By the stte complexity of regulr opertion we understnd the function tht ssigns the numer of sttes tht re sufficient nd necessry in the worst cse for DFA recognizing the resulting lnguge to the numer of sttes in DFAs for inputs. The upper ounds on the complexity of severl regulr opertions cn e otined using constructions descried y Rin nd Scott [46]. They lso presented the suset construction tht provides n upper ound 2 n for determiniztion of n n-stte deterministic finite utomton. This upper ound ws shown to e tight y descriing inry witness lnguges in [37, 39, 42, 53]. Binry witnesses for union, conctention nd str were given y Mslov [38], while the unry cse ws considered y Chrok [9]. The pper y Yu, Zhung nd Slom [55] ccelerted thorough study of descriptionl complexity of lnguge opertions. Bsic regulr opertions on unry lnguges were exmined y Pighizzini nd Shlit [45] nd those on finite lnguges y Câmpenu et l. [5]. Some less common opertion were considered in the literture, like shuffle [6], proportionl removls [11], squre [47], cyclic shift [27], power [12]. 1

14 Holzer nd Kutri [14] introduced nd investigted nondeterministic stte complexity to mesure the cost of description when using nondeterministic finite utomt (with unique initil stte). They determined the nondeterministic stte complexity of severl regulr opertions. Their results for reversl nd complementtion were improved in [24]; here the fooling-set lower ound method descried y Birget [3, Lemm 1] ws used to get tight upper ounds nd descrie inry witnesses. In Boolen finite utomton, the result of the trnsition function is Boolen function with the sttes s vriles. This is generliztion of nondeterminism since the set of sttes cn e viewed s disjunction of these sttes. If Boolen utomton strts in single stte, tht is, in Boolen function equl to projection, it is clled n lternting finite utomton [8, 13, 25, 54]. It is known tht every Boolen utomton with n sttes cn e simulted y deterministic utomton with 2 2n sttes [4], nd y nondeterministic utomton with 2 n + 1 sttes [25]. Fellh et l. [13] descried lternting utomt for complementtion, union, intersection, str nd conctention on lnguges represented y lternting utomt. This provided upper ounds on the complexity of these opertions. Those for union, intersection nd conctention were shown to e tight in [17, 25], where lso opertionl complexity for Boolen utomt ws considered. The study of the complexity of comined opertions egn with the pper y Slom et l. [49]. The upper ound for comined opertion is given y the composition of complexities of involved opertions nd is tight in some of the cses, e. g. the cse of str of intersection [28]. However, usully the resulting complexity is much smller [10, 36]. The stte set of self-verifying finite utomton consists of three disjoint set of ccepting, rejecting nd neutrl sttes, nd it is required tht every input word hs t lest one ccepting or rejecting computtion, ut not oth. Assent nd Seiert [1] otined n upper ound O(2 n / n) for the conversion to deterministic utomton. This upper ound ws lter improved to function g(n) 3 n 3 [29] y using the known result y Moon nd Moser [41] on the mximl numer of mximl cliques in grphs. The pper [29] lso presented inry witness meeting the improved upper ound. Jirásek et l. [21] descried so clled sv-fooling set ound method providing lower ound on the numer of sttes in self-verifying utomton. They used this method to get the precise self-verifying stte complexity of ll sic regulr opertions. They descried witnesses for reversl nd Boolen opertions over inry lphet. For str, conctention, nd quotients they used growing lphet of n exponentil size, however they lso proved tht the self-verifying stte complexity of these opertions is lmost the sme in the cse of fixed lphet. 2

15 A nondeterministic finite utomton is clled unmiguous if it hs t most one ccepting computtion on every input word. Amiguity in finite utomt ws first studied y Schmidt in his PhD thesis [50] where lower ound method sed on the rnk of certin mtrices ws descried. It is known tht the tight upper ound for the conversion to DFA is 2 n, nd those from n NFA is 2 n 1 with inry witnesses in oth cses [34, 35]. The lower ound method from [50] ws elorted y Jirásek et l. [23, 22]. They showed tht lower ound on the numer of sttes in n unmiguous utomton equivlent to n NFA is given y the rnk of the mtrix whose rows re indexed y its rechle sets of nd columns y its co-rechle sets, nd its entry is 0 if the corresponding sets re disjoint nd it is 1 otherwise. Using this lower ound method, the uthors otined the precise unmiguous stte complexity of intersection, str, conctention, nd quotients. They lso decresed the trivil upper ound 2 n for complementtion to O(2 0.79n ). Recently, Rskin [48] presented the lower ound n log log log n for this opertion on unmiguous utomt. This shows tht the unmiguous stte complexity of complementtion is not polynomil, s it ws thought efore. The lrge gp etween lower nd upper ound on the complexity for complementtion on unmiguous utomt remins. We continue the reserch on opertionl complexity in this thesis. Motivted y n open prolem from [13] concerning the tightness of n upper ound 2 m + n + 1 for conctention, we first study the squre opertion. Since lnguge is recognized y n n-stte AFA if nd only if its reversl is recognized y 2 n -stte DFA with hlf of its sttes finl, nd, moreover, reversl nd squre commute, to get lnguge tht is hrd for squre on AFAs it is enough to tke the reversl of lnguge tht is hrd for squre on DFAs with hlf of their sttes finl. Therefore, we first study in detil the squre opertion on DFAs tht hve more thn one finl stte. We prove tht the upper ound n2 n k2 n 1 from [55] is tight lredy in the inry cse if the numer k of finl sttes is t most n 2. The cse of just one non-finl stte is different; here we get the results depending on the finlity of the initil stte. The witnesses, s well s the upper ounds for one non-finl stte cse hve een found s result of rute-force serch using simple ppliction tht we progrmmed for this purpose. We next otin the precise complexity of Boolen opertions, complementtion, str, reversl, nd quotients on oth Boolen nd lternting finite utomt. To get upper ounds we use the ove mentioned reltion etween the size of Boolen or lternting utomton for lnguge nd the size of DFA for its reversl. To get lower ounds we either use known results on the stte complexity of the corresponding opertion on lnguges represented y DFA with hlf of their sttes finl, or we descrie such DFAs 3

16 tht re hrd for the considered opertion on DFAs. Then we tke the reversl of these lnguges, nd, using the fct tht reversl commutes with ny of considered opertions, we show tht they meet the corresponding upper ound for Boolen or lternting utomt. All our witness lnguges re defined over inry or unry lphet. We lso show tht whenever we use inry lphet, it is lwys optiml in the sense the complexity of the corresponding opertion is smller in the unry cse. Finlly, we study opertionl complexity under the ssumption tht the input lnguges given s NFAs while the resulting lnguge hs to e represented s DFA, tht is, we investigte so clled NFA-to-DFA trde-off for regulr opertions. Here our motivtion comes from two strems of reserch. The first one concerns the complexity of comined opertions tht do not contin complementtion. In such cse we cn perform ll involved opertions on NFAs nd use the suset construction s the lst step. It follows tht the NFA-to-DFA trde-off for the outermost opertion provides n upper ound on the complexity of given comined opertion. Our second motivtion comes from the opertionl complexity on self-verifying nd unmiguous finite utomt tht re just specil cses of NFAs. Since every DFA is n unmiguous utomton nd it cn e viewed s self-verifying utomton (with the empty set of neutrl sttes), the NFAto-DFA trde-off for regulr opertion provides n upper ound on its self-verifying or unmiguous stte complexity. It turns out tht these upper ounds re lmost tight in some cses, so sometimes we cnnot do nything etter y using the specil properties of self-verifying or unmiguous utomt. We provide the precise NFA-to-DFA trde-off for complementtion, union, intersection, difference, symmetric difference, conctention, str, reversl, nd left nd right quotients. We use ternry lphet to descrie the witnesses for conctention nd inry Boolen opertions, nd we get n symptoticlly tight upper ounds for these opertions in the inry cse. Our witnesses for complementtion, str, reversl nd quotients re descried over inry lphet which is lwys optiml. For str, we re le to get the precise complexity lso in the unry cse, while for the other opertions on unry lnguges, we get symptoticlly tight upper ounds. The thesis is orgnized s follows. In Chpters 1 nd 2 we provide n introduction to sic notions nd nottions tht we use. The min result strts with Chpter 3, where we exmine the stte complexity of the squre opertion on lnguges ccepted y DFAs with k finl sttes, BFAs nd AFAs s well. In Chpter 4 we continue the reserch on AFA nd BFA opertionl stte complexity. Chpter 5 provides tight upper ounds on the NFA-to-DFA trde-off for ll sic regulr opertions. In Chpter 6 we summrize our results nd give open prolems we clshed into. 4

17 Chpter 1 Preliminries In this section we give sic notions nd preliminry results. Detils nd ll unexplined notions cn e found here [15, 51, 54]. Let Σ e finite non-empty lphet of symols. Then Σ denotes the set of ll words over Σ including the empty word ε. A lnguge over n lphet Σ is ny suset of Σ. Fo finite set S the symol S denotes the size of S nd 2 S denotes the power set of S. Let K nd L e lnguges over Σ. Then we cn consider severl regulr opertions: complement of L is L c = Σ \ L, intersection K L = {w Σ w K nd w L}, union K L = {w Σ w K or w L}, difference K \ L = {w Σ w K nd w / L}, symmetric difference K L = {w Σ (w K nd w / L) or (w / K nd w L) }, conctention of K nd L is KL = {uv u K nd v L}, str L = i 0 Li where L 0 = {ε} nd L i+1 = L i L, reversl L R = {w R w L}, where w R denotes the mirror imge of w, shuffle of K nd L is K L = {u 1 v 1 u 2 v 2 u k v k u i, v i Σ, u 1 u 2 u k K, v 1 v 2 v k L}, right quotient of K y L is the lnguge KL 1 = {x Σ xy K for some y L}, left quotient of K y L is the lnguge L 1 K = {x Σ yx K for some y L}. 5

18 A nondeterministic finite utomton (NFA) is quintuple A = (Q, Σ,, s, F ) where Q is finite non-empty set of sttes, Σ is finite non-empty input lphet, : Q Σ 2 Q is the trnsition function, s Q is the initil stte, F Q is the set of finl sttes. The trnsition function cn e extended to the domin 2 Q Σ in the nturl wy. For sttes p, q nd symol we sometimes write (p,, q) whenever q p. The lnguge ccepted y A is the set of words L(A) = {w Σ s w F }. Sometimes nondeterministic utomt re llowed to hve set of initil sttes, then we spek out NFAs with multiple initil sttes (MNFAs). The reverse of n MNFA A = (Q, Σ,, I, F ) is the MNFA A R = (Q, Σ, R, F, I) where q R = {p q p }, tht is, A R is otined from A y reversing ll its trnsitions nd swpping the roles of the initil nd finl sttes. We sy tht suset S of Q is rechle in MNFA A if there exists word w such tht S = I w. A suset S is co-rechle in A if it is rechle in the reversed utomton A R. A nondeterministic utomton is deterministic finite utomton (DFA) if q = 1 for ech stte q nd ech input symol. We usully write p = q insted of p = {q}, we use p q to denote tht p = q. A stte of DFA is clled ded if no word is ccepted from it. The stte complexity of regulr lnguge L, sc(l), is the smllest numer of sttes in ny DFA recognizing L. The stte complexity of k-ry regulr opertion is the function from N k to N defined s follows (n 1, n 2,..., n k ) mx{sc( (L 1, L 2,..., L k )) sc(l 1 ) n 1, sc(l 2 ) n 2,..., sc(l k ) n k }. Let {,,, \} nd lnguges K nd L re recognized y DFAs A = (Q A, Σ, A, s A, F A ) nd B = (Q B, Σ, B, s B, F B ). Then the lnguge K L is recognized y the product utomton M = (Q A Q B, Σ,, (s A, s B ), F ) where (p, q) = (p A, q B ) for ll p Q A, q Q B, nd Σ, nd F A F B, if = ; (F A Q B ) (Q A F B ), if = ; F = F A (Q B \ F B ), if = \; (F A (Q B \ F B )) ((Q A \ F A ) F B ), if =. Every MNFA A = (Q, Σ,, I, F ) cn e converted to n equivlent DFA D(A) = (2 Q, Σ,, I, {S 2 Q S F }). 6

19 The DFA D(A) is clled the suset utomton of A nd it my not e miniml, since it cn contin unrechle or equivlent sttes. A Boolen finite utomton (BFA) is quintuple A = (Q, Σ,, g s, F ), where Q is finite non-empty set of sttes, Q = {q 1,..., q n }, Σ is n input lphet, is the trnsition function tht mps Q Σ into the set B n of Boolen functions with vriles {q 1,..., q n }, g s B n is the initil Boolen function, nd F Q is the set of finl sttes. The trnsition function cn e extended to the domin B n Σ s follows: For ll g in B n, in Σ, nd w in Σ, we hve g, if w = ε; g w = g(q 1,..., q n ), if g = g(q 1,..., q n ) nd w = ; (g v), if w = v. Let f = (f 1,..., f n ) e the Boolen vector with f i = 1 iff q i F. The lnguge ccepted y the BFA A is the set L(A) = {w Σ (g s w)(f) = 1}. A Boolen finite utomton is clled lternting (AFA) if the initil function is projection g s (q 1,..., q n ) = q i. The Boolen (lternting) stte complexity of L, sc(l)(sc(l)), is the smllest numer of sttes in ny BFA (AFA) for L. The reder my refer to [4, 13, 25, 33, 51] for detils. We illustrte these notions in the following exmple. Exmple 1.1. Let A e inry lternting utomton with two sttes defined s A = ({q 1, q 2 }, {, },, q 1, {q 2 }) with the trnsition function defined in the following tle: q 1 q 1 q 2 q 1 q 2 q 2 q 1 q 2 Let us compute whether the word w = is ccepted. We strt the computtion from the initil stte s = q 1, s w = q 1. According to the tle q 1 is q 1 q 2, so we get q 1 = (q 1 q 2 ). And we continue s follows: (q 1 q 2 ) = (q 1 (q 1 q 2 )) = q 1 (q 1 (q 1 q 2 )). Now we evlute the resulting expression in the finlity vector f = (0, 1) replcing the finl sttes with 1s nd non-finl sttes with 0s: q 1 (q 1 (q 1 q 2 )) = 0 (0 (0 1)) = 0. The result is 0 so the word w = is not ccepted y A. A lnguge, or finite utomton, defined over n lphet contining exctly one (two, three, respectively) symols is clled unry (inry, ternry). 7

20 For unry DFAs we use the Nicud s nottion [43]. For two integers l nd n such tht 0 l n 1 nd suset F of {0, 1,..., n 1}, A = (n, l, F ) is the unry utomton whose set of sttes is Q = {0, 1,..., n 1} nd the trnsition function is given y q = q + 1 if 0 q n 2 nd (n 1) = l. The initil stte of this utomton is 0 nd its set of finl sttes is F (cf. Appendix [B, Preliminries]). For sttes p, q nd symol, we sy tht (p,, q) is trnsition in MNFA N = (Q, Σ,, I, F ) if q p. A sequence of trnsitions (q 0, 1, q 1 )(q 1, 2, q 2 ) (q n 1, n, q n ) on n input word 1 n is clled computtion of N on 1 n. The computtion is ccepting if q 0 I nd q n F. An MNFA N = (Q, Σ,, I, F ) is unmiguous (UFA) if it hs t most one ccepting computtion on every input word, Finlly, we define the model of self-verifying finite utomt in the following definition tken from [29]. Definition 1.2 ([29, Definition 1]). A self-verifying finite utomton (SVFA) is 6-tuple A = (Q, Σ,, q 0, F, F r ), where Q, Σ,, q 0 re defined s for stndrd nondeterministic utomt, nd F, F r Q re the sets of ccepting nd rejecting sttes, respectively. The remining sttes, nmely the sttes elonging to Q\(F F r ), re clled neutrl sttes. It is required tht for ech input word w in Σ, there exists t lest one computtion ending in n ccepting or in rejecting stte, tht is, (q 0 w) (F F r ), nd there re no words w such tht oth q 0 w F nd q 0 w F r re nonempty. The lnguge ccepted y A, denoted s L (A), is the set of ll input words hving computtion ending in n ccepting stte, while the lnguge rejected y A, denoted s L r (A), is the set of ll input words hving computtion ending in rejecting stte. 8

21 Chpter 2 Known Results The upper ounds on the stte complexity of sic regulr opertions cn e derived from the utomt constructions given y Rin nd Scott [46] lredy in The product utomton for intersection, descried in [46, Theorem 6], provides n upper ound mn for this opertion. For union, difference, nd symmetric difference, it is enough to chnge the set of finl sttes in this product utomton. This gives the sme upper ound for these three Boolen opertions. In [46, Definition 11 nd Theorem 11] the construction of the suset utomton D(N) corresponding to given NFA N ws descried. This construction resulted in the upper ound 2 n for NFA-to-DFA conversion since the sttes of D(N) re susets of the stte set of N. Following [46, Definition 12 nd Theorem 12] descried the reverse of n NFA nd provided n upper ound 2 n for the reversl opertion s result. Finlly, [46, Theorem 13] provided the construction of NFAs for conctention nd str. To get n upper ound for the conctention, we need to slightly modify Rin nd Scott s construction: insted of dding the trnsitions from finl sttes of A to the corresponding sttes of B, we dd the trnsitions from sttes with out trnsition to finl stte of A to the initil stte of B. This provides n upper ound m2 n 2 n 1 for conctention. A similr modifiction of n NFA for str gives n upper ound 3 4 2n. The tightness of the upper ound 2 n for NFA-to-DFA conversion ws proved lmost immeditely in 1962 y Yershov [53] who descried inry witness NFA, shown in Fig Its equivlent DFA requires t lest 2 n sttes. Similr inry NFAs were lter descried y Lupnov [37], Moore [42], nd Meyer nd Fisher [39]; see Fig.2.2. In 1966 Mirkin [40] pointed out tht the Lupnov s ternry NFA-to-DFA witness, see Fig. 2.3, is in fct the reverse of DFA. This proves the tightness of the upper ound 2 n for reversl. Binry witnesses for this opertion were given y Leiss [33] nd Šeej [52]. Binry witness lnguges for union, conctention nd str were descried y Mslov 9

22 n 2 n 1 Figure 2.1: Yershov n 2 n 1 Figure 2.2: Meyer, Fisher in 1970 [38]. The unry cse ws considered in 1986 y Chrok [9] who showed tht the determiniztion of unry NFA is in Θ(F (n)) where F (n) is Lndu function defined y F (n) = mx{lcm(x 1,..., x k ) x x k n} nd we hve F (n) 2 n ln n. In 1992 Birget [3] otined tight upper ounds on the stte complexity of the intersection of k regulr lnguges. The systemtic study of the stte complexity of regulr lnguges nd regulr opertions egn with the 1994 pper y Yu, Zhung nd Slom [55]. They otined upper ounds m2 n k2 n 1 nd 2 n n k 1 for conctention nd str of lnguges recognized y DFAs with k finl sttes, the tightness of which ws lter shown y Jirásek, Jirásková nd Szri [20] nd Plmovský [44]. They lso provided the stte complexity of left quotient (2 m 1) nd right quotient (m), s well s the stte complexity of sic opertions on unry lnguges. Tle 2.1 summrizes the results y Mslov nd Yu et l. More precise results in the unry cse were otined y Pighizzini nd Shllit [45]. Opertions on finite lnguges were investigted y Câmpenu [5]. The stte complexity, c, c, c, c n 2 n 1 Figure 2.3: Lupnov

23 DFA Σ Σ = 1 complementtion n 1 n union mn 2 mn if gcd(m, n) = 1 intersection mn 2 mn if gcd(m, n) = 1 conctention m2 n 2 n 1 2 mn if gcd(m, n) = 1 reversl 2 n 2 n str 3 4 2n 2 (n 1) left quotient 2 m 1 2 m right quotient m 1 m Tle 2.1: Opertionl complexity for deterministic finite utomt [38, 55]. of some less common regulr opertions cn e found in the literture: squre y Rmpersd [47], shuffle y Câmpenu [6], proportionl removls y Domrtzki [11], cyclic shift y Jirsková nd Okhotin [27], nd power y Domrtzki nd Okhotin [12]. In 2003 Holzer nd Kutri introduced nd exmined the nondeterministic stte complexity [14]. Their model of NFAs considered the single initil stte while Rin nd Scott [46] llowed more sttes to e initil. This results in the complexity m + n + 1 nd n + 1 for union nd reversl, while in model of Rin nd Scott it would e m + n nd n. The results from Holzer nd Kutri nd from the completion y Jirásková [24] on opertionl complexity on NFAs re summrized in Tle 2.2. NFA Σ Σ = 1 complementtion 2 n 2 Θ(F (n)) reversl n n str n n + 1 conctention m + n 2 m + n 1 m + n union m + n m + n + 1 if m kn nd n km intersection mn 2 mn if gcd(m, n) = 1 Tle 2.2: Opertionl complexity for nondeterministic finite utomt [14, 24]. 11

24 2.1 Comined Opertions, Self-verifying nd Unmiguous Automt The investigtion of comined opertions ws strted in 2007 y the pper y Slom, Slom nd Yu [49]. An upper ound cn e simply otined y the composition of prticulr complexities. Such n upper ound is tight in severl cses (for exmple for str of intersection, [28]). However, the resulting complexity is much smller in the most cses. A numer of comined opertions ws studied in the literture. The reverse of the union, intersection or conctention of two lnguges ws studied y Liu et l. in 2008 [36]. The stte complexity for (L 1 L 2 ) R ws showed to e 2 m+n 2 m 2 n +2, for (L 1 L 2 ) R it is 2 m+n 2 m 2 n +2, nd for (L 1 L 2 ) R it is 3 2 m+n 2 2 n +1. The conctention of one lnguge with the union or intersection of other two ws studied y Cui et l. [10] in So stte complexity of L 1 (L 2 L 3 ) ws shown to e (m 1)(2 n+p 2 n 2 p + 2) + 2 n+p 2 nd for L 1 (L 2 L 3 ) it is m2 np 2 np 1. A self-verifying finite utomton (SVFA) hs three disjoint groups of sttes: ccepting, rejecting nd neutrl. Every input word hs to hve t lest one ccepting or rejecting computtion, ut not oth. The SVFA-to-DFA conversion ws exmined in 2011 y Jirásková nd Pighizzini [29]. They used known result y Moon nd Moser [41] on the mximl numer of mximl cliques in grphs to show tht every n-stte SVFA cn e simulted y DFA tht hs t most g(n) sttes where n, if 1 n 2; n 3 3, if n 3 nd n mod 3 = 0; g(n) = n 1 3, if n 4 nd n mod 3 = 1; n 5 3, if n 5 nd n mod 3 = 2. The opertionl complexity on SVFAs ws exmined y Jirásek, Jirásková nd Szri [21]. Tle 2.3 summrizes their results. A nondeterministic finite utomton is unmiguous (UFA) if it hs t most one ccepting computtion on every input word. A lower ound method for UFAs sed on the rnge of certin mtrices hs een developed in 1978 y Schmidt [50]. Using this method, Leung [34, 35] showed tht tight upper ound on UFA-to-DFA conversion is 2 n while those for NFA-to-UFA is 2 n 1. The method ws further elorted y Jirásek, Jirásková nd Šeej [23], where opertionl complexity on UFAs ws exmined. Their results re summrized in Tle 2.4; here the lower ound for complementtion is from Rskin [48]. 12

25 SVFA Σ smll lphets complementtion n 1 - intersection mn 2 - union mn 2 - difference mn 2 - symmetric difference mn 2 - reversl 2n n if Σ = 1 str 3 4 2n 3 4 2n n 1 if Σ 4 left quotient 2 n 1 2 n n 1 if Σ 4 right quotient g(n) g(n) + 2 Ω(2 n 3 ) if Σ 4 conctention Θ(3 m 3 2 n ) g(m) + 2 n + 4 Ω(2 m 3 2 n ) if Σ 8 Tle 2.3: Opertionl complexity for self-verifying utomt [21]. UFA complementtion n log log log n n+log n 1 reversl n 1 3 str 4 2n 3 3 conctention 4 2m+n 1 7 union mn + m + n m + n2 0.79n+log n 4 intersection mn 2 left quotient 2 m 1 2 right quotient 2 m 1 2 Σ Tle 2.4: Opertionl complexity for unmiguous utomt [23, 48]. 2.2 Boolen nd Alternting Automt In Boolen finite utomton (BFA) the trnsition function mps every pir of stte nd letter into Boolen function with the sttes s vriles. This pproch is generliztion from NFAs where the result of the trnsition function my e viewed s disjunction of sttes. It is known tht Boolen utomt recognize regulr lnguges [4, 8]. Moreover, the BFA-to-DFA trde-off is 2 2n with inry witness [4] nd the BFA-to-NFA trde-off is 2 n + 1 lso with inry witness [25]. If the initil function of Boolen utomton is projection, tht is, if it strts in single stte, it is clled 13

26 n lternting finite utomton (AFA); cf. [8, 13, 54, 25]. In 1990 Fellh, Jurgensen nd Yu [13] descried the constructions of lternting finite utomt for sic regulr opertions on lnguges represented y AFAs. As result they get upper ounds for complementtion, union, intersection, conctention nd str, see Tle 2.5. Their upper ounds for union nd intersection were shown to e tight in 2012 [25]. For str nd conctention, the lower ound from [25] nd the upper ound from [13] differ y one, see Tle 2.6. The open prolem from [13] concerning the tightness of the upper ound for conctention ws definitely solved in 2018 [17]. upper ound for AFAs complementtion n + 1 union m + n + 1 intersection m + n + 1 str 2 n + 1 conctention 2 m + n + 1 Tle 2.5: Upper ounds for AFAs from Fellh, Jürgensen, Yu [13]. AFA stte complexity BFA stte complexity union m + n + 1 m + n intersection m + n + 1 m + n conctention 2 m + n <=. <= 2 m + n m + n reversl 2 n <=. <= 2 n n str 2 n <=. <= 2 n n <=. <= 2 n + 1 Tle 2.6: Results from [25]. The following two oservtions, concerning the reltion etween the size of BFA (n AFA) for lnguge nd the size of DFA for its reversl, ply crucil role in the next two chpters. We use them to get the stte complexity of ll sic regulr opertions on lnguges represented y BFAs nd AFAs. Lemm 2.1 (cf. [13, Theorem 4.1, Corollry 4.2] nd [25, Lemm 1] ). If lnguges L is recognized y n n-stte BFA (n-stte AFA), then the lnguge L R is recognized y DFA with 2 n sttes (y DFA with 2 n sttes of which 2 n 1 re finl, respectively). 14

27 Proof Ide. Let A = ({q 1, q 2,..., q n }, Σ,, g s, F ) e BFA for L. MNFA N = (Q, Σ,, I, {f}), where Construct 2 n -stte Q = {0, 1} n I = {j Q g s (j) = 1}; f = (f 1, f 2,..., f n ) Q with f i = 1 if q i F nd f i = 0 otherwise; the trnsition function : Q Σ 2 Q is defined s follows: for ech j = (j 1, j 2,..., j n ) Q nd ech Σ, j = {l Q (q i )(l) = j i for i = 1, 2,..., n}. Then L(A) = L(N). Moreover, utomton N R is deterministic, so L R is recognized y DFA with 2 n sttes. If A is n AFA, then the MNFA N hs 2 n 1 initil sttes, nd therefore the lnguge L R is recognized y DFA with 2 n sttes of which 2 n 1 re finl. Lemm 2.2 (cf. [25, Lemm 2]). If lnguge L is recognized y DFA A with 2 n sttes ( DFA with 2 n sttes of which 2 n 1 re finl), then the lnguge L R is recognized y n n-stte BFA (n n-stte AFA). Proof Ide. Let A = (Q, Σ,, s, F ) e 2 n -stte DFA for L. Without loss of generlity, let Q = {0, 1,..., 2 n 1}. Consider 2 n -stte MNFA A R = (Q, Σ, R, F, {s}) for L R. It hs exctly one finl stte s nd the set of initil sttes F. Moreover, for every Σ nd for every i Q, there is exctly one stte j such tht i j R since A is DFA. For stte i Q, let in(i) = (i 1, i 2,..., i n ) e the inry n-tuple such tht i 1 i 2 i n is the inry nottion of i on n digits with leding zeros if necessry. Let us define n n-stte BFA B = (Q B, Σ,, g s, F B ), where: Q B = {q 1,..., q n }; F B = {q l in(s) l = 1}; g s (in(i)) = 1 iff i F ; (q 1, q 2,..., q n )(in(i)) = in(j) where i j R for ech i Q nd Σ. Then L(B) = L(A R ) = L R, so L R is ccepted y n n-stte BFA. If F = 2 n 1, we my denote the sttes of A in such wy tht F = {2 n 1, 2 n 1 + 1,..., 2 n 1}. Then we get g s = q 1, nd therefore B is n n-stte AFA for L R. 15

28 Chpter 3 Squre on Deterministic, Alternting, nd Boolen Finite Automt The squre opertion is one of the sic unry opertions on forml lnguges defined s L 2 = {uv u L nd v L}. The upper ound on its stte complexity hs een long known, since the squre is only su-cse of more generl conctention. In [38] Mslov gives us n upper ound m2 n 2 n 1 on the stte complexity of conctention of lnguges ccepted y m nd n-stte DFAs respectively. This upper ound cnnot e met if the first lnguge is ccepted y DFA with k 2 finl sttes [55]. In this cse Yu et l. [55] proved tht the upper ound is m2 n k2 n 1. Jirskov et l. [20] showed the tightness of this upper ound y inry witnesses for every k with 1 k n 1. Tight upper ound for squre comes in 2006 y Rmpersd [47] where the tightness of the upper ound n2 n 2 n 1 is shown using inry lphet. The stte complexity of squre on lnguges ccepted y DFAs with k finl sttes ws finlly considered in [7]. The upper ound (n k)2 n + k2 n 1 ws shown to e tight on ternry lphet, ut only for k < n 1. The prolem of finding inry witness lnguge nd the prolem of finding tight upper ound for squre of lnguges ccepted y DFAs with n 1 finl sttes were left open. Finding witness lnguge ccepted y DFA with k finl sttes hs meningful ppliction for the squre opertion on Boolen or lternting finite utomt (BFAs, AFAs). An upper ound ws shown to e 2 n + n + 1 y Fellh, Jürgensen, Yu in 1990 [13]. It is known tht lnguge is ccepted y n n-stte AFA if nd only if its reverse is ccepted y 2 n -stte DFA with hlf of the sttes finl [13]. Therefore lnguge whose squre on DFA requires (n k)2 n + k2 n 1 sttes nd is ccepted y DFA with n/2 finl sttes is needed to show the tightness of this upper ound. We discuss these open prolems in this chpter. The solutions re sed on pulished pper 16

29 tht cn e found in Appendix [A] t the end of the thesis: Jirásková, G., Krjňáková, I.: Squre on deterministic, lternting, nd Boolen finite utomt. Interntionl Journl of Foundtions of Computer Science 30(6-7), (2019). In [A, Theorem 7] we present inry witness with k < n 1 finl sttes meeting the upper ound n2 n k2 n 1. This improves the ternry witness for this upper ound from [7, Lemm 2]. Then we inspect the cse of k = n 1 y discussion in two su-cses y the finlity of the initil stte. If the initil stte is finl then we show the tightness of the upper ound (n + 2)2 n 2 with inry witness in [A, Theorem 8]. Otherwise if the initil stte is the only non-finl stte then we show in [A, Lemm 9] tht the upper ound is (n + 3)2 n 2 nd it is tight on ternry lphet. For inry lnguges the upper ound (n + 3)2 n 2 1 is met [A, Theorem 11]. All these results re summrized in Tle 3.1. In the cse of unry lnguges we provide simplified proof from Pighizzini nd Shllit [45] in [A, Theorem 12] to show tht the exponentilly smller upper ound 2n 1 is tight. We use the presented inry witness lnguge for squre on DFAs with 2 n sttes, 2 n 1 of them finl, to show tht upper ound 2 n + n + 1 for squre on AFAs is tight in [A, Theorem 13]. Then in [A, Theorem 14], we extend the ppliction of presented witness lnguge to show tht the upper ound 2 n + n is tight for squre opertion on BFAs s well. For unry lnguges the corresponding upper ound is n + 1 s shown in [A, Theorem 15]. This mens tht the inry lphet is optiml for meeting the upper ound 2 n + n + 1. The study of stte complexity of squre strted y the Mster thesis in The results in Slovk lnguge were grdully improved nd reworked nd served s foundtion for future reserch done lter during this PhD study. All of the results were trnslted, concised nd refined in detils. The results for Boolen nd lternting utomt served s motivtion for nother pper presented on CSR 2019 in Moscow. The results given y [A, Theorems 1,7,14] nd [A, Lemms 8,9] were otined in Mster thesis [31] (in Slovk) nd presented t the DCFS 2017 conference. Their proofs tht ppered in IJFSC 2019 were chnged to e esier to follow. We used insted δ to simplify the nottion. To hve [A, Fig. 2] more trnsprent, it is drwn for specific vlues of m, n, k, l insted of generl cse in Mster thesis. The proof of [A, Theorem 7 on p. 1122] uses α := m k 1 to simplify the exposition. It is divided into 3 cses insted of 9 s ws in Mster thesis. The proof of [A, Lemm 8 on p ] provides detiled explntion tht corresponding word is ccepted only from prticulr stte. The former cses (4)-(7) in Mster thesis re now covered y one cse (3). We lso give different proof of distin- 17

30 guishility here. In the proof of [A, Lemm 9 on p. 1127] we use different formtting to simplify the redility of the proof. The result in [A, Theorem 11] concerning the tightness of the corresponding upper ound in the inry cse nd its proof on p is completely new nd did not pper in Mster thesis. The sme is true for the squre on unry DFAs on p The upper ound n + 1 given y [A, Theorem 15 on p. 1133] shows the optimlity of inry lphet used to descrie AFA witnesses. k sc Σ reference k = 1 n2 n 2 n 1 Σ 2 Rmpersd [47] 2 k n 2 n2 n k2 n 1 Σ 2 [32] k = n 1 nd q 0 F (n + 2)2 n 2 Σ 2 [32] k = n 1 nd q 0 / F (n + 3)2 n 2 Σ 3 [32] k = n 1 nd q 0 / F (n + 3)2 n 2 1 Σ = 2 [26] Tle 3.1: Stte complexities of squre vrying y numer of finl sttes. The next section presents n ccidentl enefit of our results on squre. It uses the witnesses for squre on DFAs with more tht one finl sttes from [A Theorem 7] to prove the tightness of the corresponding upper ounds on the complexity of conctention on DFAs nd AFAs. 3.1 Corollry for Conctention Here we show tht the witness from [A, Theorem 7] on squre cn e useful s witness for conctention s well. Tke two such utomt with m sttes, k of them finl nd n sttes with l of them finl. Then y the following theorem the upper ound (m k)2 n + k2 n 1 given y [55] is tight on the inry lphet. Theorem 3.1. Let m, n 4,1 k m 2 nd 1 l n 1. Let K nd L e lnguges over Σ recognized y n m-stte DFA with k finl sttes nd n n-stte DFA with l finl sttes, respectively. Then sc(kl) (m k)2 n + k2 n 1 nd this ound is tight if Σ 2. Proof. The upper ound (m k)2 n + k2 n 1 follows from [55, Theorem 2.3]. To prove tightness, let K e ccepted y DFA A m,k = (Q A = {q 0,..., q m 1 }, Σ, A, q 0, F A ) from Fig. 3.1 nd L ccepted y DFA B n,l = (Q B = {0,..., n 1}, Σ, B, 0, F B ) from Fig.3.2 which hve the sme structure ut different sizes m nd n with k nd l finl sttes respectively. 18

31 q 0 q 1 q 2... q m k 1 q m k... q m 1 Figure 3.1: DFA A m,k with m sttes nd k of them finl n l 1 n l... n 1 Figure 3.2: DFA B n,l with n sttes nd l of them finl. q 0 q 1 q 2 q 3 q 4 q 5,, Figure 3.3: NFA N for of L(A 6,2 )L(B 5,3 ). Construct NFA N from DFAs A m,k nd B n,l to ccept the lnguge KL y dding the trnsition (q,, 0) whenever q A F A nd (q,, 0) whenever q A F A. The initil stte of N is the stte q 0 nd the set of finl sttes is F B. An exmple with m = 6, k = 2, n = 5, l = 3 is shown in Fig In the corresponding suset utomton D(N), ech rechle stte is in the form {q} S where q Q A nd S Q B. We denote such stte y the pir (q, S). Let R = {(q i, S) 0 i m k 1 nd S Q B } {(q i, S) m k i m 1, S Q B nd 0 S}. The fmily R hs (m k)2 n +k2 n 1 sttes. We prove y induction on S tht every stte 19

32 (q i, S) in R is rechle in the suset utomton D(N). The sis, S = 0 nd S = 1 holds true since: (q 0, ) (q 1, ) (q 2, ) (q m k 1, ) (q m k, {0}), (q m k, {0}) (q m k+1, {0}) (q m 2, {0}) (q m 1, {0}), (q m 1, {0}) (q 0, {1}) (q 0, {0}), (q 0, {1}) (q 1, {2}) (q 0, {3}) (q 0, {4}) (q 0, {n 1}) (q 0, {2}), (q 0, {(j i) mod n}) i (q i, {j}) for i = 0, 1,..., m k 1 nd j = 0, 1,..., n 1. Assume tht every stte (q i, S) in R with S = t 1 nd i = 0, 1,..., m 1 is rechle. We show tht the stte (q i, S = {s 1, s 2,..., s t }) in R with S = t, where q i Q A nd 0 s 1 < s 2 < < s t n 1 is rechle s well. We do this in three steps: (1) We rech sttes (q i, S) stisfying the condition q i F A, so 0 S, in other words let s 1 = 0 nd m k i m 1. Let s 2 = 1. Tke the stte (q i 1, S = {0, s 3 1,..., s t 1}) R. It is rechle since S hs t 1 elements nd we hve (q i 1, {0, s 3 1,..., s t 1}) (q i, {0, 1, s 3,..., s t }) = (q i, S). Let s 2 2. Remind tht there is cycle (q 2, q 3,..., q m 1 ) formed y the trnsitions on in A. Then S \ {0} {2, 3,..., n 1} nd for ech s S \ {0} nd r 0 there exists exctly one element s S \ {0} such tht s r = S. Denote this element r (s). Let r = i (m k 1). Then (q m k 1, S = { r (s 2 ), r (s 3 ),..., r (s t )}) is rechle y the induction hypothesis since S = t 1 nd (q m k 1, S ) r (q i, {0, s 2,..., s t }) = (q i, S). (2) Now we rech the sttes (q 0, S). Our pproch vries ccording to vlue of s 1. Let s 1 = 0. If s 2 = 1 we tke the stte reched in (1) nd we hve (q m 1, {0, s 3 1,..., s t 1, n 1}) (q 0, {0, 1, s 3,..., s t }) = (q 0, S). For s 2 2 we continue using stte we reched ove, when s 2 = 1, nd (q 0, {0, 1, s 3 s 2 + 1,..., s t s 2 + 1}) (q 1, {1, 2, s 3 s 2 + 2,..., s t s 2 + 2}) n 2 (q 0, {0, 2, s 3 s 2 + 2,..., s t s 2 + 2}) s 2 2 (q 0, {0, s 2,..., s t }) = (q 0, S). Let s 1 1. Then the stte (q m 1, S = {0, s 2 s 1,..., s t s 1 }) is reched in (1). For s 1 = 1 we hve (q m 1, S ) (q 0, S). For s 1 2 we hve (q m 1, {0, s 2 s 1,..., s t s 1 }) (q 1, {2, s 2 s 1 + 2,..., s t s 1 + 2}) n 2 20

33 (q 0, {2, s 2 s 1 + 2,..., s t s 1 + 2}) s 1 2 (q 0, {s 1, s 2,..., s t }) = (q 0, S). (3) Let 1 i m k 1. We use sttes reched in (2) to chieve the remining sttes (q 0, {(s 1 i) mod n,..., (s t i) mod n}) i (q i, {s 1,..., s t }) = (q i, S). Now we continue with distinguishility. Similrly s in the proof of distinguishility for witness lnguge for squre [A, Theorem 7], there is word w = ( n 2 ) n 3 which is ccepted only from the stte n 1 in N. The word n 1 t w is ccepted only from stte t {1, 2,..., n 1} since t hs only one in-trnsition on from stte t 1. Hence the sttes (q i, S) nd (q j, T ) from R re distinguishle if S T. Consider now two distinct sttes (q i, S) nd (q j, S) in R. Without loss of generlity let 0 i < j m 1. We del with severl cses. (1) Let i = 0 nd j = m 2. (1) First ssume tht n 1 / S. Then (q 0, S) (q 1, S ), (q m 2, S) (q m 1, {0} S ). We cn distinguish these sttes since S \ {0} =. (1) Now let n 1 S. We use word the m 3 to send n 1 to 0. Moreover if 0 S then fter reding m 3 it remins in 0. Any other element from S is sent to the corresponding element in {2, 3,..., n 1}. So we get (q 0, S) m 3 (q 0, {0} S 1 ), (q m 2, S) m 3 (q m 2, {0} S 1 ). for some S 1 {2, 3,..., n 1}. If n 1 / S 1 we get cse (1). Otherwise we use gin word m 3 to get (q 0, {0} S 2 ) nd (q m 2, {0} S 2 ) for some S 2 {2, 3,..., n 1} such tht S 2 < S 1. If fter ech m 3 the element n 1 is in the resulting set then we end with (q 0, {0}) nd (q m 2, {0}) which re distinguishle y. Otherwise we hve (1). (2) Let i = 0 nd 2 j m 3. We use m 2 j to get cse (1) or cse S T. (3) Let i = 0 nd j = m 1. We use to get cse (2) or cse S T. (4) Let i = 0 nd j = 1. We use to get cse (2) or cse S T. (5) Let i 1. Then (q i, S) m j (q i+(m j), S 1 ), (q j, S) m j (q 0, S 1). Similrly s in previous cses, if S 1 nd S 1 re the sme we continue s in (1) (4), otherwise we continue s in cse S T. 21

34 Now we show n ppliction of witness lnguges L(A m,k ) nd L(B n,l ) for conctention on AFAs. Fellh et l. showed in [13, Theorem 9.3] tht if lnguge K is ccepted y n m-stte AFA nd lnguge L is ccepted y n n-stte AFA then the lnguge KL is ccepted y AFA with 2 m + n + 1 sttes. The next theorem shows tht this upper ound is tight using the inry witness lnguges provided in Theorem 3.1. Theorem 3.2. Let m, n 2. There exist inry lnguges K nd L recognized y n m- stte nd n n-stte AFA, respectively, such tht every AFA for KL hs t lest 2 m +n+1 sttes. Proof. Let K = L(B 2 m,2 m 1)R nd L = L(A 2 n,2 n 1)R. Since L(B 2 m,2 m 1) is recognized y 2m -stte DFA with hlf of the sttes finl, its reversl, the lnguge K, is recognized y n m-stte AFA. Anlogously, the lnguge L is recognized y n n-stte AFA. Next, s shown in Theorem 3.1 for DFAs, we hve sc((kl) R ) = sc(l R K R ) = sc(l(a 2 n,2 n 1)L(B 2 m,2 m 1)) = = 2 n 1 2 2m + 2 n 1 2 2m 1 = 2 2m 2 n 1 (1 + 1/2). It follows the numer of sttes in every AFA for KL is t lest log 2 2m 2 n 1 (1 + 1/2) = 2 m + n. Now we show tht every AFA for KL hs t lest 2 m + n + 1 sttes. Assume for contrdiction tht KL is recognized y n AFA with 2 m + n sttes. Then y Lemm 2.1, the lnguge (KL) R is recognized y DFA with 2 2m +n sttes, hlf of which re finl. It follows tht miniml DFA for (KL) R hs t most 2 2m +n 1 finl sttes. A stte (q, S) of the miniml DFA for KL is finl if S contins finl stte of B 2 m,2m 1. Hence, the numer of finl sttes in the miniml DFA for (KL) R is 2 n 1 (2 2m 1 1)2 2m n 1 (2 2m 1 1)(2 2m 1 1 ) = 2 2m +n 1 ( m ) > +n 1 2m m since m 2. This is contrdiction, so every AFA for KL hs t lest 2 m +n+1 sttes. 22

35 Chpter 4 Opertions on Boolen nd Alternting Finite Automt In this chpter we investigte the descriptionl complexity of sic regulr opertions on lnguges represented y Boolen nd lternting finite utomt (BFAs, AFAs). This representtion differs from nondeterministic finite utomt (NFAs). In NFAs the result of trnsition function is the disjunction of sttes. In the Boolen utomt we llow ny Boolen function, not only disjunction to e the result of the trnsition function. If n NFA strts in disjunction of sttes, we sy tht it hs multiple initil sttes, ut BFA cn strt in ny Boolen function. A Boolen utomton tht strts in single stte, Boolen function tht is projection, is clled n lternting finite utomton (AFA); cf. [8, 13, 54]. It is known tht every n-stte Boolen utomton cn e simulted y DFA with 2 2n sttes nd y NFA with 2 n + 1 sttes, nd tht oth these upper ounds cn e met y inry lnguges [4, 25]. Fellh, Jürgensen nd Yu [13] presented simple constructions of AFAs for severl sic regulr opertions on lnguges represented y AFAs. This resulted in the following upper ounds on the AFA stte complexity of corresponding opertions: complementtion n + 1, union m + n + 1, intersection m + n + 1, str 2 n + 1, conctention 2 m + n + 1. Jirásková in [25] provided tight upper ounds on AFAs nd BFAs for union, intersection. Lower ounds were showed for str, reversl, nd conctention: 23

36 AFA stte complexity BFA stte complexity union m + n + 1, m + n, intersection m + n + 1, m + n, conctention 2 m + n <=. <= 2 m + n + 1, 2 m + n, reversl 2 n <=. <= 2 n + 1, 2 n, str 2 n <=. <= 2 n + 1, 2 n <=. <= 2 n + 1. In this chpter we continue this reserch with the im to get the exct AFA nd BFA stte complexity for ll the ove mentioned opertions, s well s for opertions of left nd right quotients, difference nd symmetric difference. The solutions re sed on pper presented t CSR 2018 tht cn e found in Appendix [B] t the end of the thesis: Michl Hospodár, Glin Jirásková, Ivn Krjňáková: Opertions on Boolen nd lternting finite utomt. In: Fedor V. Fomin, Vldimir V. Podolskii (eds.): Computer Science Theory nd Applictions 13th Interntionl Computer Science Symposium in Russi, CSR 2018, Moscow, Russi, June 6 10, 2018, Proceedings. Lecture Notes in Computer Science, vol , pp , Springer (2018). We strt with [B, Proposition 1] deling with so clled uniquely distinguishle sttes nd we use them to get the distinguishility of susets in suset utomton. In [B, Lemms 2,3] we give two oservtions from the literture showing tht lnguge L is recognized y n n-stte BFA (n n-stte AFA) if nd only if the lnguge L R is recognized y 2 n -stte DFA ( 2 n -stte DFA with hlf of its sttes finl). This is crucil oservtion tht is used throughout this chpter nd pper [B] to get the exct complexity of ll considered opertions on BFAs nd AFAs. This oservtion follows from Lemms 2.1 nd 2.2 given together with their proof ides in Known results. Proposition [B, Proposition 7] descries the reversl of quotients. Let us provide the omitted proof here. Proposition 4.1. Let K nd L e lnguges over Σ. Then () (KL 1 ) R = (L R ) 1 K R ; () (L 1 K) R = K R (L R ) 1. Proof. () The equlity (KL 1 ) R = (L R ) 1 K R follows from the fct tht the following clims re equivlent: w (KL 1 ) R, 24

37 w R KL 1, w R = x where xy K for some y L, w = x R where y R x R K R for some y R L R, w (L R ) 1 K R. () The equlity (L 1 K) R = K R (L R ) 1 follows from the fct tht the following clims re equivlent: w (L 1 K) R, w R L 1 K, w R = x where yx K for some y L, w = x R where x R y R K R for some y R L R, w K R (L R ) 1. In [B,Proposition 8 nd 9] we prove preliminry results on str nd symmetric difference on DFA tht re used lter to get the complexity of str nd symmetric difference on BFAs nd AFAs. Now, with the im to decrese the size of the lphet in defining witnesses for Boolen opertion in [B], we consider the unry cse here. Lemm 4.2. Let A = (2 m, 0, {i 2 m 1 i 2 m 1}) nd B = (2 n 1, 0, {i 2 n 1 i 2 n 2}) unry DFAs, see Fig. 4.1 nd Fig. 4.2, where m, n 2. Then sc(l(a) L(B)) = sc(l(a) L(B)) = 2 m (2 n 1). Proof. Our im is to show tht ll sttes in the product utomt M nd M for L(A) L(B) nd L(A) L(B), respectively, re rechle nd pirwise distinguishle. The numers 2 m nd 2 n 1 re co-prime nd greter thn or equl to two. By Chinese Reminder Theorem, for every i nd j with 0 i 2 m 1 nd 0 j 2 n 2 there exists numer x(i, j) such tht x(i, j) mod 2 m = i, x(i, j) mod (2 n 1) = j. It follows tht in the product utomton M or M, every stte (i, j) is reched from the initil stte (0, 0) y the word x(i,j). 25

38 For distinguishility, we first consider union. Notice tht it is enough to distinguish the non-finl stte (0, 0) with ny other non-finl stte: indeed, if p nd q re two distinct sttes of the product utomton M, then we cn send the stte p to (0, 0) y word in, while q is sent to stte q with q (0, 0) y this word. If q if finl, then we re done since (0, 0) is non-finl. Otherwise, we hve the ove mentioned cse. Consider non-finl stte (i, j) (0, 0) in the product utomton M. Then 0 i 2 m 1 1 nd 0 j 2 n 1 1. Moreover i 1 or j 1. If i 1, then If j 1, then This proves distinguishility for union. (0, 0) x(2 m 1 1,0) (2 m 1 1, 0) / F while (i, j) x(2 m 1 1,0) (2 m i, j) F. (0, 0) x(0,2 n 1 1) (0, 2 n 1 1) / F while (i, j) x(0,2 n 1 1) (i, 2 n j) F. Now consider symmetric difference. Similrly s for union, it is enough to distinguish the non-finl stte (0, 0) with ny other non-finl stte. First, consider non-finl stte (i, j) with 0 i 2 m 1 1 nd 0 j 2 n 1 1. Then we proceed s in the cse of union: the word x(2m 1 1,0) distinguishes (0, 0) nd (i, j) if i 1, otherwise, we use the word x(0,2n 1 1) to distinguish them. Now consider non-finl stte (2 m 1 + i, 2 n 1 + j) with 0 i 2 m 1 1 nd 0 j 2 n 1 2. If i = 0, then we hve (0, 0) x(2 m 1,2 n 1 1) (2 m 1, 2 n 1 1) F while (2 m 1, 2 n 1 + j) x(2 m 1,2 n 1 1) (0, j) / F ; notice tht in B we hve 2 n 1 + j 2 n 1 2 j 2 n 2 0 j j. If i 1, then (0, 0) x(2 m 1 1,0) (2 m 1 1, 0) / F while (2 m 1 + i, 2 n 1 + j) x(2 m 1 1,0) (i 1, 2 n 1 + j) F. This proves distinguishility for symmetric difference, nd concludes the proof. 26

39 0 2 m m 1 2 m Figure 4.1: Unry DFA A = (2 m, 0, {i 2 m 1 i 2 m 1}). 0 2 n n n 2 Figure 4.2: Unry DFA B = (2 n 1, 0, {i 2 n 1 i 2 n 2}). Theorem 4.3. Let m, n 2 nd {,,, \}. Let K nd L e unry lnguges recognized y BFAs with m nd n sttes, respectively. Then the lnguge K L is recognized y BFA with m + n sttes, nd this upper ound is tight. Proof. The upper ound is the sme s in the cse of generl lphet. To prove tightness for union nd symmetric difference, let A nd B e the DFAs from Lemm 4.2. Let K = L(A) R nd L = L(B) R. Since L(A) is recognized y n 2 m -stte DFA, the lnguge K is recognized y n m-stte BFA y Lemm 1.3. Next, the lnguge L(B) is recognized y n 2 n -stte DFA; here we cn dd n unrechle stte 2 n 1 to the DFA B. Therefore, the lnguge L is recognized y n n-stte BFA gin y Lemm 1.3. We hve (K L) R = K R L R = L(A) L(B). By Lemm 4.2, every DFA for the lnguge (K L) R hs t lest 2 m (2 n 1) sttes. By Lemm 1.2, the numer of sttes in every BFA for K L is t lest log 2 m (2 n 1) = m + n. The proof for symmetric difference is exctly the sme. Notice tht the lnguges K c nd L c re witnesses for intersection since we hve (K c L c ) c = K L, nd on BFAs, the stte complexity of lnguge nd its complement is the sme. Similrly, the lnguges K c nd L re witnesses for difference since K c \ L = K c L c. Our proof is complete. 27

40 Theorem 4.4. Let m, n 3 nd {,, \}. Let K nd L e unry lnguges recognized y AFAs with m nd n sttes, respectively. Then the lnguge K L is recognized y n AFA with m + n + 1 sttes, nd this upper ound is tight. The lnguge K L is recognized y n AFA with m + n sttes, nd this upper ound is tight. Proof. The upper ounds re the sme s in the cse of generl lphet. For tightness in the cse of union, let A nd B e DFAs from Lemm 4.2. Let K = L(A) R nd L = L(B) R. Notice tht L(A) is recognized y DFA with 2 m sttes of which 2 m 1 re finl. By dding n unrechle finl stte 2 n 1 to the DFA B, we get DFA for L(B) which hs 2 n sttes of which 2 n 1 re finl. By Lemm 1.3, the lnguge K is recognized y n m-stte AFA nd the lnguge L is recognized y n n-stte AFA. From the previous proof, we lredy know tht every BFA, so lso every AFA, for K L hs t lest m + n sttes. Let us show tht one more stte is necessry for n AFA to ccept K L. Assume for contrdiction tht there is n AFA for K L with m + n sttes. Then y Lemm 1.2, the lnguge (K L) R is recognized y DFA with 2 m+n sttes of which 2 m+n 1 re finl. It follows tht the miniml DFA for (K L) R hs t most 2 m+n 1 finl sttes. However, we hve (K L) R = K R L R = L(A) L(B), nd it follows from the proof of Lemm 4.2 tht the numer of finl sttes in the miniml DFA for L(A) L(B) is 2 m 1 (2 n 1 1) + 2 m 1 (2 n 1) = 2 m+n 1 ( ) > 2m+n 1 2n 1 since n 3. This is contrdiction. Thus every AFA for K L hs t lest m + n + 1 sttes. Since the AFA complexity of lnguge nd its complement is the sme, the lnguges K c nd L c re witnesses for intersection, while K c nd L re witnesses for difference. Finlly, the lnguges K nd L meet the upper ound m+n for symmetric difference, since we lredy know from the proof of Theorem 4.3 tht every BFA, so lso every AFA, for K L hs t lest m + n sttes. All our results re summrized in Tle 4.1 nd Tle 4.2: 28

41 opertion BFA Σ Theorem AFA Σ Theorem complementtion n 1 [B, Thm. 10] n 1 [B, Thm. 10] union m + n 1 Theorem 4.3 m + n Theorem 4.4 intersection m + n 1 Theorem 4.3 m + n Theorem 4.4 difference m + n 1 Theorem 4.3 m + n Theorem 4.4 sym. difference m + n 1 Theorem 4.3 m + n 1 Theorem 4.4 conctention 2 m + n 2 Theorem m + n Theorem 3.2 str 2 n 2 [B, Thm. 11] 2 n 2 [B, Thm. 11] reversl 2 n 2 [B, Thm. 12(c)] 2 n 2 [B, Thm. 13(c)] right quotient 2 m 2 [B, Thm. 12(d)] 2 m [B, Thm. 13(d)] left quotient m 1 [B, Thm. 12(e)] m [B, Thm. 13(e)] Tle 4.1: Stte complexities of opertions on Boolen nd lternting utomt. opertion BFA Theorem AFA Theorem reversl n [B, Theorem 14(e)] n [B, Corollry 15(d)] str 2n [B, Theorem 14(f)] 2n + 1 [B, Corollry 15(e)] left=right quotient m [B, Theorem 14(g)] m + 1 [B, Corollry 15(f)] Tle 4.2: Stte complexities of opertions on unry Boolen nd lternting utomt. 29

42 Chpter 5 NFA-to-DFA Trde-Off This chpter discourses different view on the stte complexity trde-off for regulr opertions. We investigte the NFA-to-DFA trde-off which ssumes tht the rguments entering n opertion re represented y NFAs while the result is required to e DFA. We re motivted y two reserch prolems from the literture: the complexity of the comined opertions nd the opertionl complexity on lnguges represented y self-verifying nd unmiguous utomt. The study of comined opertions egn with the pper y Slom et l. [49], nd since then mny different comined opertions hve een studied. If given comined opertion does not contin complementtion then NFA-to-DFA trde-off for the outermost opertion provides n upper ound on the complexity of the comined opertion since we cn perform ech included opertion on NFAs. Self-verifying nd unmiguous utomt re specil forms of NFAs, while every DFA is self-verifying nd unmiguous utomton. Therefore the NFA-to-DFA trde-off for regulr opertion provides n upper ound on the complexity of the opertion on self-verifying or unmiguous utomt. We exmine the NFA-to-DFA trde-off for str, complementtion, intersection, union, difference, symmetric difference, reversl, left nd right quotient nd conctention. We strt with the str opertion where we provide tight upper ound 2 n with inry witness nd resolve the unry cse where the tight upper ound is (n 1) Then we show the tightness of the upper ound 2 n for complementtion opertion with inry witness, nd symptoticlly tight upper ound F (n) in the unry cse. We continue with Boolen opertions where we provide upper ounds nd show their tightness on ternry lphet. We show tht upper ound 2 m+n is symptoticlly tight for inry lphet for ll four Boolen opertions. For unry lphet we give n estimtion Θ(F (m + n)); here F (n) is Lndus function defined s F (n) = mx{lcm(x 1,..., x k ) x x k n} nd it 30

43 is known tht F (n) 2 n ln n. We descrie stright-forwrd solutions on NFA-to-DFA trde-off for reversl, left nd right quotient, on inry (or lrger) nd unry lphets. We conclude this chpter with the conctention opertion where we provide tight upper ound 3 4 2m+n with ternry witness. We show tht this upper ound is symptoticlly tight in the inry cse. In the unry cse, we get n upper ound O(F (m + n)) nd lower ound Ω(mx{F (m), F (n)}). The next three lemms provide tools to gurntee rechility nd distinguishility of ll sttes in the suset utomton of n NFA with pproprite structure. Lnguges descried y NFAs with similr or sme trnsitions s in these lemms re used s witness lnguges in this chpter. Lemm 5.1. Let A = ({0, 1,..., n 1}, {, },, 0, {n 1}) e the NFA from Fig. 5.1 where i = {i + 1} if 0 i n 2, nd i = {0, i}. Then for ech suset S of {0, 1,..., n 1}, there exists word u S {, } such tht 0 u S = S. Proof. In the suset utomton D(A), ech singleton set {i} is reched from the initil suset {0} y i nd the empty set is reched from {n 1} y. Ech set {i 1, i 2,..., i k } of size k, where 2 k n nd 0 i 1 < i 2 < < i k n 1, is reched from the set {i 2 i 1, i 3 i 1,..., i k i 1 } of size k 1 y i 1. This proves the rechility of ll susets of {0, 1,..., n 1} y induction. Hence for ech S {0, 1,..., n 1}, there is word u S {, } such tht 0 u S = S n 2 n 1 Figure 5.1: An NFA with 2 n rechle susets. Lemm 5.2. Let A = ({0, 1,..., n 1}, {, },, 0, {n 1}) e the NFA from Fig. 5.2 where i = {(i + 1) mod n} nd i = {0, i} if 1 i n 1. Then for ech suset S of {0, 1,..., n 1}, there exists word u S {, } such tht 0 u S = S. Proof. The proof is the sme s the proof of Lemm 5.1, ut now the empty set is reched from {0} y. 31

44 n 2 n 1, Figure 5.2: An NFA with 2 n rechle susets. Lemm 5.3 (Distinguishility). Let A e n NFA such tht for every stte q of A the singleton set {q} is co-rechle in A. Then every two distinct sttes of the suset utomton D(A) re distinguishle. Proof. Let us tke two distinct susets S nd T of D(A). Without loss of generlity, let q S\T. Since the set {q} is co-rechle in A, there is word w q tht is ccepted y A from the stte q nd rejected from every other stte. It follows tht in D(A), the word w q is ccepted from S nd rejected from T. Hence S nd T re distinguishle in D(A). 5.1 Str We strt with the str opertion. Its stte complexity is 3 4 2n [38] nd its nondeterministic stte complexity is n + 1 [24]. We show tht the NFA-to-DFA trde-off for str is 2 n. Theorem 5.4 (Str). Let n 2. Let L e lnguge over n lphet Σ recognized y n n-stte NFA. Then sc(l ) 2 n, nd the ound is tight if Σ 2. Proof. Let L e recognized y n n-stte NFA A = (Q, Σ,, s, F ). Construct n MNFA N recognizing L from A s follows. First, for ech trnsition (p,, q) in A with q F, dd the trnsition (p,, s). Next, if s / F, then dd new initil nd finl stte q 0 to ccept the empty word. Consider the suset utomton D(N). The only rechle set in D(N) contining the stte q 0 is the initil suset {s, q 0 }. All the remining rechle sets re susets of Q. Moreover, if rechle set contins finl stte of A, then it lso contins the stte s. If A hs finl stte different from s, then t lest 2 n 2 sets re unrechle in D(N), so the upper ound is 1+(3/4)2 n in this cse. If F = {s}, then the construction ove results in the sme utomton, so L = L. In such cse, the upper ound is 2 n. To prove tightness, consider the inry lnguge L recognized y the n-stte NFA A = ({0, 1,..., n 1}, {, },, 0, {0}) shown in Fig. 5.3 where for ech stte i, i = {i + 1 mod n}, nd i = {0, i} if i 1. Then L = L. In the suset utomton D(A), ll susets of {0,..., n 1} re rechle y Lemm 5.2. Since every singleton set is 32

45 co-rechle in A vi word in, ll the sttes of D(A) re pirwise distinguishle y Lemm n 2 n 1, Figure 5.3: A inry witness NFA for str meeting the upper ound 2 n. The witness from the previous proof is descried over inry lphet. It is impossile to meet the upper ound 2 n in the unry cse since every unry n-stte NFA cn e simulted e DFA with 2 O( n ln n) sttes [9]. The next theorem provides the tight upper ound in the unry cse. Theorem 5.5. Let n 6. Let L e unry lnguge recognized y n n-stte NFA. Then sc(l ) (n 1) 2 + 2, nd this ound is tight. Proof. To get lower ound consider the n-stte NFA from Fig.5.4. This NFA recognizes the lnguge L = {ε} { cn+d(n 1) c > 0, d 0} nd L = L since 0 is the unique finl stte. We hve gcd(n, n 1) = 1. By [55, Lemm 5.1]() the lrgest integer tht cnnot e presented s cn + d(n 1) with c > 0, d 0 is (n 1) 2. It follows tht the miniml DFA for L = L hs (n 1) sttes. Now we show tht (n 1) sttes re sufficient. Let A = (Q, {},, s, F ) e n ritrry unry n-stte NFA. First, ssume tht there is t lest one finl stte f s. Construct n NFA N = (Q, {},, s, F ) for lnguge L(A) + from A y dding trnsition (q,, s) whenever q F. To get DFA for L(A) it is enough to mke the initil stte {s} of the DFA D(N) finl; notice tht {s} hs no in-trnsitions in D(N) n 2 n 1 Figure 5.4: A unry witness for str meeting the upper ound (n 1)

46 Let t e smllest numer such tht s s t in N. Define S i,t = {s} it. Our im is to show tht S i 1,t S i,t. For i = 1 this clim holds since S 0,t = {s} nd S 1,t = {s} t = {s} S for some set S Q. If i > 1 then S i,t = {s} it = ({s} S ) (i 1)t = ({s} (i 1)t ) (S (i 1)t ) = S i 1,t (S (i 1)t ) S i 1,t. We hve two cses: (1) S i 1,t = S i,t, for some i n 1; (2) S n 1,t = Q. In oth cses the numer of sttes in the suset utomton D(N) is t most t(n 1) + 1 which is t most (n 1) Now let F = {s}. Then L(A) = L(A), which mens tht A is n NFA for L(A). If no trnsition in A goes to s, then L(A) = {ε} nd DFA for such lnguge needs only one stte. Otherwise, let t e the smllest numer such tht s s t nd S i,t e defined s ove. If t n 1 then we get n upper (n 1) in the sme wy s we did when F {s}. Let t = n. This mens tht we cn lel the sttes in Q with numers 0, 1,..., n 1 such tht 0 = s nd NFA A hs the trnsition (i,, i + 1) for i = 0, 1,..., n 2 nd the trnsition (n 1,, 0) nd does not hve ny trnsition (i,, j) where j > i+1. If there is no trnsition (i,, j) with j i, then A is deterministic. Otherwise, ech such trnsition forms loop (j, j + 1,..., i) of length i j + 1. Assume tht there exist k loops of distinct lengths l 1,..., l k in A. First consider k 2. Then S 1,n {s, n l 1, n l 2,..., n l k }, so S 1 hs t lest 3 elements. Moreover S i 1,n = S i,n for some i n 2, or S n 2,n = Q. So utomton D(A) hs t most 1 + (n 2)n = (n 1) 2 rechle sttes, which is less thn (n 1) Now let k = 1. Then A ccepts words of length cn + dl 1, where c > 0 nd d 0. If gcd(n, l 1 ) = 1 then y [55, Lemm 5.1]() the lrgest integer tht cnnot e presented s cn + dl 1 is (n 1)l 1. This mens tht D(A) hs (n 1)l sttes, which is t most (n 1) But if, on the contrry, gcd(n, l 1 ) = q, q 2, we cn reduce A with q nd construct NFA A where every q trnsitions in A would e one in A nd there would e n sttes q 34

47 insted of n. Since gcd( n q, l 1 q ) = 1 we cn use [55, Lemm 5.1](), so the lrgest integer tht cnnot e presented s c n + d l 1 q q is ( n 1) l 1 q q. Thus the numer of sttes needed for D(A ) is ( n 1) l 1 q q + 2 = nl 1 l q 2 1 q + 2. Now we cn expnd D(A ) to D(A). The numer of sttes needed for D(A) is ( nl 1 l q 2 1 q + 2)q nd we cn estimte this numer for n 6: ( ) nl 1 l q 2 1 q + 2 q = nl 1 l q 1+2q < nl 1 +2l ( 2 1 = l n 1 + 2) (n 1) ( n + 2) < (n 1) Boolen Opertions We continue with complementtion, union, intersection, difference nd symmetric difference. Let us first provide tight upper ound 2 n for complementtion which contrsts its stte complexity n nd is the sme s its non-deterministic stte complexity 2 n [24]. Theorem 5.6 (Complementtion). Let L e lnguge over Σ recognized y n n- stte NFA. Then sc(l c ) 2 n, nd the ound is tight if Σ 2. Proof. Let A e n n-stte NFA recognizing L. We pply the suset construction to A nd get 2 n -stte DFA recognizing L. Then we invert the finlity of every stte to get 2 n -stte DFA recognizing L c. For tightness, let L e the inry lnguge recognized y the NFA A shown in Fig. 5.1 on pge 31. By Lemm 5.1, every suset of {0, 1,..., n 1} is rechle in the suset utomton D(A). Since every singleton set is co-rechle in A vi word in, ll sttes of D(A) re pirwise distinguishle y Lemm 5.3. Thus the miniml DFA for L hs 2 n sttes, nd we get sc(l c ) = sc(l) = 2 n. The inry lphet used in the previous theorem is optiml since every unry n- stte NFA cn e simulted y DFA of 2 O( n ln n) sttes [9]. The next theorem gives n symptoticlly tight upper ound on the NFA-to-DFA trde-off for complementtion in the unry cse. Theorem 5.7. Let L e unry lnguge recognized y n n-stte NFA. Then sc(l c ) = Θ(F (n)). Proof. The upper ound is given y the complexity of determiniztion of n-stte unry NFA which is O(F (n)) y [9, Theorem 4.4]. To get tightness consider the prtition n 1 = x x k such tht F (n 1) = lcm(x 1,..., x k ). Let L e the lnguge recognized y n-stte NFA with non-finl initil stte which hs nondeterministic trnsitions to k non finl sttes tht re in disjoint cycles of lengths x 1,..., x k. All the remining sttes in ech cycle re finl. See Fig. 5.5 for n exmple with x 1 = 2, x 2 = 3, x 3 = 5. Then DFA for L hs til of length 1 consisting of non-finl sttes nd loop of length lcm(x 1,..., x k ). 35

48 Ech stte from the loop is finl with the exception for the stte tht follows the til. This mens tht the loop is miniml, so sc(l c ) = sc(l) F (n 1) = Ω(F (n)). x 1 x 2 x 3 Figure 5.5: Exmple with x 1 = 2, x 2 = 3, x 3 = 5. Now we continue NFA-to-DFA trde-off for four inry Boolen opertions. First, we recll some notions. We cll stte q of DFA A = (Q, Σ,, s, F ) sink stte if q = q for every letter Σ. The stte q is clled ded if reding every word from the stte q results in non-ccepting stte of A. To get n utomton recognizing union, intersection, difference, or symmetric difference of two lnguges we use the product construction s descried in Preliminries. Let us recll its construction here. Let A = (Q A, Σ, A, s A, F A ) nd B = (Q B, Σ, B, s B, F B ) e DFAs over n lphet Σ. Let {,, \, }. Then the lnguge L(A) L(B) is recognized y the product utomton M = (Q A Q B, Σ,, (s A, s B ), F ) where (p, q) = (p A, q B ) for ll p Q A, q Q B, nd Σ, nd F A F B, if = ; (F A Q B ) (Q A F B ), if = ; F = F A (Q B \ F B ), if = \; (F A (Q B \ F B )) ((Q A \ F A ) F B ), if =. If the opertion inputs re given y NFAs, we first pply the suset construction to get DFAs for those inputs. Then we construct the corresponding product utomton. Notice tht every suset utomton hs t lest one rejecting sink stte, nmely, the empty set. The following lemm provides upper ounds for Boolen opertions on DFAs considering the presence of the rejecting sink sttes. 36

49 Lemm 5.8. Let K nd L e lnguges over Σ ccepted y DFAs with m nd n sttes respectively. Assume tht oth DFAs hve rejecting sink stte. Then sc(k L) mn, sc(k L) mn, sc(k L) mn m n + 2, nd sc(k \ L) mn n + 1. Proof. For ech Boolen opertion {,, \, }, the lnguge K L is recognized y the product utomton M which hs mn sttes. This gives the upper ounds for union nd symmetric difference. Let d A nd d B e the rejecting sink sttes of A nd B, respectively. Then in the product utomton M recognizing K L, the sttes (d A, q) with q Q B nd the sttes (p, d B ) with p Q A re ded nd cn e merged into one sink stte. This gives the upper ound (m 1)(n 1) + 1 = mn m n + 2. In the product utomton M \ recognizing K \ L, the sttes (d A, p) with p Q B re ded, which gives the upper ound (m 1)n + 1 = mn n + 1. Now we re redy to get tight upper ounds on NFA-to-DFA trde-off for Boolen opertions. Theorem 5.9 (Boolen opertions). Let K nd L e lnguges over Σ recognized y n m-stte nd n-stte NFA, respectively, where m, n 2. Then () sc(k L) 2 m+n, () sc(k L) 2 m+n, (c) sc(k L) 2 m+n 2 m 2 n + 2, (d) sc(k \ L) 2 m+n 2 n + 1. All these ounds re tight if Σ 3. Proof. Let A e n m-stte NFA recognizing K nd B e n n-stte NFA recognizing L. Consider the corresponding suset utomt D(A) nd D(B) with 2 m nd 2 n sttes, respectively. Both of them hve t lest one rejecting sink stte, nmely, the empty set. Then ll upper ounds follow from Lemm 5.8. For tightness, let K nd L e the lnguges recognized y NFAs A nd B from Fig Notice tht trnsitions on in A re the sme in oth utomt, performing loop nd return to the initil stte. The roles of the trnsitions on nd c re mutully exchnged. It follows from Lemm 5.1 tht for every S {0, 1,..., m 1}, there is word u S {, } such tht 0 A u S = S, nd for every T {0, 1,..., n 1}, there is word v T {, c} such tht 0 B v T = T. 37

50 , c, c, c, c, c A m 2 m 1,,,,, c c c B c n 2 c n 1 Figure 5.6: Ternry witnesses for Boolen opertions. Let {,,, \}. Construct the product utomton M from DFAs D(A) nd D(B). The initil stte of M is ({0}, {0}). Let S {0, 1,..., m 1} nd T {0, 1,..., n 1}. If 0 S then the stte (S, T ) is rechle in M from the initil stte y the word u S v T. Otherwise, to rech (S, T ) with S = {s 1,..., s k } we first rech (S, T ), where S = {0, s 2 s 1,..., s k s 1 } y the word u S v T. Then we red s 1 ech stte of M is rechle. to get (S, T ). Hence To prove distinguishility first consider union. Then (S, T ) is finl in M if m 1 S or n 1 T. Let (S, T ) nd (S, T ) e two distinct sttes of M. Then S S or T T. In the first cse, let without loss of generlity s S \ S. Consider the word m 1 s c n nd notice tht (S, T ) m 1 s c n ({m 1} S 1, ) for some S 1 {0, 1,..., m 1}; (S, T ) m 1 s c n (S 1, ) where m 1 / S 1. It follows tht m 1 s c n is ccepted y M from (S, T ) nd rejected from (S, T ). The cse of T T is symmetric. We cn prove distinguishility for symmetric difference in the exct sme mnner. Now consider intersection. A stte (S, T ) is finl in M iff m 1 S nd n 1 T. All sttes (, T ) with T {0, 1,..., n 1} nd (S, ) with S {0, 1,..., m 1} re ded in M. If s S nd t T, then the word m 1 s c n 1 t is ccepted y M from (S, T ), so (S, T ) is not ded. Let S, T, S, T e non-empty such tht (S, T ) (S, T ). Then S S or T T. In the first cse, let s S \ S nd t T. Consider the 38

51 word m 1 s c n 1 t. Notice tht (S, T ) m 1 s c n 1 t ({m 1} S 1, {n 1} T 1 ) for some S 1, T 1 ; (S, T ) m 1 s c n 1 t (S 1, T 1) for some S 1, T 1 with m 1 / S 1. Thus m 1 s c n 1 t is ccepted y M from (S, T ) nd rejected from (S, T ). The cse of T T is symmetric. Finlly, consider the difference K \ L. A stte (S, T ) is finl in M \ iff m 1 S nd n 1 / T. All sttes (, T ) with T {0, 1,..., n 1} re ded in M \. Let S. If s S, then the word m 1 s c n is ccepted from (S, T ), so (S, T ) is not ded. Let S, S, (S, T ) (S, T ). If s S \ S, then (S, T ) m 1 s c n ({m 1} S 1, ) for some S 1 ; (S, T ) m 1 s c n (S 1, ) for some S 1 with m 1 / S 1. Thus the word m 1 s c n is ccepted y M \ from (S, T ) nd rejected from (S, T ). If S = S, s S, nd t T \ T, then tke the word m 1 s c n 1 t : (S, T ) m 1 s c n 1 t ({m 1} S 1, {n 1} T 1 ) for some S 1, T 1 ; (S, T ) m 1 s c n 1 t ({m 1} S 1, T 1) where n 1 / T 1. Thus m 1 s c n 1 t is rejected y M \ from (S, T ) nd ccepted from (S, T ). This concludes the proof. Now we show tht the upper ound 2 m+n is symptoticlly tight in the inry cse. A m 2 m 1 B n 2 n 1 Figure 5.7: Binry NFAs A nd B with sc(l(a) L(B)) = 2 m+n 1 + m + n. 39

52 Theorem Let m, n 2 nd lnguges K nd L e defined y inry NFAs A nd B with m nd n sttes from Fig Then sc(k L) = sc(k L) = 2 m+n 1 + m + n 1 2 2m+n, sc(k L) = 2 m+n 1 + m + n 2 m 2 n m+n, sc(k \ L) = 2 m+n 1 + m + n 2 n m+n. Proof. Let {,,, \}. Construct the product utomton M for K L using the suset utomt D(A) nd D(B). The initil stte of M is ({0}, {0}) nd let S {0, 1,..., m 1} nd T {0, 1,..., n 1}. We denote S 1 = {i + 1 i S \ {m 1}} nd if s = min S we denote S s = {i s i S}. The sets T 1 nd T min T re defined nlogously. Notice tht if S nd T re non-empty then y reding from ny (S, T ) we rech stte (S 1, T {0}) nd y reding we rech stte (S {0}, T 1) which results in n oservtion tht exctly one of S or T cn contin the initil stte of the corresponding utomton, except for the initil stte ({0}, {0}). This mens tht the set of possile rechle sttes R consists of pirs (S, T ) of three types: (1) (S, ), (, T ); (2) ({0}, {j}), ({i}, {0}), where i Q A nd j Q B ; (3) (S, T ), where either 0 A S nd 0 B / T, T, or 0 B T nd 0 A / S, S. So R contins (2 m+n 1 2 m 2 n + 2) + (2 m + 2 n 1) + (m + n 1) = 2 m+n 1 + m + n sttes. Let us show tht ll pirs in R re rechle. By Lemm 5.1, there exists word u S {, } such tht 0 A u S = S nd u T {, } such tht 0 B u T = T (1) Let S = or T =. Then ({0}, {0}) m ({ }, {0}) u T (, T ), nd the proof for T = is symmetric. (2) Let S = {0} nd T = {j} or S = {i} nd T = {0}. Then ({0}, {0}) j ({0}, {j}), nd ({0}, {0}) i ({i}, {0}). (3) Let 0 S nd T = {j} where j 0 or 0 T nd S = {i} where i 0. We prove this cse y using induction on the size of S. The sis, S = 1, ws shown in (2). Let S 2. Denote s s miniml element of S \ {0}; s = min(s \ {0}) nd S = (S \ {0}). Then (S, {n 1}) is rechle y the induction hypothesis, nd we get (S, {n 1}) s (S \ {0}, {0, n 1}) j (S, {j}). Symmetriclly y swpping nd we prove the other cse. 40

53 (4) Let 0 S, 0 / T, T ; or 0 T, 0 / S, S. We prove the first su-cse y induction on S. The sis, S = 1, is proved in cses (2) (3). Assume tht the clim holds if S = k. Let S = k + 1. Tke (S \ {0}, T min T ), with S \ {0} = k. Then y (S \ {0}, T min T ) min T (S, T ) we otin (S, T ). The second su-cse is proved in symmetric wy. The proof for distinguishility for {,, } is the sme s in the proof of Theorem 5.9 ut with one condition, we replce the letter c with. For = \ we continue likewise, we replce the letter c with, ut we del with nother sitution when S = S. If T nd T differ in stte t > 0 then we cn continue s in the proof of Theorem 5.9. Otherwise T = {0} T, which mens 0 / T nd therefore 0 S. Since S = S we get 0 S. The fct tht 0 S nd 0 T follows tht T = {0} nd S = S = {0}. Thus T =. We then distinguish such pirs in the following wy: This concludes the proof. ({0}, {0}) m 1 c n 1 ({m 1}, {n 1}) nd reject; ({0}, ) m 1 c n 1 ({m 1}, ) nd ccept. We showed tht the upper ound 2 m+n for Boolen opertions is symptoticlly tight in the inry cse. The next theorem dels with the unry cse. Theorem Let {,,, \} nd K nd L e unry lnguges recognized y NFAs with m nd n sttes respectively. Then sc(k L) = O(F (m + n)). For infinitely mny pirs (m, n) there exist unry lnguges K nd L recognized y m-stte nd n-stte NFA, respectively, such tht sc(k L) = Ω(F (m + n)). Proof. Let A nd B e unry m-stte nd n-stte NFAs for K nd L, respectively. We cn convert A nd B into utomt A nd B in Chrok norml form [9], Fig The NFA A consists of til of length t most m 2 tht ends in exctly one nondeterministic trnsition going to k disjoint cycles of length x 1,..., x k, where x 1 + x x k m. Similrly B hs til of length t most n 2 nd disjoint cycles of length y 1, y 2,..., y l, where y 1 + y y l n. Then K L is ccepted y DFA with til of length t most mx(m 2, n 2 ) nd cycle of size lcm(x 1,..., x k, y 1,..., y l ) F (m + n). In totl this DFA hs O(F (m + n)) sttes. To get lower ound let us tke the prtition m + n 2 x 1 + x x k such tht F (m + n 2) = lcm(x 1, x 2,..., x k ). We my ssume tht x i nd x j re pirwise co-prime nd 2 x 1 < x 2 < < x k. Let m = 1 + x 1 nd n = 1 + x x k. Let 41

54 A nd B e NFAs from Fig Automton A hs m sttes nd utomton B hs n sttes. Let K = L(A) nd L = L(B). Then K L is ccepted y DFA D with til of length 1 nd loop of length x 1 x 2 x k ; see Fig where x 1 = 2, x 2 = 3, x 3 = 5 nd =. Ech stte from these x 1 x 2 x k cn e leled y tuple (v 1,..., v k ), where v i is the reminder fter dividing y x i nd ech such tuple is unique. The set of finl sttes differs for {,,, \}. For the set of finl sttes contins only the stte (0,..., 0). For the set of finl sttes consists of the initil stte s nd the sttes v = (v 1,..., v k ) where v i = 0 for n i = 1,..., k. For tke F D = {s} {(v 1,..., v k ) (v 1 = 0 v i 0 for ech i 2) (v 1 0 v i = 0 for n i 2)}. Finlly for \ we tke F D = {s} {(v 1,..., v k ) (v 1 = 0 v i 0 for ech i 2)}. To prove distinguishility, our generl pproch is to tke two distinct sttes u = (u 1,..., u k ) nd v = (v 1,..., v k ) tht we would like to distinguish y word w. In our nottion with modx i the word w is in fct (w 1,w 2,...,w k ). Then reding w from stte u looks like this: (u 1,..., u k ) w ((u 1 + w 1 ) mod x 1,..., (u k + w k ) mod x k ), nd for ech opertion we define specific w = (w 1,..., w k ). Its existence follows from Chinese reminder theorem since x 1,..., x k re pirwise co-prime nd greter thn one. : Since u nd v re distinct, there is n i such tht u i v i. Tke w = (w 1,..., w k ) where w i = x i u i for ech i = 1,..., k. Then (u 1,..., u k ) (w 1,...,w k ) (0,..., 0) while the ith component of v + w is different from zero. Hence w is ccepted from u nd rejected from v. x 1 y 1 x 2 y 2 N(A) = A.... N(B) = B.... m 2 n 2 x k y l Figure 5.8: The Chrok norml form of NFAs A nd B. 42

55 x 2 A x 1 B. x 3 x k (0, 0, 0) Figure 5.9: NFAs A nd B with m = 1 + x 1 nd n = 1 + x x k sttes. (0, 0, 4) (1, 2, 3)(0, 1, 2) (1, 0, 1) (1, 1, 0) (0, 2, 0) (0, 2, 1) (1, 1, 4) (1, 0, 2) (0, 0, 3) (0, 1, 3) (1, 2, 2) (1, 2, 4) (0, 1, 1) (1, 1, 1) (0, 2, 2) (1, 0, 3) (0, 1, 4) (1, 2, 0)(0, (0, 1, 0) 0, 1)(1, 1, 2)(0, 2, 3) (1, 0, 4) (1, 2, 1) (1, 0, 0) (0, 2, 4) (1, 1, 3) (0, 0, 2) Figure 5.10: DFA D for K L with x 1 = 2, x 2 = 3, x 3 = 5. : Let u i v i. Tke w = (w 1,..., w k ) where w i = x i u i, nd for ech j i, 1 j k tke w j = 1 iff v j = 0 nd w j = 0 iff v j 0. Then the ith component of u + w is zero, while the ech component of v + w is different from zero. Hence w is ccepted from u nd rejected from v. \: We consider two cses. Firstly, when u 1 v 1. We tke w = (w 1,..., w k ) where w 1 = x 1 u 1, nd for 2 j k tke w j = 1 iff u j = 0 nd w j = 0 iff u j 0. Then the first component of u + w is zero nd ny other is non-zero, while ech component of v + w is non-zero. Hence w is ccepted from u nd rejected from v. Now let u 1 = v 1. Then there is i 2 such tht u i v i. We tke w = (w 1,..., w k ) where w 1 = x 1 u 1, nd for 2 j k tke w j = 1 iff u j = 0 nd w j = 0 iff u j 0. Then the first nd ith component of u + w re zeroes, while the first component of v + w is zero nd ny other is non-zero. Hence w is ccepted from v nd rejected from u. 43

56 : We consider two cses. Firstly, when u 1 v 1, we set w 1 = x 1 u 1 nd for 2 i k, 0, if u i 0 nd v i 0; w i = 1, if (u i = 0 nd 0 v i x i 2) or (v i = 0 nd 0 u i x i 2); 2, if (u i = 0 nd v i = x i 1) or (v i = 0 nd u i = x i 1). Then w is ccepted from u since the first component of u + w is zero nd ny other is non-zero, ut w is rejected from v since every component of v + w is non-zero. Secondly let u 1 = v 1. Then u i v i for some 2 i k. Set w 1 = x 1 u 1 nd w i = x i u i nd for j / {1, i} tke w j = 1 iff v j = 0 nd w j = 0 iff v j 0. Then w is ccepted from v since the first component of v + w is zero nd ny other is non-zero, ut w is rejected from u the first nd ith component of u + w re zeroes. It follows tht sc(k L) x 1 x 2 x k = lcm(x 1, x 2,..., x k ) = F (m + n 2) F (m + n 2) = Ω(F (m + n )). This concludes our proof. 5.3 Reversl, Left nd Right Quotient Let us continue with the reversl opertion. Note tht it is enough to tke the reversl of ny DFA with one finl stte meeting the upper ound 2 n on the stte complexity of reversl. Such inry DFA ws descried y Šeej [30, 52]. Here we descrie different witness with significntly simpler proof. Notice tht the inry lphet used for reversl is optiml. Reverse of ny unry lnguge is the lnguge itself, ut in our cse we hve unry lnguge recognized y n-stte NFA, which cn e simulted DFA with 2 O( n ln n) sttes [9]. Theorem 5.12 (Reversl). Let L e lnguge over Σ recognized y n n-stte NFA, where n 2. Then sc(l R ) 2 n, nd the ound is tight if Σ 2. Proof. Let L e ccepted y n n-stte NFA A = (Q, Σ,, s, F ). By reversing ll the trnsitions in A nd tking F s the set of strting sttes nd {s} s set of finl sttes we otin n n-stte MNFA tht ccepts L R. It follows tht L R is ccepted y DFA with t most 2 n sttes. To prove tightness, consider the inry lnguge L recognized y the n-stte NFA N = ({0, 1,..., n 1}, {, },, 0, {0, 1,..., n 1}) shown in Fig where i = {i+1 mod n}, i = {i} if i 1. By reversing NFA N we get n MNFA N R tht recognizes L R. The set of initil stte of N R is {0, 1,..., n 1} nd its unique finl stte is 0. Notice tht ech suset of the stte set of N R cn e shifted cycliclly y one y reding, nd 44

57 n 2 n 1 Figure 5.11: A inry witness NFA for reversl meeting the upper ound 2 n. the stte 0 cn e eliminted from every set contining 0 y reding. It follows tht every suset of {0, 1,..., n 1} cn e reched from the initil suset {0, 1,..., n 1} in the suset utomton D(N R ). Next, every set {i} is co-rechle in N R vi word in nd using Lemm 5.3 we get tht every two distinct sttes of the D(N R ) re distinguishle. We investigte NFA-to-DFA trde-off for left nd right quotients in the next two theorems. In the first one we show tight upper ounds with inry witnesses for oth opertions. The optimlity of the inry lphet is shown y the second one, where the symptoticlly tight upper ound for unry cse is provided. Theorem 5.13 (Left nd Right Quotient). Let K nd L e lnguges over n lphet Σ recognized y n m-stte nd n-stte NFA, respectively, where m, n 2. Then sc(l 1 K), sc(kl 1 ) 2 m, nd the ounds re tight if Σ 2. Proof. Let A = (Q A, Σ, s A, A, F A ) e n m-stte NFA recognizing K. The lnguge L 1 K is recognized y the m-stte MNFA N otined from A y chnging the set of initil sttes to {s A A w w L}. The lnguge KL 1 is recognized y the m-stte NFA N otined from A y chnging the set of finl sttes to {q Q A q A w F A for some w L}. Hence sc(l 1 K), sc(kl 1 ) 2 m. For tightness, notice tht {ε} 1 K = K{ε} 1 = K. Therefore, the upper ound 2 m is met in oth cses y L = {ε} nd K equl to the inry m-stte witness NFA for determiniztion given y Lemm 5.1. For distinguishility, notice tht ech singleton set is co-rechle in this NFA. Theorem Let K nd L e recognized y m-stte nd n-stte unry NFAs respectively. Then sc(kl 1 ) = sc(l 1 K) = Θ(F (m)). Proof. Let K nd L e ccepted y NFAs A nd B respectively. If K nd L re unry then KL 1 = L 1 K. The right quotient KL 1 is recognized y n NFA otined from A y mking pproprite sttes finl. This gives upper ound O(F (m)) y determiniztion of 45

58 resulting unry NFA. For tightness let K e unry witness for determiniztion nd L = {ε}. Then KL 1 = K, nd the lower ound Ω(F (m)) follows from [9, Theorem 4.5]. 5.4 Conctention We conclude this chpter with the conctention opertion. Its the stte complexity is m2 n 2 n 1 [38] nd nondeterministic complexity is m + n [14]. The next theorem shows upper ound for NFA-to-DFA trde-off for conctention, 3 4 2m+n, which is tight in the ternry cse. For inry cse we show tht upper ound 2 m+n is symptoticlly tight. Theorem 5.15 (Conctention). Let K nd L e lnguges over Σ recognized y n m-stte nd n-stte NFA, respectively, where m, n 2. Then sc(kl) 3 4 2m+n nd this ound is tight if Σ 3. Proof. Let A = (Q A, Σ, A, s A, F A ) nd B = (Q B, Σ, B, s B, F B ) e NFAs recognizing K nd L, respectively, with Q A = m, Q B = n Construct n MNFA N for KL from NFAs A nd B s follows. For ech trnsition (p,, q) in NFA A with q F A, dd the trnsition (p,, s B ). The set of initil sttes of N is {s A } if s A / F A, or {s A, s B } if s A F A. The set of finl sttes of N is F B. The following condition holds in the suset utomton D(N): ech rechle suset contining stte from F A must contin the stte s B. This mens tht t lest 2 m+n 2 susets re unrechle in D(N), nd the upper ound follows. For tightness, consider the lnguges K nd L recognized y DFAs A nd B from Fig Construct n NFA N for KL from A nd B y dding the trnsitions (q 0, c, 0), (q m 1,, 0), nd (q i,, 0) for i = 1, 2,..., m 1. The initil sttes of N re q 0 nd 0. The c, c, c, c A q 0 q 1 q 2... q m 1,,,,, B 0 c 1 c 2 c... c n 1 Figure 5.12: Ternry witnesses for conctention meeting the upper ound 3 4 2n. 46

59 set of finl sttes is {n 1}. We first show tht the suset utomton D(N) hs 3 4 2m+n rechle sttes. Ech stte of D(N) consists of suset S of {q 0, q 1,..., q m 1 } nd suset T of {0, 1,..., n 1}; we denote such stte y (S, T ). Moreover hving q 0 S implies 0 T, so in totl we hve 3 4 2m+n such sttes. Let us show the rechility of ech such stte (S, T ). We remind Lemm 5.1 nd Lemm 5.2, where we show tht for every S there is word w S {, } such tht q 0 A w S = S, nd for every T there is word w T {, c} such tht 0 B w T = T. Now consider severl cses: (1) Let S =. The initil stte ({q 0 }, {0}) is sent to (, {0}) y, nd then to (, T ) y w T. (2) Let S nd 0 T. (2) Let S = {q 0 } nd 0 T. By induction on T we show tht ({q 0 }, T ) with 0 T is rechle. The se cse, T = {0}, holds true since ({q 0 }, {0}) is the initil stte of D(N). Assume tht the clim holds true for ech set of size k nd let T = k +1. Let T = {0, i 1,..., i k } where 0 < i 1 < < i k n 1. Set T = {0, i 2 i 1,..., i k i 1 }. Then T = k, so the pir ({q 0 }, T ) is rechle y induction. The pir ({q 0 }, T ) is rechle from ({q 0 }, T ) y m 1 c i 1. (2) Let q 0 S, where S 2 nd 0 T. The pir ({q 0 }, T ) is rechle s shown in cse (2) nd is sent to (S, T ) y w S since 0 T. (2c) Let q 0 / S, where 0 T. Let S = {q i1, q i2,..., q ik } where 1 i 1 < < i k m 1. Set S = {q 0, q i2 i 1,..., q ik i 1 }. Then (S, T ) is rechle s shown in (2) or (2) nd it is sent to (S, T ) y i 1. (3) Let S nd 0 / T. This mens tht q 0 / S. The pir (S, ) is reched from ({q 0 }, {0}) y w S c n. If T = {i 1,..., i k } where 1 i 1 < < i k n 1 we set T = {0, i 2 i 1,..., i k i 1 }. The pir (S, T ) is rechle s shown in cse (2) since 0 T nd it is sent to (S, T ) y c i 1 since q 0 / S. To prove distinguishility notice tht in N ech singleton set {j} is co-rechle vi word in c, the set {q 0 } is co-rechle y c n. For 1 i n 1 the set {q i } is corechle y c n n i since trnsitions on in utomton A form the cycle (q 0, q 1,..., q m 1 ). By Lemm 5.3 ll sttes of suset utomton D(N) re pirwise distinguishle. Now we show tht the upper ound 2 m+n is symptoticlly tight in the inry cse. 47

60 , A q 0 q, 1 q, 2..., q, m 2 q m 1,,, B ,, n 2 n 1 Figure 5.13: Binry NFAs A nd B with sc(l(a)l(b)) 1 4 2m+n. Theorem Let m, n 2 nd lnguges K nd L e defined y inry NFAs A nd B with m nd n sttes from Fig Then sc(kl) 1 4 2m+n. Proof. Construct n NFA for KL from NFAs A nd B y dding the trnsitions (q m 2,, 0) nd (q m 2,, 0). This NFA recognizes the inry lnguge ( + ) ( + ) m+n 3. It is well known tht every DFA for this lnguge hs t lest 2 m+n 2 sttes. Our next result provides lower nd upper ound on the NFA-to-DFA trde-off for conctention in the unry cse. Theorem Let K nd L e unry lnguges recognized y NFAs with m nd n sttes respectively. Then sc(kl) = O(F (m + n)). There exists lnguges K nd L such tht sc(kl) = Ω(mx{F (m), F (n)}). Proof. The upper ound O(F (m + n)) is given y the determiniztion of n (m + n)-stte unry NFA. The lower ound Ω(mx{F (m), F (n)}) is provided y the pirs of lnguges ({ε}, L) nd (K, {ε}). The previous shows tht the resulting complexity is exponentil either in m or in n. This contrsts the sitution for the str opertion, where the resulting complexity ws polynomil in n. 5.5 Conclusions We investigted the NFA-to-DFA trde-off for severl regulr opertions. Our results re summrized in Tle 5.1. The tle lso displys the size of lphet used to descrie our witnesses. Whenever we used inry lphet, it ws is lwys optiml in the sense tht the corresponding upper ounds cnnot e met y ny unry lnguges. 48

61 We conjecture tht the upper ounds on the stte complexity of Boolen opertions nd conctention cnnot e met y ny pir of inry lnguges. For unry conctention we provided n upper ound O(F (m + n)) nd lower ound Ω(mx{F (m), F (n)}). We leve the prolem of finding t lest symptoticlly tight upper ound for future reserch. NFA-to-DFA Σ Σ = 2 Σ = 1 str 2 n 2 2 n (n 1) complementtion 2 n 2 2 n Θ(F (n)) union 2 m+n 3 Θ(2 m+n ) Θ(F (m + n)) symmetric difference 2 m+n 3 Θ(2 m+n ) Θ(F (m + n)) intersection 2 m+n 2 m 2 n Θ(2 m+n ) Θ(F (m + n)) difference 2 m+n 2 n Θ(2 m+n ) Θ(F (m + n)) reversl 2 n 2 2 n Θ(F (n)) left quotient 2 m 2 2 m Θ(F (m)) right quotient 2 m 2 2 m Θ(F (m)) 3 conctention 4 2m+n 3 Θ(2 m+n ) Ω(mx{F (m), F (n)}) O(F (m + n)) Tle 5.1: The results on NFA-to-DFA trde-off for regulr opertions; F (n) = mx{lcm(x 1,..., x k ) x x k n} 2 n ln n. 49

62 Chpter 6 Summry nd Future Works This thesis investigted opertionl complexity on lnguges represented y different models of finite utomt. We strted with the squre opertion on deterministic finite utomt nd we showed how its stte complexity depends on the numer of finl sttes in DFA for given lnguge. The cse of just one non-finl stte, in which the resulting complexity is not given y the sme expression s for ny other cse, ppered to e very interesting. We did some computtions nd thnks to them we were le to get n upper ound, which depends on whether or not the initil stte is finl, s well s to descrie the corresponding witness lnguges. We used our inry witnesses with hlf of their sttes finl to descrie witness lnguges for the squre opertion on Boolen nd lternting utomt. Moreover, we proved tht our witnesses cn e used lso for the conctention opertion: we simply tke two utomt with the sme structure ut different numer of sttes. This provided n lterntive solution of n open prolem stted y Fellh et l. [13]. Then we determined the precise complexity for Boolen opertions, str, reversl nd quotients on Boolen nd lternting finite utomt. We used unry lphet to descrie witnesses for Boolen opertions, nd inry lphet for the others. We lso proved tht the inry lphet is lwys optiml y proving tht the complexity of the corresponding opertion on unry lnguges is smller thn tht in the cse of generl lphet. Finlly, we considered opertionl complexity providing tht the inputs of n opertion re given s nondeterministic finite utomt, while the resulting lnguge hs to e represented y deterministic finite utomton. We otined tight upper ounds for Boolen opertions, conctention, str, reversl nd quotients. To prove tightness, we used inry lphet for complementtion, str, reversl nd quotients, nd ternry lphet 50

63 for union, intersection, difference, symmetric difference nd conctention. Whenever we used inry lphet, it ws lwys optiml, nd we strongly conjecture tht the ternry lphet is optiml s well. Our computtions support this conjecture. On the other hnd, we proved tht the corresponding complexities in the inry cse re, up to multiplictive constnt, the sme s those for the generl cse. In the unry cse, we otined the precise complexity for str, nd symptoticlly tight upper ounds for Boolen opertions, reversl nd quotients. Some prolems remins open, nd we leve them for future reserch. We list couple of them in wht follows. The mgic numer prolem. When investigting the squre opertion on DFAs, we only considered the worst-cse complexity. Insted of this, the whole rnge of possile complexities is sometimes studied in the literture. The prolem is clled the mgic numer prolem, nd it ws first stted y Iwm et l. [18, 19]. For the squre opertion it reds s follows. Open prolem 1. Given miniml DFA A with n sttes, how mny sttes my the miniml DFA for the squre of L(A) hve? Formlly, we sk how does the set {sc(l 2 ) sc(l) = n} look like? Is it contiguous rnge of complexities from one up to the known upper ound, or re there ny gps, clled mgic numers, in this rnge? Our computtions show tht no mgic numers exist up to n = 9 lredy in the inry cse. Opertions on unry lnguges. When proving the optimlity of inry lphet used to descrie lower ound exmples for the AFA complexity of some opertions we otined only upper ounds on the complexity for corresponding opertions in the unry cse. They differ from the lower ounds given y the BFA complexity of these opertions y one. We do not know whether or not this "plus one" is necessry. Open prolem 2. Wht is the complexity of conctention, squre, str nd quotients on lnguges represented y unry AFAs? In the cse of generl lphet we were le to find lnguges recognized y DFAs with hlf of their sttes finl tht were hrd enough for n opertion on DFAs, nd then we proved tht the reversl of these lnguges re hrd for the opertion on AFAs. However, in the unry cse such lnguges re not known. 51

64 Open prolem 3. Wht is the complexity of conctention, squre, str nd quotients on lnguges represented y unry DFAs with hlf of their sttes finl? Notice tht the complexity of complementtion nd reversl in such cse is n, nd those of union, intersection, difference nd symmetric difference is given y Lemm 4.2. For NFA-to-DFA trde-off in the cse of conctention on unry lnguges we hve n upper ound O(F (m + n)) nd lower ound Ω(mx{F (m), F (n)}). This is the only cse in which we were not le to get t lest symptoticlly tight upper ound. Open prolem 4: Wht is the NFA-to-DFA trde-off for conctention in the unry cse? We conjecture tht our lower ound Ω(mx{F (m), F (n)}) could e symptoticlly tight. Optimlity of ternry lphet. All witness lnguges in this thesis were descried over n optiml lphet, except for those for the NFA-to-DFA trde-offs in the cse of Boolen opertion nd conctention where we used ternry lphet. Open prolem 5. Is the ternry lphet used to descrie witnesses for NFA-to-DFA trde-off in the cse of conctention nd Boolen opertions optiml? Our computtions show the tht corresponding upper ounds cnnot e met in the inry cse, nd we strongly conjecture tht the ternry lphet is optiml here. Nondeterministic finite utomt with existentil nd universl sttes. Sometimes, in contrst to [8, 13, 54], lternting utomt re defined s nondeterministic utomt with existentil nd universl sttes. This mens tht the result of the trnsition function is lwys disjunction if the corresponding stte is n existentil stte nd it is conjunction otherwise. We cn show tht such n utomton cn e simulted y DFA with t most M(n) + 2 sttes where M(n) is the Dedekind numer tht counts the numer of nti-chins of susets of set with n elements. However, we do not know whether or not this upper ound is tight. Open prolem 6. How mny sttes re sufficient nd necessry in the worst cse for DFA to simulte n n-stte NFA with existentil nd universl sttes? The opertionl complexity on such model of lternting utomt is of gret interest for us s well. 52

65 Biliogrphy [1] Assent, I., Seiert, S.: An upper ound for trnsforming self-verifying utomt into deterministic ones. RAIRO - Theor. Inf. nd Applic. 41(3), (2007), [2] Bermn, P., Lings, A.: On the complexity of regulr lnguges in terms of finite utomt. Technicl Report 304, Polish Acdemy of Sciences (1977) [3] Birget, J.: Intersection nd union of regulr lnguges nd stte complexity. Inform. Process. Lett. 43(4), (1992), [4] Brzozowski, J.A., Leiss, E.L.: On equtions for regulr lnguges, finite utomt, nd sequentil networks. Theoret. Comput. Sci. 10, (1980), org/ / (80) [5] Câmpenu, C., II, K.C., Slom, K., Yu, S.: Stte complexity of sic opertions on finite lnguges. In: Boldt, O., Jürgensen, H. (eds.) WIA 1999, LNCS. Lecture Notes in Computer Science, vol. 2214, pp Springer (1999), org/ / _6 [6] Câmpenu, C., Slom, K., Yu, S.: Tight lower ound for the stte complexity of shuffle of regulr lnguges. J. Autom. Lng. Com. 7(3), (2002) [7] Čevorová, K., Jirásková, G., Krjňáková, I.: On the squre of regulr lnguges. In: Holzer, M., Kutri, M. (eds.) CIAA LNCS, vol. 8587, pp Springer (2014), [8] Chndr, A.K., Kozen, D., Stockmeyer, L.J.: Alterntion. J. ACM 28(1), (1981), 53

66 [9] Chrok, M.: Finite utomt nd unry lnguges. Theoret. Comput. Sci. 47(3), (1986), [10] Cui, B., Go, Y., Kri, L., Yu, S.: Stte complexity of two comined opertions: Ctention-union nd ctention-intersection. Int. J. Found. Comput. Sci. 22(8), (2011), [11] Domrtzki, M.: Stte complexity of proportionl removls. J. Autom. Lng. Com. 7(4), (2002), [12] Domrtzki, M., Okhotin, A.: Stte complexity of power. Theoret. Comput. Sci. 410(24-25), (2009). [13] Fellh, A., Jürgensen, H., Yu, S.: Constructions for lternting finite utomt. Interntionl journl of computer mthemtics 35(1-4), (1990), dx.doi.org/ / [14] Holzer, M., Kutri, M.: Nondeterministic descriptionl complexity of regulr lnguges. Internt. J. Found. Comput. Sci. 14(6), (2003), org/ /s [15] Hopcroft, J.E., Ullmn, J.D.: Introduction to Automt Theory, Lnguges nd Computtion. Addison-Wesley (1979) [16] Hospodár, M., Jirásková, G.: Conctention on deterministic nd lternting utomt. In: Bordihn, H., Freund, R., Ngy, B., Vszil, G. (eds.) NCMA vol. 321, pp Österreichische Computer Gesellschft (2016) [17] Hospodár, M., Jirásková, G.: The complexity of conctention on deterministic nd lternting finite utomt. RAIRO - Theor. Inf. nd Applic. 52(2-3-4), (2018), [18] Iwm, K., Kmyshi, Y., Tkki, K.: Tight ounds on the numer of sttes of DFAs tht re equivlent to n-stte NFAs. Theoret. Comput. Sci. 237(1-2), (2000), [19] Iwm, K., Mtsuur, A., Pterson, M.: A fmily of NFAs which need 2n α deterministic sttes. Theoret. Comput. Sci. 301(1-3), (2003), org/ /s (02)

67 [20] Jirásek, J., Jirásková, G., Szri, A.: Stte complexity of conctention nd complementtion. Internt. J. Found. Comput. Sci. 16(3), (2005), http: //dx.doi.org/ /s [21] Jirásek, J.Š., Jirásková, G., Szri, A.: Opertions on self-verifying finite utomt. In: Beklemishev, L.D., Mustov, D.V. (eds.) CSR LNCS, vol. 9139, pp Springer (2015), [22] Jirásek, J., Jr., Jirásková, G., Šeej, J.: Opertions on unmiguous finite utomt. In: Brlek, S., Reutenuer, C. (eds.) DLT LNCS, vol. 9840, pp Springer (2016), [23] Jirásek, J., Jr., Jirásková, G., Šeej, J.: Opertions on unmiguous finite utomt. Internt. J. Found. Comput. Sci. 29(5), (2018), /S X [24] Jirásková, G.: Stte complexity of some opertions on inry regulr lnguges. Theoret. Comput. Sci. 330(2), (2005), tcs [25] Jirásková, G.: Descriptionl complexity of opertions on lternting nd oolen utomt. In: Hirsch, E.A., Krhumäki, J., Lepistö, A., Prilutskii, M. (eds.) CSR LNCS, vol. 7353, pp Springer (2012), _19 [26] Jirásková, G., Krjnáková, I.: Squre on deterministic, lternting, nd oolen finite utomt. Internt. J. Found. Comput. Sci. 30(6-7), (2019), https: //doi.org/ /s [27] Jirásková, G., Okhotin, A.: Stte complexity of cyclic shift. RAIRO - Theor. Inf. nd Applic. 42(2), (2008), [28] Jirásková, G., Okhotin, A.: On the stte complexity of str of union nd str of intersection. Fundm. Inform. 109(2), (2011), FI [29] Jirásková, G., Pighizzini, G.: Optiml simultion of self-verifying utomt y deterministic utomt. Inform. nd Comput. 209(3), (2011), org/ /j.ic

68 [30] Jirásková, G., Šeej, J.: Reversl of inry regulr lnguges. Theoret. Comput. Sci. 449, (2012), [31] Krjňáková, I.: Operáci štvorec n jzykoch reprezentovných deterministickými, lternujúcimi Booleovskými utomtmi. Mster s thesis, Univerzit Pvl Jozef Šfárik v Košicih, Košice (2016), in Slovk [32] Krjňáková, I., Jirásková, G.: Squre on deterministic, lternting, nd oolen finite utomt. In: Pighizzini, G., Câmpenu, C. (eds.) DCFS LNCS, vol , pp Springer (2017), _17 [33] Leiss, E.L.: Succint representtion of regulr lnguges y oolen utomt. Theoret. Comput. Sci. 13, (1981), [34] Leung, H.: Seprting exponentilly miguous finite utomt from polynomilly miguous finite utomt. SIAM J. Comput. 27(4), (1998), doi.org/ /s [35] Leung, H.: Descriptionl complexity of NFA of different miguity. Internt. J. Found. Comput. Sci. 16(5), (2005), S [36] Liu, G., Mrtín-Vide, C., Slom, A., Yu, S.: Stte complexity of sic lnguge opertions comined with reversl. Inform. nd Comput. 206(9-10), (2008), [37] Lupnov, O.B.: A comprison of two types of finite utomt. Prolemy Kiernetiki 9, Kiernetiki (1963), (in Russin) Germn trnsltion: Üer den Vergleich zweier Typen endlicher Quellen. Proleme der Kyernetik 6, (1966) [38] Mslov, A.N.: Estimtes of the numer of sttes of finite utomt. Soviet Mth. Dokldy 11(5), (1970) [39] Meyer, A.R., Fischer, M.J.: Economy of description y utomt, grmmrs, nd forml systems. In: Proceedings of the 12th Annul Symposium on Switching nd Automt Theory. pp IEEE Computer Society Press (1971), doi.org/ /t-c

69 [40] Mirkin, B.G.: On dul utomt. Kiernetik (Kiev) 2 (1966), pp (in Russin). English trnsltion: Cyernetics 2, pp. 6 9 (1966) [41] Moon, J., Moser, L.: On cliques in grphs. Isrel Journl of Mthemtics 3, (1965), [42] Moore, F.R.: On the ounds for stte-set size in the proofs of equivlence etween deterministic, nondeterministic, nd two-wy finite utomt. IEEE Trns. Comput. 20(10), (1971), [43] Nicud, C.: Averge stte complexity of opertions on unry utomt. In: Kutylowski, M., Pcholski, L., Wierzicki, T. (eds.) MFCS LNCS, vol. 1672, pp Springer (1999), [44] Plmovský, M.: Kleene closure nd stte complexity. RAIRO - Theor. Inf. nd Appl. 50(3), (2016), [45] Pighizzini, G., Shllit, J.O.: Unry lnguge opertions, stte complexity nd jcosthl s function. Internt. J. Found. Comput. Sci. 13(1), (2002), https: //doi.org/ /s x [46] Rin, M.O., Scott, D.S.: Finite utomt nd their decision prolems. IBM J. Res. Dev. 3(2), (1959), [47] Rmpersd, N.: The stte complexity of L 2 nd L k. Inform. Process. Lett. 98(6), (2006), [48] Rskin, M.A.: A superpolynomil lower ound for the size of non-deterministic complement of n unmiguous utomton. In: Chtziginnkis, I., Kklmnis, C., Mrx, D., Snnell, D. (eds.) ICALP LIPIcs, vol. 107, pp. 138:1 138:11. Schloss Dgstuhl - Leiniz-Zentrum für Informtik (2018), /LIPIcs.ICALP [49] Slom, A., Slom, K., Yu, S.: Stte complexity of comined opertions. Theoret. Comput. Sci. 383(2-3), (2007), [50] Schmidt, E.M.: Succinctness of description of context-free, regulr, nd finite lnguges. Ph. D. thesis. Cornell University (1978) 57

70 [51] Sipser, M.: Introduction to the theory of computtion. PWS Pulishing Compny (1997), [52] Šeej, J.: Reversl of regulr lnguges nd stte complexity. In: Prduská, D. (ed.) ITAT CEUR Workshop Proceedings, vol. 683, pp CEUR-WS.org (2010), [53] Yershov, Yu.L.: On conjecture of V. A. Uspenskii. Alger i logik 1, (1962), (in Russin) [54] Yu, S.: Chpter 2: Regulr lnguges. In: Rozenerg, G., Slom, A. (eds.) Hndook of Forml Lnguges, Vol. 1, pp Springer (1997), / _2 [55] Yu, S., Zhung, Q., Slom, K.: The stte complexities of some sic opertions on regulr lnguges. Theoret. Comput. Sci. 125(2), (1994), org/ / (92)00011-f 58

71 Appendix The list of pulished ppers Journl ppers: 1. Glin Jirásková, Ivn Krjňáková: Squre on deterministic, lternting, nd Boolen finite utomt. Interntionl Journl of Foundtions of Computer Science 30(6 7), pp (2019). ISSN: , DOI: /S Conference ppers: 2. Kristín Čevorová, Glin Jirásková, Ivn Krjňáková: On the squre of regulr lnguges In: Mrkus Holzer, Mrtin Kutri (eds.): Implementtion nd Appliction of Automt - 19th Interntionl Conference, CIAA 2014, Giessen, Germny, July 30 - August 2, Proceedings. Lecture Notes in Computer Science, vol. 8587, pp , Springer (2014). ISBN: , DOI: / _10 3. Glin Jirásková, Ivn Krjňáková: Squre on deterministic, lternting, nd Boolen finite utomt. In: Giovnni Pighizzini, Cezr Câmpenu (eds.): Descriptionl Complexity of Forml Systems 19th IFIP WG 1.02 Interntionl Conference, DCFS 2017, Milno, Itly, July 3-5, 2017, Proceedings. Lecture Notes in Computer Science, vol , pp , Springer (2017). ISBN: , DOI: / _17 4. Michl Hospodár, Glin Jirásková, Ivn Krjňáková: Opertions on Boolen nd lternting utomt. In: Fedor V. Fomin, Vldimir V. Podolskii (eds.): Computer Science Theory nd Applictions 13th Interntionl Computer Science Symposium in Russi, CSR 2018, Moscow, Russi, June 6 10, 2018, Proceedings. 59

72 Lecture Notes in Computer Science, vol , pp , Springer (2018). ISBN: , DOI: / _16 5. Glin Jirásková, Ivn Krjňáková: NFA-to-DFA trde-off for regulr opertions. In: Michl Hospodár, Glin Jirásková, Stvros Konstntinidis (eds.): Descriptionl Complexity of Forml Systems - 21st IFIP WG 1.02 Interntionl Conference, DCFS 2019, Košice, Slovki, July 17-19, 2019, Proceedings. Lecture Notes in Computer Science, vol , pp , Springer (2019). ISBN: , DOI: / _14 The list of given tlks 1. Squre on deterministic nd lternting finite utomt. The Second Workshop on Černý s Conjecture nd Optimiztion Prolems on Finite Automt. Opv, Czech Repulic, My 17, Squre on deterministic, lternting, nd Boolen finite utomt. 19th Interntionl Conference on Descriptionl Complexity of Forml Systems, DCFS Milno, Itly, July 3-5, NFA-to-DFA trde-off for regulr opertions. 21th Interntionl Conference on Descriptionl Complexity of Forml Systems, DCFS Košice, Slovki, July 17-19,

73 61

74 Appendix [A] Glin Jirásková, Ivn Krjňáková: Squre on deterministic, lternting, nd Boolen finite utomt. Interntionl Journl of Foundtions of Computer Science, 30(6-7), (2019). ISSN: DOI: /S

75 Interntionl Journl of Foundtions of Computer Science Vol. 30, Nos. 6 & 7 (2019) c World Scientific Pulishing Compny DOI: /S Squre on Deterministic, Alternting, nd Boolen Finite Automt Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Glin Jirásková nd Ivn Krjňáková Mthemticl Institute, Slovk Acdemy of Sciences Grešákov 6, Košice, Slovki Received 9 Novemer 2017 Accepted 5 June 2018 Communicted y C. Câmpenu nd G. Pighizzini We investigte the stte complexity of the squre opertion on lnguges represented y deterministic, lternting, nd Boolen utomt. For ech k such tht 1 k n 2, we descrie inry lnguge ccepted y n n-stte deterministic finite utomton with k finl sttes meeting the upper ound n2 n k2 n 1 on the stte complexity of its squre. We show tht in the cse of k = n 1, the corresponding upper ound cnnot e met. Using the inry deterministic witness for squre with 2 n sttes where hlf of them re finl, we get the tight upper ounds 2 n + n + 1 nd 2 n + n on the complexity of the squre opertion on lternting nd Boolen utomt, respectively. 1. Introduction Squre is sic unry opertion on forml lnguges which is defined s L 2 = {uv u L nd v L}. It is known tht if lnguge L is ccepted y deterministic finite utomton (DFA) of n sttes, then the lnguge L 2 is ccepted y DFA of t most n2 n 2 n 1 sttes [9]. This upper ound ws proven to e tight in the inry cse y Rmpersd [11]. If the miniml DFA for L hs more thn one finl stte this upper ound cnnot e met. In such cse the upper ound is n2 n k2 n 1, where k is the numer of finl sttes in the miniml DFA for L [14]. In this pper, we study the stte complexity of the squre of lnguges ccepted y DFAs with more finl sttes. Our motivtion comes from the pper y Fellh, Jürgensen, nd Yu [4] on lternting finite utomt (AFAs). They provided n upper ound 2 n + n + 1 on the complexity of the squre of lnguge represented This work ws conducted s prt of PhD study of the first uthor t Comenius University in Brtislv, nd it ws presented t the DCFS 2017 conference held in Milno, Itly on July 3 5, 2017 nd its extended strct ppered in the conference proceedings: G. Pighizzini, C. Câmpenu (Eds.) Descriptionl Complexity of Forml Systems, LNCS 10316, pp Corresponding uthor. 1117

76 1118 G. Jirásková & I. Krjňáková Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. y n n-stte AFA. A lnguge is ccepted y n n-stte AFA if nd only if its reverse is ccepted y DFA with 2 n sttes where 2 n 1 of them re finl [1, 4, 7]. It follows tht to prove the tightness of the upper ound 2 n + n + 1, we need to find lnguge represented y DFA with hlf of the sttes finl which is hrd for the squre opertion on DFAs. The prolem seems to e interesting per se. Previously in Ref. [2], we tried to use Rmpersd s inry witness for squre [11] with k finl sttes insted of the originl one. We were le to show the rechility of n2 n k2 n 1 sttes in the suset utomton of n NFA for its squre. However, to prove distinguishility third letter ws needed, so the inry cse ws left open. Surprisingly, in Ref. [2], we were unle to prove the tightness of the upper ound in the cse of n 1 finl sttes. Here we solve oth these open prolems. We descrie inry lnguge ccepted y n n-stte DFA with k finl sttes meeting the upper ound n2 n k2 n 1 on the stte complexity of its squre provided tht 1 k n 2. In the cse of k = n 1 we prove tht the corresponding upper ound (2n+2)2 n 2 cnnot e met. To show it, we consider two cses. If the initil stte is finl, then we get the upper ound (n + 2)2 n 2, nd we show tht it is tight in the inry cse. If the initil stte is not finl the upper ound is (n + 3)2 n 2 nd is tight in the ternry cse. The tight ound for inry lnguges is (n + 3)2 n 2 1 in this cse. This solves the complexity of squre on DFAs completely. The inry lphet is optiml sincein the unry cse the known tight upper ound is 2n 1 [11]. Using these results we re le to descrie inry lnguge ccepted y n n-stte AFA such tht every AFA for its squre hs t lest 2 n + n + 1 sttes. This proves the tightness of the upper ound 2 n + n + 1 given in Ref. [4]. We lso consider Boolen finite utomt (BFA) [1], nd get the tight upper ound 2 n + n for the squre on BFAs. To prove these results, we tke the reversl of lnguge ccepted y DFA with 2 n sttes with hlf of them finl meeting the corresponding upper ound for squre on DFAs. Then this lnguge is ccepted y n n-stte BFA, nd we re le to prove tht every BFA for its squre hs t lest 2 n + n sttes. By more creful nlysis of the numer of finl sttes in the DFA for its squre, we get the lower ound 2 n + n + 1 for the squre opertion on AFAs. Our result cn e extended for the conctention opertion just y conctenting two of our utomt with different numers of sttes. This provides n lterntive proof of the tightness of the upper ound 2 m + n + 1 for the conctention opertion on lternting utomt with m nd n sttes [6]. 2. Preliminries Let Σ e finite lphet of symols. Then Σ denotes the set of words over Σ including the empty word ε. A lnguge is ny suset of Σ. The conctention of lnguges K nd L is the lnguge KL = {uv u K nd v L}. The squre of lnguge L is the lnguge L 2 = LL. The crdinlity of finite set A is denoted y A, nd its power-set y 2 A. The reder my refer to [5, 12, 13] for detils.

77 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1119 Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. A nondeterministic finite utomton (NFA) is quintuple A = (Q, Σ,, I, F ), where Q is finite set of sttes, Σ is finite non-empty lphet, : Q Σ 2 Q is the trnsition function which is nturlly extended to the domin 2 Q Σ, I Q is the set of initil sttes, nd F Q is the set of finl sttes. The lnguge ccepted y A is the set L(A) = {w Σ I w F }. For symol, we sy tht (p,, q) is trnsition in NFA A if q p, nd for word w, we write p w q if q p w. An NFA A is deterministic (DFA) (nd complete) if I = 1 nd q = 1 for ech q in Q nd ech in Σ. We write p = q insted of p = {q} in such cse. The stte complexity of regulr lnguge L, sc(l), is the smllest numer of sttes in ny DFA for L. Every NFA A = (Q, Σ,, I, F ) cn e converted to n equivlent DFA A = (2 Q, Σ,, I, F ), where R = R for ech R in 2 Q nd in Σ, nd F = {R 2 Q R F }. We cll the DFA A the suset utomton of the NFA A. The suset utomton my not e miniml since some of its sttes my e unrechle or equivlent to other sttes. A Boolen finite utomton (BFA) is quintuple A = (Q, Σ, δ, g s, F ), where Q is finite non-empty set of sttes, Q = {q 1,..., q n }, Σ is n input lphet, δ is the trnsition function tht mps Q Σ into the set B n of Boolen functions with vriles {q 1,..., q n }, g s B n is the initil Boolen function, nd F Q is the set of finl sttes. The trnsition function δ cn e extended to the domin B n Σ s follows: For llginb n, in Σ, nd w in Σ, we hve δ(g, ε) = g; if g = g(q 1,..., q n ), then δ(g, ) = g(δ(q 1, ),..., δ(q n, )); δ(g, w) = δ(δ(g, w), ). Next, let f = (f 1,..., f n ) e the Boolen vector with f i = 1 iff q i F. The lnguge ccepted y the BFA A is the set L(A) = {w Σ δ(g s, w)(f) = 1}. A Boolen finite utomton is clled lternting (AFA) if the initil function is projection g(q 1,..., q n ) = q i. For detils, the reder my referto [1, 4, 7, 8, 12]. The Boolen (lternting) stte complexity of L, sc(l)(sc(l)), is the smllest numer of sttes in ny BFA (AFA) for L. It is known tht lnguge L is ccepted y n n-stte BFA (AFA) if nd only if the lnguge L R is ccepted y n 2 n -stte DFA (with 2 n 1 finl sttes). Since this is the crucil oservtion used lter in the pper, we stte it in the next two lemms nd provide proof ides here. Lemm 1 (cf. [4] Theorem 4.1, Corollry 4.2 nd [7], Lemm 1). Let L e lnguge ccepted y n n-sttebfa (AFA). Then the reversl L R is ccepted y DFA of 2 n sttes (of which 2 n 1 re finl). Proof Ide. Let A = ({q 1, q 2,..., q n }, Σ, δ, g s, F ) e n n-stte BFA for L. Construct 2 n -stte NFA A = ({0, 1} n, Σ, δ, S, {f}), where for every u = (u 1..., u n ) {0, 1} n nd every Σ, δ (u, ) = {u {0, 1} n δ(q i, )(u ) = u i for i = 1,..., n}; S = {( 1,..., n ) {0, 1} n g s ( 1,..., n ) = 1}; f = (f 1,..., f n ) {0, 1} n with f i = 1 iff q i F.

78 1120 G. Jirásková & I. Krjňáková Then L(A) = L(A ) nd (A ) R is deterministic. Moreover if A is n AFA then A hs 2 n 1 initil sttes. It follows tht L R is ccepted y DFA with 2 n sttes, of which 2 n 1 re finl if A is n AFA. Corollry 2. If L is regulr lnguge, then sc(l) log(sc(l R )) nd sc(l) log(sc(l R )). Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Lemm 3 (cf. [7], Lemm 2). Let L R e ccepted y DFA A of 2 n sttes (of which 2 n 1 re finl). Then L is ccepted y n n-stte BFA (AFA). Proof Ide. Consider 2 n -stte NFA A R for L which hsexctly one finl stte nd the set of initil sttes S (nd S = 2 n 1 ). Let the stte set Q of A R e {0, 1,..., 2 n 1} with finl stte k nd the initil set S (S = {2 n 1,..., 2 n 1}). Let δ e the trnsition function of A R. Moreover, for every Σ nd for every i Q, there is exctly one stte j such tht j goes to i on in A R. For stte i Q, let in(i) = ( 1,..., n ) e the inry n-tuple such tht 1 2 n is the inry nottion of i on n digits with leding zeros if necessry. Let us define n n-stte BFA A = (Q, Σ, δ, g s, F ), where Q = {q 1,..., q n }, F = {q l in(k) l = 1}, nd g s (in(i)) = 1 iff i S (g s = q 1 ). We define δ to stisfy the condition: for ech i in Q nd in Σ, (δ (q 1, ),..., δ (q n, ))(in(i)) = in(j) where i δ(j, ). Then L(A ) = L(A R ). 3. Squre on DFAs Let us egin with the precise method to construct n NFA for the squre of some lnguges ccepted y miniml DFA with n sttes. Construction 4. (DFA A NFA N for L 2 (A)) Let A = ({q 0, q 1,..., q n 1 }, Σ,, q 0, F A ) e miniml DFA. We construct NFA N = ({q 0, q 1,..., q n 1 } {0, 1,..., n 1}, Σ,, I, F N ) s follows: () tke A nd dd copy of A with the stte set {0, 1,..., n 1}; () for ech symol nd ech stteq i with q i F A, dd trnsition (q i,, 0); (c) the set of initil sttes of N is I = {q 0 } if q 0 / F, nd I = {q 0, 0}otherwise; (d) the set of finl sttes of N is F N = {j {0, 1,..., n 1} q j F A }. Proposition 5 (Upper Bound). Let L e lnguge with sc(l) = n, nd let the miniml DFA for L hve k finl sttes. Then sc(l 2 ) n2 n k2 n 1. Proof. Let L e ccepted y DFA A = ({q 0, q 1,..., q n 1 }, Σ,, q 0, F A ) nd let F A = k. Construct n NFA N for L 2 s descried ove. Since A is deterministic, every rechle suset in the suset utomton of N is in the form of {q i } S, where S {0, 1,..., n 1}. Furthermore, if q i is finl stte of A, then 0 S ecuse of the used construction. It follows tht susets contining finl stte of

79 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1121 A nd missing 0 re unrechle. Hence the suset utomton of N hs t most n2 n k2 n 1 rechle sttes. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Notice tht the upper ound given y the ove proposition is mximl if k = 1, nd it is n2 n 2 n 1 in this cse. The inry witness lnguge meeting this ound ws presented y Rmpersd in 2006 [11]. Theorem 6 ([11], Theorem 1). For every n 3, there exists DFA M with n sttes such tht the miniml DFA for the lnguge L 2 (M) hs n2 n 2 n 1 sttes. Unfortuntely, the squre of Rmpersd s utomton with k finl sttes does not meet the upper ound on the stte complexity in the generl cse. Here we provide the inry witness utomton with k finl sttes tht meets the upper ound n2 n k2 n 1. Theorem 7. Let n 3 nd 1 k n 2. Then there exists miniml n-stte DFA A with k finl sttes defined over inry lphet such tht every DFA for L(A) 2 hs t lest n2 n k2 n 1 sttes. Proof. Let us tke n-stte DFA A = ({q 0, q 1,..., q n 1 }, Σ,, q 0, F A ) with k finl sttes shown in Fig. 1. Notice tht q 0 nd q 1 remin non-finl with every k in this DFA nd there re two cycles; one on, (q 0, q 1,..., q n 1 ) of length n nd the second on, (q 2, q 3,..., q n 1 ) of lengthn 2. Let us uild n NFA N for L(A) 2 s in Construction 4. An exmple of NFA N if n = 6 nd k = 2 is shown in Fig. 2. We oserve tht there re only two types of sttes rechle in the suset utomton of N: {q i } S, where S {0, 1,..., n 1} nd 0 i n k 1; {q i, 0} S, where S {1,..., n 1} nd n k i n 1. We denote this fmily of sets s R. We cn see tht in the fmily R there re exctly (n k)2 n sets of the first type nd k2 n 1 sets of the second type. Hence the fmily R consists of (n k)2 n + k2 n 1 = n2 n k2 n 1 sets. Our gol is to show tht the sets in R re rechle nd lso pirwise distinguishle in the suset utomton of N. Let us strt with rechility. We use mthemticl induction y numer of elements in set/stte. The sets with one nd two elements re rechle, ecuse: {q 0 } {q 1 } {q n k 1 } {q n k, 0}, q 0 q 1 q 2... q α q α+1... q n 1 Fig. 1. A witness DFA A with k finl sttes meeting theound n2 n k2 n 1, where α = n k 1.

80 1122 G. Jirásková & I. Krjňáková Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. q 0 q 1 q 2 q 3 q 4 q 5,, Fig. 2. NFA N for the squre of L(A), if n = 6 nd k = 2. {q n k, 0} {q n k+1, 0} {q n 2, 0} {q n 1, 0}, {q n 1, 0} {q 0, 1} {q 0, 0}, {q 0, 1} {q 1, 2} {q 0, 3} {q 0, 4} {q 0, n 1} {q 0, 2}, {q 0, (j i) mod n} i {q i, j} for i = 0, 1,..., n k 1 nd j = 0, 1,..., n 1. Assume now tht every set in R with t elements is rechle. We show tht then every set in R of size t + 1 is rechle. Let S = {q i, s 1, s 2,..., s t } e our desired set in R of sizet + 1, where q i Q nd 0 s 1 < s 2 < < s t n 1. We del with three cses: (1) We show the rechility of sets of the second type, so let n k i n 1 nd therefore s 1 = 0. We cn write i s i = α + β, where α = n k 1 nd 1 β k, so our desired set is S = {q α+β, 0, s 2, s 3,..., s t }. Let s 2 = 1, nd tke the set {q α+β 1, 0, s 3 1,..., s t 1}, which is in R nd is rechle ecuse it hs t elements; recll tht the trnsitions on form the cycle (q 2, q 3,..., q n 1 ) in A. Then we hve {q α+β 1, 0, s 3 1,..., s t 1} {q α+β, 0, 1, s 3,..., s t } = S. Let s 2 2 nd tke the set {q α, s 2 n 1 β 1,..., s t n 1 β 1}, which is in R nd is rechle ecuse it hs t elements. Then we hve {q α, s 2 n 1 β 1,..., s t n 1 β 1} {q α+1, 0, s 2 n 1 β,..., s t n 1 β } β 1 {q α+β, 0, s 2 n 2,..., s t n 2 } = {q α+β, 0, s 2,..., s t } = S. (2) Next we show the rechility of sets of the first type in the next two steps. Let i = 0. We distinguish etween three cses of s 1.

81 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1123 Firstly let s 1 = 0. We strt from the set reched previously in (1) to chieve S in cse of s 2 = 1 y {q n 1, 0, s 3 1,..., s t 1, n 1} {q 0, 0, 1, s 3,..., s t } = S. Otherwise, if desired s 2 2, we rech S using previously reched set {q 0, 0, 1, s 3 s 2 + 1,..., s t s 2 + 1} {q 1, 1, 2, s 3 s 2 + 2,..., s t s 2 + 2} n 2 {q 0, 0, 2, s 3 s 2 + 2,..., s t s 2 + 2} s 2 2 {q 0, 0, s 2,..., s t } = S. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Secondly let s 1 1. Then the set S = {q n 1, 0, s 2 s 1,..., s t s 1 } is reched in (1). If s 1 = 1, then S S, otherwise s1 2, nd S n 2 s 1 2 S. (3) Let 1 i n k 1. Now we cn rech the remining sets of the first type using sets chieved in (2) like this {q 0, (s 1 i) mod n,..., (s t i) mod n} i {q i, s 1,..., s t } = S. Let us continue with proving distinguishility of reched sets. Note tht in N we hve {n 1} {2} {3} n 2 {3} n 2 {4} n 2 n 2 {n 1}. This mens tht the word w = ( n 2 ) n 3 is ccepted from the stte n 1. Let us red w from different stte t, 2 t n 2. First we hve t {3, 4,..., n 1}. Next {3, 4,..., n 1} ( n 2 ) n 3 = {0}, so w is not ccepted from t. Similrly, reding w from {0, 1} results in the set {0}, thus w is not ccepted from {0, 1} either. Moreover, w is not ccepted from {q i }, ecuse {q i } w {q j, 0}, where either j = 0 if i < n 1, or j = n 1 if i = n 1. Therefore w is ccepted y N from nd only from the stte n 1. Notice tht ech stte t in {1, 2,..., n 1} hs exctly one in-trnsition on going from the stte t 1, so the word n 1 t w is ccepted y N only from stte t, 0 t n 2. It follows tht two sets {q i } S nd {q j } T in R re distinguishle if S T. Now consider two distinct susets {q i } S nd {q j } S in R. Without loss of generlity, we hve 0 i < j n 1. We will discuss three cses: (1) Let i = 0 nd j = 1. Then {q 0 } S (n 2 ) n 2 {q 0, 0} {q 1, 1} n k 1 {q n k, 0, n k}, {q 1 } S (n 2 ) n 2 {q n 1, 0} {q 0, 1} n k 1 {q n k 1, n k}. Now we cn distinguish these sets ecuse they differ in the element from the second utomton copy. (2) Let i = 0 nd j 2. Then {q 0 } S n 1 j {q 1 } S 1, {q j } S n 1 j {q 0 } S 1, for some susets S 1, S 1 of {0, 1,..., n 1}. If the susets S 1 nd S 1 re the sme, then we continue s in (1), otherwise we continue s in cse of S T.

82 1124 G. Jirásková & I. Krjňáková (3) Let i 1. Then {q i } S n j {q i+(n j) } S 1, {q j } S n j {q 0 } S 1. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Similrly s in (2), if the susets S 1 nd S 1 re the sme we continue s in (1) or (2), otherwise we continue s in cse of S T Squre for DFAs with n 1 finl sttes Recll tht the utomton in the proof of Theorem 7 must hve t lest two nonfinl sttes. We show tht for every lnguge L ccepted y n n-stte DFA A = (Q, Σ,, q 0, F ) with single non-finl stte, the stte complexity of L 2 never meets the upper ound set in Proposition 5. In prticulr, weshow: () if q 0 F, then sc(l 2 ) (n + 2)2 n 2 nd this ound is tight if Σ 2; () if q 0 / F, then sc(l 2 ) (n + 3)2 n 2 nd this ound is tight if Σ 3. Moreover we show tht the upper ound (n + 3)2 n 2 in the cse q 0 / F cnnot e met y ny inry lnguge, nd tht the tight upper ound in the inry cse is (n + 3)2 n 2 1. Firstly let us consider the cse of F = n 1 nd q 0 F. Lemm 8. Let n 3 nd let L e regulr lnguge ccepted y n n-stte DFA A = (Q, Σ,, q 0, F ) with n 1 finl sttes, where q 0 F. Then sc(l 2 ) (n+2)2 n 2, nd this ound is tight if Σ 2. Proof. The formul for the upper ound is sed on the oservtion tht q 0 is initil nd lso ccepting in A, so the initil stte in the suset utomton for L(A) 2 is {q 0, 0}. It follows tht for every i {0, 1,..., n 1} if {q i } X is rechle, then i X. So we consider the following fmily R of possile rechle sets in the suset utomton for L(A) 2 : R = { {q 0, 0} X X {1, 2,..., n 1} } { {q 1, 1} X X {0, 2, 3,..., n 1} } { {q i, 0, i} X 2 i n 1, X {1, 2,..., n 1}\{i} }, where we ssume tht q 1 is the only non-finl stte. Notice tht this fmily consists of (n+2)2 n 2 sets. Hence sc(l 2 ) (n+2)2 n 2. To prove the tightness of this upper ound, we introduce the DFA A shown in Fig. 3 nd we show tht every DFA for L(A) 2 hs t lest (n + 2)2 n 2 sttes. Construct n NFA N for L(A) 2 s descried in Construction 4. We wnt to show tht ech set in R is rechle in the suset utomton of N nd tht ll these sets re pirwise distinguishle.

83 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1125 q 0 q 1 q 2, q 3,..., q n 1 Fig. 3. A witness DFA A with n 1 finl sttes meeting the ound (n + 2)2 n 2, where q 0 F. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Firstly, we prove rechility y induction on the size of the susets. The sis, where S = 2, holds true since {q 0, 0} is the initil suset, nd it goes to {q 1, 1} y. Now, let 2 t n nd ssume tht ech set in R of size t is rechle. Let S = {q i, s 1, s 2,..., s t }, where 0 i n 1, e set in R of size t + 1. If i = 0, then we hve 0 = s 1 < s 2 < < s t n 1. If i = 1, then we hve s 1 = 0 nd 1 = s 2 < < s t n 1. If i 2, then s 1 = 0, s 2 = i nd 1 s 3 < < s t n 1. We consider severl cses: (1) Let i = 2 nd thus s 1 = 0 nd s 2 = i = 2. Then {q 1, 1, s 3 1,..., s t 1} {q 2, 0, 2, s 3,..., s t }. The former set is rechle y the induction hypothesis. (2) Let i 3, so s 1 = 0 nd s 2 = i. Then {q 2, 0, 2, s 3 n 2 i+2,..., s t n 2 i+2 } i 2 {q i, 0, i, s 3,..., s t } nd the set on the left ws reched in (1). (3) Let i = 0 nd thus s 1 = 0. (3) Let s 2 = 1. Then {q n 1, 0, n 1, s 3 1,..., s t 1} {q 0, 0, 1, s 3,..., s t }. The former set is considered in cse (2). (3) Let s 2 2. Then we hve {q 0, 0, 1, s 3 s 2 + 1,..., s t s 2 + 1} {q 1, 1, 2, s 3 s 2 +2,..., s t s 2 +2} n 2 {q 0, 0, 2, s 3 s 2 +2,..., s t s 2 +2} s 2 2 {q 0, 0, s 2, s 3,..., s t }. The first set in this chin is considered in cse (3). (4) Let i = 1 (s 1 = 1). Then we hve {q 0, 0, s 2 1, s 3 1,..., s t 1} {q 1, 1, s 2, s 3,..., s t }. The former set is considered in (3). This proves rechility. Secondly we prove distinguishility y nlysing possile cses of two distinct sttes p = {q i } S nd q = {q j } T. Notice tht the word n 2 performs the trnsformtion 2 n 2 3 n 2 n 2 n 1 n 2 0 n 2 0 nd 1 n 2 0, so y reding the word ( n 2 ) n 3 the stte q 2 is sent to q n 1 while every other stte is sent to q 0. It follows tht theword ( n 2 ) n 3 is ccepted only from the stte q 2 nd the word ( n 2 ) n 3 is ccepted only from the stte q n 1. Finlly, for ech t, 0 t n 1, the word n 1 t ( n 2 ) n 3 is ccepted y NFA N only from stte t. It follows tht the sets {q i } S nd {q j } T re distinguishle if S T. Consider now the opposite sitution, tht two sets p nd q differ only in i or j, tht is, S = T nd without loss of generlity 0 i < j n 1.

84 1126 G. Jirásková & I. Krjňáková (1) Let i = 0 nd j = n 2. Then {0, n 2} S. We use n 2 to get {q 0, 0} S 1 nd {q n 2, 0} S 1 where S 1 {2, 3,..., n 1}. Now, if n 1 / S 1, we use to get {q 1, 1} S 1 nd {q n 1, 0, 1} S 1 which differ in stte 0, nd so re distinguishle. If n 1 S 1, we use n 2 to get {q 0, 0} S 2 nd {q n 2, 0} S 2 where S 2 {2, 3,..., n 1} nd S 2 < S 1. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. We use the sme rgument to S 2. If stte n 1 is in ll the resulting sets, then we eventully get {q 0, 0, n 2} nd {q n 2, 0, n 2}. Finlly we use to get {q 1, 1, n 1} nd {q n 1, 0, 1, n 1}, which differ in stte 0. (2) Let i = 0, 2 j n 3. We red n 2 j nd get {q 0 } S nd {q n 2 } S which is considered in cse (1). (3) Let i = 0 nd j = 1. Here we red nd get {q 0, 0} S 1 nd {q 3, 0} S 1. If S 1 S 1 then we cn continue s in cse S T, otherwise s in cse (2). (4) Let i = 0, j = n 1. We red nd get {q 1 } S nd {q 0 } S which is considered in cse (3). (5) Let 1 i < j n 1. We red n j nd get {q n j+i } S nd {q 0 } S which is considered in cses (1) (4). Now let us consider the cse where F = n 1nd q 0 / F. Lemm 9. Let n 3. Let L e regulr lnguge ccepted y n n-stte DFA A = (Q, Σ,, q 0, F ), where F = n 1 nd q 0 / F. Then sc(l 2 ) (n + 3)2 n 2, nd the ound is tight if Σ 3. The ound (n + 3)2 n 2 1 cn e met y inry lnguge. Proof. We strt with the upper ound. Suppose we hve constructed n NFA N from the DFA A s descried in Construction 4. Consider the corresponding suset utomton of N. We first show tht two distinct susets of this utomton, {q i } S nd {q j } S, where {i, j} S re equivlent. If word w is rejected from stte {q i } S then s w 0 for ech element s in S. It follows thtw is rejected from {q j } S ecuse {q j } S w {q 0, 0}. Likewise, if w is rejected from {q j } S then w is rejected from {q i } S. Excluding these equivlents susets gives us the fmily R of (n+3)2 n 2 rechle nd pirwise distinguishle susets of the suset utomton of N, which is: R = {{q 0 } X X {0, 1,..., n 1}} {{q i } X X {0, 1,..., n 1}, 0 X, i / X}. To prove the tightness of this upper ound, we introduce the DFA B shown in Fig. 4 nd we show tht every DFA for L(B) 2 hs t lest (n + 3)2 n 2 sttes. Construct n NFA N for the squre of L(B) 2 s descried in Construction 4. Let us show tht ech set in R is rechle in the suset utomton of N nd tht ll these sets re pirwise distinguishle.

85 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1127 q,,,, 0 q 1 q 2 q 3... q n 2 q n 1 Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Fig. 4. A inrydfa B with sc(l 2 (B)) = (n + 3)2 n 2 1. We prove the rechility y induction on the size of susets. The sis, where S 2, holds true up to one set, nmely {q 0, n 1}, since we hve {q 0 } {q 1, 0} {q 2, 0} {q n 2, 0} {q 0, 0}, {q n 2, 0} {q n 1, 0, 1} {q n 1, 0, 2} {q n 1, 0, n 2} {q n 1, 0}, {q n 1, 0} {q 0, 1} {q 0, 2} {q 0, n 2}. We del with {q 0, n 1} lter. Now ssume tht ech set in R of size t is rechle. Let S = {q i, s 1, s 2,..., s t } e set of size t+1. Consider severl cses. (1) Let i = 1, so s 1 = 0. Then {q 0, s 2 1,..., s t 1} {q 1, 0, s 2,..., s t }, where the former set of size t is rechle y the induction hypothesis. (2) Let 2 i n 2, so S = {q i, 0, s 2, s 3,..., s t }. If s 2 = 1, then {q i 1, 0, s 3 1,..., s t 1} S. If s 2 2 nd s t n 2, then {q i 1, 0, s 2 1,..., s t 1} S. If s 2 2 nd s t =n 1, then {q i 1, 0, s 2 1,..., s t 1 1, n 1} S. This induction step with cse (1) s the sis proves cse (2) y induction on i. (3) Let i = n 1, so S = {q n 1, 0, s 2, s 3,..., s t }. Consider two cses of s t. If s t n 2, then {q n 2, 0, s 3 s 2,..., s t s 2 } If s t = n 1, then {q n 2, 0, s 3 s 2,..., s t 1 s 2, n 2} The strting set is rechle y induction on t in oth cses. s 2 1 S. s 2 1 S. (4) Let i = 0, so S = {q 0, s 1, s 2,..., s t }. We consider four cses of s 1 nd s t : If s 1 = 0, s t n 2, then {q n 1, 0, n 1, s 3 s 2,..., s t s 2 } If s 1 = 0, s t = n 1, then {q n 1, 0, n 1, s 3 s 2,..., s t 1 s 2, n 2} s 2 1 S. s 2 1 S. s 1 1 If s 1 1, s t n 2, then {q n 1, 0, s 2 s 1,..., s t s 1 } S. If s 1 1, s t = n 1, then {q n 1, 0, s 2 s 1,..., s t 1 s 1, n 2} s 1 1 S. The strting sets re considered in cse (3). This proves rechility. To prove distinguishility, notice tht the word n is ccepted y NFA N only from stte n 1. It follows tht n 1 t n is ccepted only from stte t, 0 t n 1. Hence two sets {q i } S nd {q j } T re distinguishle if S T. Consider two sets {q i } S, {q j } S where 0 i < j n 1 nd ssume

86 1128 G. Jirásková & I. Krjňáková tht {i, j} S. Let i = 0 nd S {0, 1,..., n 1}. Then 0 S nd j / S, nd we hve {q 0 } S n 1 j n {q 0, 0} {q 1, 0, 1}, {q j } S n 1 j n {q n 1, 0} {q 0, 1}, Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. where the resulting sttes differ in stte 0. If i 1, then we use n j to get the cse ove. Up to now, we reched ll sets in R except for {q 0, n 1}. This set remins unrechle ecuse of the inility to rech it y nor from other stte. Hence sc(l 2 (B)) = (n + 3)2 n 2 1. To rech the set {q 0, n 1}, we dd one more symol to B. We define the trnsitions on the symol c s follows: δ(q 0, c) = q 0 ; δ(q i, c) = q i+i if 1 i n 2; δ(q n 1, c) = q 0. Denote the resulting DFA over {,, c} y C. Then in the corresponding suset utomton for L 2 (C) the set {q 0, n 1} is rechle from {q 0, n 2} y c. The proof of the distinguishility remins the sme. Thus sc(l 2 (C)) = (n + 3)2 n 2. As corollry of the two lemms ove, we get the next result. Corollry 10. Let n 3 nd L e lnguge over Σ ccepted y n n-stte DFA in which n 1 sttes re finl. Then sc(l 2 ) (n + 3)2 n 2, nd this ound is tight if Σ 3. The ound (n + 3)2 n 2 1 is met y inry lnguge. We tested the stte complexity of squre on ll inry utomt with 3, 4 nd 5 sttes where the initil stte is the only non-finl stte. But we did not find ny inry utomton with the stte complexity of its squre greter thn (n + 3)2 n 2 1. The following result shows tht this lower ound is tight for every n 3 on inry lphet. Theorem 11. Let n 3 nd L e inry lnguge ccepted y n n-stte DFA in which n 1 sttes re finl. Then sc(l 2 ) (n + 3)2 n 2 1, nd this ound is tight. Proof. We lredy showed the witness lnguge with sc(l 2 ) (n + 3)2 n 2 1 in Lemm 9. It remins to show tht the upper ound (n + 3)2 n 2 cnnot e met in the inry cse. Suppose for contrdiction tht there is miniml n-stte DFA A = (Q, {, },, q 0, Q\{q 0 }) where the only non-finl stte is the initil stte nd the NFA for its squre hs (n + 3)2 n 2 rechle nd lso distinguishle sttes. Let us tke closer look t its trnsitions. The option of q 0 = q 0 = q 0 is unstisfying ecuse tht mens tht A is not miniml. Without the loss of generlity let q 0 = q 1 where q 1 q 0. We show tht q 0 = q 0. If not, then q 0 = q j nd j 0. Let us show tht we re

87 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1129 Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. unle to rech the set {q 0, 0}. If we would try to rech it y reding n or from {q 0 } S we would rech {q 1,...}, or {q j,...}. We cn try from the suset {q i } S, where i 0, so 0 S. Then we would hve {q i, 0,...} {..., 1,...} or {q i, 0,...} {..., j,...}, so not rech {q 0, 0} t ll. Hence q 0 = q 0. Now we consider the trnsitions tht would ensure the rechility of the susets {q 0, 0}, {q 0, 1}, {q 0, 2},..., {q 0, n 1}. All of them, except for {q 0, 1}, cnnot e reched y reding n for the sme reson s we showed previously with {q 0, 0}. Tht mens tht they re reched y reding. There must e some finl stte, tht hs outcoming trnsition on to q 0 otherwise {q 0, 0} will remin unrechle since q 0 / F. Let us denote this stte s q n 1. There must e lso incoming trnsitions on to sttes q 2, q 3,..., q n 1. This enforces trnsitions to e like q 0 q0, q 1 q2 qn 1 q0. Now we know for sure tht {q 0, 1} is not reched y reding so there must e some x 0 tht q x q0. We clim tht trnsitions on hs to e permuttion in order to chieve ll the susets. Suppose for contrdiction tht trnsitions on do not form permuttion nd let us see how we re unle to rech the suset {q 0, 0, 1,..., n 1} in such cse. Our suset is not reched y, ecuse hs no incoming trnsition to q 1, so we should try to rech it y insted. If trnsitions on do not form permuttion, then there is stte q y tht hs t lest two incoming trnsitions on from t lest two different sttes. Therefore there is stte q j tht hs no incoming trnstions on. Stte q j is not q 0 ecuse we lredy sid tht there is some q x q0. Reding n does not rech suset contining j, thus neither the suset {q 0, 0, 1,..., n 1}. To conclude, trnsitions on must form permuttion. Now we know tht to rech ll the possile susets we hve to hve DFA s showed in Fig. 5 where the trnsitions on form permuttion. We show tht some susets of the suset utomton for the squre of this DFA tht should e distinguishle re ctully equivlent. For this reson we introduce the fmilies of susets T 1,..., T n 1, where fmily T i consists of susets {q 0, 0, i} S nd S {i+1, i+2,..., n 1}. Moreover let T n = {q 0, 0}. Using previously defined trnsitions on we hve {q 0, 0, 1} S {q 1, 0, 1, 1 } S {q 0, 0, 1, 1 } S T 1, {q 0, 0, i} S {q 1, 0, 1, i } S {q 0, 0, 1, i } S T 1, q 0 q 1 q 2 q 3... q n 2 q n 1 Fig. 5. Trnsitions on in inry witness.

88 1130 G. Jirásková & I. Krjňáková T 1 T 2... T i T i+1... T n 1 {q 0, 0} Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Fig. 6. Fmilies of susets nd trnsitions etween them. tht is, reding from every suset in T i results in suset in T 1 ; here stnds for the equivlence etween sttes; recll tht in the egining of the proof of Lemm 9 we showed tht two distinct susets {q i } S nd {q j } S, where {i, j} S re equivlent for the cse when the only non finl stte is the initil stte. Now consider trnsitions on : {q 0, 0, 1} S {q 0, 0, 2} S T 2, {q 0, 0, i} S {q 0, 0, i + 1} S T i+1, {q 0, 0, n 1} {q 0, 0}, {q 0, 0} {q 0, 0}. This mens tht reding from every suset in T i results in suset in T i+1 except for T n tht stys in itself. This is illustrted in Fig. 6. Oserve tht ll the elements from one fmily upon reding ny word w would end up in the ccepting stte from some of the fmilies T 1,..., T n 1 or in the only rejecting stte {q 0, 0}. Tht mens tht the elements of the fmily T i re equivlent. It remins to show tht t lest one of these fmilies hs more thn one rechle suset. Let us tke fmily T 1 : {q 0, 0} {q 1, 0, 1} x 1 {q x, 0, x} {q 0, 0, 1} T 1. To rech nother suset from T 1 we use the rgument of the permuttion formed y trnsitions on. The stte q 0 hs n outgoing trnsition on to the stte q 1. If the stte q 1 is returning to the q 0 on then we hve, where q y q2 nd y 2, {q 0, 0, 1} y 1 {q 0, 0, y} {q 1, 0, 1, 2} {q 0, 0, 1, 2 } T 1. Otherwise, if q 1 qz, where 2 z n 1, supposing tht q z k q 0 then we hve {q 0, 0, 1} {q 1, 0, 1, z} {q z, 0, 1, z, z } k {q 0, 1, z, z, z 2,..., z k } {q 0, 0, 1, z}, so the reched suset is from T 1. So fr we showed tht to rech the susets we need to strt from DFA s shown in Fig. 5 with eing permuttion. However in

89 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1131 such cse t lest two reched susets tht should e distinguishle, s oserved in Lemm 9, re equivlent. Our proof is complete. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles Squre on unry DFAs To complete the overview out the squre opertion on deterministic utomt we should not forget unry lphets. We refer to the pper y Rmpersd [11] once gin. Notice tht the complexity of squre in this cse is exponentilly smller thn in the inry cse. To get the complexity of squre (respectively power) in the unry cse, Rmpersd used the result on conctention y Pighizzini nd Shllit [10], Theorem 10, the proof of which is rther complicted. For the ske of completeness we provide simple proof for squre here. We use Nicud s nottion for unry utomt: We identify ech stte q with the smllest numer i such tht q 0 i = q. Given two integers n nd l with 0 l n 1 nd set F {0, 1,..., n 1}, we denote y A = (n, l, F ) the n-stte unry DFA A with the stte set Q = {0, 1,..., n 1}, in which i = i + 1 if 0 i n 2 nd n 1 = l, nd the set of finl sttes is F. Theorem 12 ([11], Theorems 3 nd 4 with k = 2). Let L e unry lnguge with sc(l) = n. Then sc(l 2 ) 2n 1 nd the ound is tight. Proof. Let L e ccepted y unry DFA A = (n, l, F ). Let us show tht L 2 is ccepted y the DFA A = (2n 1, n 1 + l, {i + j i, j F }) where F = {i + j 0 i + j 2n 2 nd i, j L} Notice tht oth of A nd A hve loop of length n l. It follows immeditely from the construction tht for every m with 0 m 2n 2, the stte m is finl stte of the DFAA if nd only if m L 2. We next show tht for every m with m n 1 + l, the word m is in L 2 if nd only if the word m+(n l) is in L 2. If m n 1 + l nd m L 2, then m = i + j where i, j L nd, without loss of generlity, we must hve i l. It follows tht i+(n l) L, nd therefore m+(n l) L 2. To prove the converse, let m n 1 + l nd m+(n l) L 2. Then m + (n l) = i+j where i, j L, nd, without loss of generlity, we must hve i n. It follows tht i (n l) L, nd therefore m L 2. The upper ound 2n 1 is met y the unry lnguge { m m n 1}. A = (5, 2, {1, 2}) A = (9, 6, {2, 3, 4, 6, 7}) Fig. 7. The construction of unry DFA for squre; n = 5, l = 2, F = {1, 2}.

90 1132 G. Jirásková & I. Krjňáková Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. 4. Squre on Alternting nd Boolen Automt Fellh, Jürgensen, nd Yu in Ref. [4], Theorem 9.3, showed tht if lnguge K is ccepted y n m-stte AFA nd lnguge L is ccepted y n n-stte AFA, then the lnguge KL is ccepted y n AFA of t most 2 m + n + 1 sttes. It follows tht 2 n + n + 1 is n upper ound for the squre on AFAs. Here we use our results from the previous section to prove tightness of this upper ound. For the squre on BFAs, we get the tight upper ound 2 n + n. Recll tht sc(l) is the smllest numer of sttes in ny AFA for L nd sc(l) is defined nlogously. Theorem 13 (Squre on AFAs). Let n 2. Let L e regulr lnguge over Σ with sc(l) = n. Then sc(l 2 ) 2 n + n + 1, nd the ound is tight if Σ 2. Proof. From given upper ound from [4], Theorem 9.3, we know tht sc(l 2 ) 2 n +n+1. For tightness, let L R e the lnguge ccepted y the DFA A defined in the proof of Theorem 7 with2 n sttes where hlf of the sttes re finl, tht is, k = 2 n 1. By Lemm 3, L is ccepted y n AFA with n sttes. Using Theorem 7 we know tht sc((l R ) 2 ) = 2 n 2 2n 2 n 1 2 2n 1. By Corollry 2, sc(l 2 ) log(sc((l R ) 2 )) = 2 n + n. Suppose for contrdiction tht L 2 is ccepted y n AFA with 2 n + n sttes. By Lemm 1, the lnguge (L 2 ) R is ccepted y 2 2n +n - stte DFA with 2 2n +n 1 finl sttes. It follows immeditely tht the miniml DFA for (L 2 ) R hs t most 2 2n +n 1 finl sttes. However, the miniml DFA for the lnguge (L 2 ) R = (L R ) 2 hs 2 n 2 2n 2 n 1 2 2n 1 = 2 n 1 2 2n + 2 n 1 2 2n 1 sttes,where 2 n 1 2 2n n 1 2 2n 1 1 of them re non-finl those {q i } S, where S {q 0, q 1,..., q 2 n 1 1}. Thus the numer of finl sttes in the miniml DFA for (L 2 ) R is nd since n 2, we get 2 n 1 (2 2n + 2 2n 1 ) 2 n 1 (2 2n n 1 1 ), 2 n 1 (2 2n + 2 2n 1 ) 2 n 1 (2 2n n 1 1 ) ( = 2 2n 2 n ) 1 2 2n 1 2 2n 1 +1 ( > 2 2n +n ) = 2 2n +n 1. 4 Hence the miniml DFA for (L 2 ) R hs more thn 2 2n +n 1 finl sttes, contrdiction. It follows tht sc(l 2 ) 2 n + n + 1. Theorem 14 (Squre on BFAs). Let n 2. Let L e regulr lnguge over Σ with sc(l) = n. Then sc(l 2 ) 2 n + n, nd the ound is tight if Σ 2. Proof. The upper ound follows from the upper ound 2 m + n on the complexity of the conctention opertion on BFAs [7], Theorem 4. Let L R e lnguge ccepted y DFA A from Fig. 1 with 2 n sttes nd one finl stte. By Lemm 3,

91 Squre on Deterministic, Alternting, nd Boolen Finite Automt 1133 L is ccepted y n n-stte BFA. We re le to determine the stte complexity of (L R ) 2 using Theorem 7: sc ( (L R ) 2) = 2 n 2 2n 2 2n 1. By Corollry 2, sc(l 2 ) log ( 2 n 2 2n 2 2n 1 ) = 2 n + n. The next result shows tht the inry lphet in the two theorems ove cnnot e decresed to unry. Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. Theorem 15 (Squre on unry BFAs). Let n 2. Let L e unry regulr lnguge with sc(l) = n. Then sc(l 2 ) n + 1. Proof. If L is ccepted y n n-stte BFA, then the lnguge L R is ccepted y 2 n -stte DFA. Since L is unry, we hve L R = L. By Theorem 12 the lnguge L 2 is ccepted y DFA with t most 2 n+1 1 sttes. It follows tht L 2 is ccepted y BFA with t most n + 1 sttes. 5. Conclusions We studied the stte complexity of the squre of lnguges represented y deterministic, lternting, nd Boolen finite utomt. First, for ech k such tht 1 k n 2, we showed tht the upper ound n2 n k2 n 1 on the squre of lnguges represented y n-stte DFAs with k finl sttes is tight in the inry cse. Then we nlysed the cse of n 1 finl sttes, where we proved tht the ound (2n+2)2 n 2 cnnot e met. We provided the tight upper ound (n+2)2 n 2 for the cse when the initil stte is finl nd we found inry witness. When the initil stte is the only non-finl stte, we otined the upper ound (n + 3)2 n 2 with ternry witness. In the inry cse we proved tht the tight upper ound is (n + 3)2 n 2 1. Since the complexity of the squre on unry lphet is 2n 1, the inry lphet is lwys optiml in our witness exmples. Finlly, we used our results on the squre on deterministic finte utomt to descrie inry witness lnguges meeting the upper ounds2 n + n + 1 nd 2 n +n for squre on lternting nd Boolen finite utomt,respectively. We proved tht the inry lphet is gin optiml. Our results cn e extended for the conctention opertion just y conctentingtwo of our utomt with different numer of sttes. This provides n lterntive solution for the open prolem stted y Fellh, Jürgensen, nd Yu in Ref. [4]. There remin few unnswered questions. For exmple, the exct complexity of the squre opertion on unry lternting nd Boolen utomt; the stte complexity of the power on lternting nd Boolen utomt, resolved for deterministic utomt, e.g. y Domrtzki nd Okhotin[3], nd of course the rnge of possile complexities for squre. Acknowledgments This reserch is supported y grnt VEGA 2/0084/15 nd grnt APVV

92 1134 G. Jirásková & I. Krjňáková Int. J. Found. Comput. Sci : Downloded from y on 04/15/20. Re-use nd distriution is strictly not permitted, except for Open Access rticles. References [1] J. A. Brzozowski nd E. L. Leiss, On equtions for regulr lnguges, finite utomt, nd sequentil networks, Theoreticl Computer Science 10 (1980) [2] K. Čevorová, G. Jirásková nd I. Krjňáková, On the squre of regulr lnguges, CIAA 2014, eds. M. Holzer nd M. Kutri, LNCS 8587, (Springer, 2014), pp [3] M. Domrtzki nd A. Okhotin, Stte complexity of power, Theoreticl Computer Science 410(24 25) (2009) [4] A. Fellh, H. Jürgensen nd S. Yu, Constructions for lternting finite utomt, Interntionl Journl of Computer Mthemtics 35(1 4) (1990) [5] J. E. Hopcroft nd J. D. Ullmn, Introduction to Automt Theory, Lnguges nd Computtion (Addison-Wesley, 1979). [6] M. Hospodár nd G. Jirásková, Conctention on deterministic nd lternting utomt, NCMA 2016, eds. H. Bordihn, R. Freund, B. Ngy nd G. Vszil, Vol. 321 (Österreichische Computer Gesellschft, 2016), pp [7] G. Jirásková, Descriptionl complexity of opertions on lternting nd Boolen utomt, CSR 2012, eds. E. A. Hirsch, J. Krhumäki, A. Lepistö nd M. Prilutskii, LNCS 7353, (Springer, 2012), pp [8] E. L. Leiss, Succint representtion of regulr lnguges y Boolen utomt, Theoreticl Computer Science 13 (1981) [9] A. N. Mslov, Estimtes of the numer of sttes of finite utomt, Soviet Mthemtics Dokldy 11(5) (1970) [10] G. Pighizzini nd J. Shllit, Unry lnguge opertions, stte complexity nd Jcosthl s function, Interntionl Journl of Foundtions of Computer Science 13(1) (2002) [11] N. Rmpersd, The stte complexity of L 2 nd L k, Informtion Processing Letters 98(6) (2006) [12] M. Sipser, Introduction to the Theory of Computtion (Cengge Lerning, 2012). [13] S. Yu, Hndook of Forml Lnguges: Volume 1 Word, Lnguge, Grmmr (Springer, Berlin, Heidelerg, 1997), Berlin, Heidelerg, ch. Regulr Lnguges, pp [14] S. Yu, Q. Zhung nd K. Slom, The stte complexities of some sic opertions on regulr lnguges, Theoreticl Computer Science 125(2) (1994)

93 81

94 Appendix [B] Michl Hospodár, Glin Jirásková, Ivn Krjňáková: Opertions on Boolen nd lternting finite utomt. In: Fedor V. Fomin, Vldimir V. Podolskii (eds.): Computer Science Theory nd Applictions 13th Interntionl Computer Science Symposium in Russi, CSR 2018, Moscow, Russi, June 6 10, 2018, Proceedings. Lecture Notes in Computer Science, vol , pp , Springer (2018). ISSN: , ISBN: , DOI: / _16 82

95 Opertions on Boolen nd Alternting Finite Automt Michl Hospodár, Glin Jirásková, nd Ivn Krjňáková (B) Mthemticl Institute, Slovk Acdemy of Sciences, Grešákov 6, Košice, Slovki Astrct. We investigte the descriptionl complexity of sic regulr opertions on lnguges represented y Boolen nd lternting finite utomt. In prticulr, we consider the opertions of difference, symmetric difference, str, reversl, left quotient, nd right quotient, nd get tight upper ounds m + n, m + n, 2 n, 2 n,m, nd 2 m, respectively, for Boolen utomt, nd m + n +1,m+ n, 2 n, 2 n,m+1,nd2 m +1, respectively, for lternting finite utomt. To descrie witnesses for symmetric difference, we use ternry lphet. All the remining witnesses re defined over inry or unry lphets tht re shown to e optiml. 1 Introduction The Boolen finite utomt (BFAs) re generliztion of nondeterministic finite utomt (NFAs). In n NFA, the trnsition function mps ny pir of stte nd input symol to suset of sttes. This suset cn e viewed s disjunction of its sttes. We otin BFA y considering other Boolen functions on sttes s result of the trnsition function. Alternting finite utomt (AFAs) strt from the only one initil stte, wheres Boolen utomt my strt their computtion in ny Boolen function designted s the initil function. Boolen utomt recognize the clss of regulr lnguges [2,4]. Every n-stte Boolen utomton cn e simulted y 2 2n -stte deterministic finite utomton (DFA), or y (2 n + 1)-stte NFA, nd oth upper ounds re tight lredy in the inry cse [2,10]. Some of the constructions nd upper ounds for elementry opertions on lternting utomt were introduced in [5]. The upper ound 2 m + n +1 for conctention from [5] hs een shown to e tight in [8]. Detiled results for the squre on lternting nd Boolen utomt cn e found in [12]. Tight upper ounds for union nd intersection were shown in [10]. For str nd reversl, the upper nd lower ound provided in [10] differed y one. Reserch supported y grnt VEGA 2/0084/15 nd grnt APVV This work ws conducted s prt of PhD study of Michl Hospodár nd Ivn Krjňáková t the Fculty of Mthemtics, Physics nd Informtics of the Comenius University. c Springer Interntionl Pulishing AG, prt of Springer Nture 2018 F. V. Fomin nd V. V. Podolskii (Eds.): CSR 2018, LNCS 10846, pp ,