State Complexity of Permutation and Related Decision Problems on Alphabetical Pattern Constraints
aa r X i v : . [ c s . F L ] J un State Complexity of Permutation on FiniteLanguages
Stefan Hoffmann
Informatikwissenschaften, FB IV, Universit¨at Trier, Universit¨atsring 15, 54296 Trier,Germany, [email protected]
Abstract.
We investigate the state complexity of the permutation op-eration on finite languages. We give a tight bound that is expressed interms of the longest strings in the unary projection languages. Moreover,we ask how large a minimal automaton could be for a finite languagesuch that the lengths of the strings in the unary projection languagesare bounded. Lastly, we look at a restricted class of languages with max-imal state complexity and derive a state bound expressed in terms ofthe state complexity of the input language. This result fits with previousresults on restricted classes for binary alphabets.
Keywords: state complexity · finite automata · finite languages · com-mutative closure · permutation · Parikh equivalence
The state complexity of a regular language L is the minimal number of statesneeded in a complete deterministic automaton accepting L . Equivalently, it is thenumber of Nerode right-equivalence classes. Investigating the state complexityof the result of a regularity-preserving operation on regular languages, depend-ing on the state complexity of the regular input languages, was first initiatedin [19] and systematically started in [21]. For a survey and introduction to thisimportant and vast field see [10]. In general, the permutation operation is notregularity-preserving. But it is regularity-preserving on finite languages and ongroup languages [11, 16]. The state complexity on group languages was studiedin [16], but it is not known if the derived bounds are tight. The state com-plexity of the permutation operation on finite languages was first investigatedin [8, 20]. In fact, this work draws much inspiration from [8, 20]. There, a gen-eral bound for a binary alphabet was derived. This general bound is not tight,but for two restricted classes tight bounds were given. The state complexity ofoperations on finite languages for other operations was previously investigatedin [3, 4, 5, 13, 17]. In [8, 20], the question for a tight bound and for an extensionto arbitrary alphabets was raised. Here, we give a tight bound for arbitrary al-phabet sizes, which is stated in terms of the unary projection languages. Hence,the theme of a close connection between commutative language and unary lan-guages, utilised in previous work of the author [14, 15, 16], is reassured here. Thisleads naturally to questions about the relation between the state complexity ofa language and the unary projection languages. We tackle one such question byinvestigating how large could be the state complexity of a finite language whose S. Hoffmann unary projection languages only admit words up to some bounded lengths. Wealso give a state complexity bound in terms of the state complexity of the originallanguage for a restricted class of languages.
Let Σ “ t a , . . . , a k u be a finite set of symbols , called an alphabet. The set Σ ˚ denotes the set of all finite sequences, i.e., of all words or strings. The finite se-quence of length zero, or the empty word, is denoted by ε . We set Σ ` “ Σ ˚ zt ε u .We call a word u P Σ ˚ a prefix of another word v P Σ ˚ , if there exists x P Σ ˚ such that v “ ux . For a given word we denote by | w | its length, and for a P Σ by | w | a the number of occurrences of the symbol a in w . Subsets of Σ ˚ are calledlanguages. With N “ t , , , . . . u we denote the set of natural numbers, includ-ing zero, and N “ N zt u . For some set X , by P p X q we denote the power set of X , i.e, the set of all subsets of X . Every function f : X Ñ Y induces a functionˆ f : P p X q Ñ P p Y q by setting ˆ f p Z q : “ t f p z q | z P Z u . Here, we will denote thisextension also by f . For n P N we set r n s : “ t k P N : 0 ď k ă n u . Let M Ď N be some finite set. By max M we denote the maximal element in M with respectto the usual order, and we set max H “
0. A finite deterministic and completeautomaton will be denoted by A “ p Σ, S, δ, s , F q with δ : S ˆ Σ Ñ S the statetransition function, S a finite set of states, s P S the start state and F Ď S theset of final states. The properties of being deterministic and complete are impliedby the definition of δ as a total function. The transition function δ : S ˆ Σ Ñ S could be extended to a transition function on words δ ˚ : S ˆ Σ ˚ Ñ S by set-ting δ ˚ p s, ε q : “ s and δ ˚ p s, wa q : “ δ p δ ˚ p s, w q , a q for s P S , a P Σ and w P Σ ˚ .In the remainder we drop the distinction between both functions and will alsodenote this extension by δ . Let A “ p Σ, Q, δ, s , F q be an automaton, then atrap state t P Q is a state such that δ p t, x q “ t for each x P Σ . The languageaccepted by A “ p Σ, S, δ, s , F q is L p A q “ t w P Σ ˚ | δ p s , w q P F u . A language L Ď Σ ˚ is called regular if L “ L p A q for some finite automaton. For a language L Ď Σ ˚ and u, v P Σ ˚ we define the Nerode right-congruence with respect to L by u ” L v if and only if @ x P Σ : ux P L Ø vx P L. The equivalence classfor some w P Σ ˚ is denoted by r w s ” L : “ t x P Σ ˚ | x ” L w u . A language isregular if and only if the above right-congruence has finite index, and it couldbe used to define the minimal deterministic automaton A L “ p Σ, Q, δ, r ε s ” L , F q with Q : “ tr w s ” L | w P Σ ˚ u , δ pr w s ” L , a q : “ r wa s ” L for a P Σ , w P Σ ˚ and F : “ tr w s ” L | w P L u . It is indeed the smallest automaton accepting L in termsof states, and we will refer to this construction as the minimal automaton of L .The state complexity of a regular language is defined as the number of Neroderight-congruence classes. We will denote this number by sc p L q . For u P Σ ˚ and L Ď Σ ˚ , the quotient of L by u is the set u ´ L “ t v P Σ ˚ | uv P L u . If u, v P Σ ˚ ,we have u ” L v if and only if u ´ L “ v ´ L . Hence, the quotients could beused as representatives of the Nerode equivalence classes. Indeed, the automaton A “ p Σ, Q, δ, L, F q with Q “ t u ´ L | u P Σ ˚ u , F “ t u ´ L | u P Σ ˚ , ε P u ´ L u and δ p u ´ L, a q “ p ua q ´ L is isomorphic to the minimal automaton of L . Hence, If not otherwise stated we assume that our alphabet has the form Σ “ t a , . . . , a k u and k denotes the number of symbols.tate Complexity of Permutation on Finite Languages 3 sc p L q “ |t u ´ L | u P Σ ˚ u| for regular L Ď Σ ˚ . Let A “ p Σ, Q, δ, s , F q be an au-tomaton. A state q P Q is reachable , if q “ δ p s , u q for some u P Σ ˚ . Two states q, q are distinguishable , if there exists u P Σ such that |t δ p q, u q , δ p q , u quX F | “ f : P p Σ ˚ q n Ñ P p Σ ˚ q is a regularity-preserving operation, usually its state complexity is thefunction sc p f q : N n Ñ N given by sc p f qp m , . . . , m n q “ max t sc p f p L , . . . , L n qq | L i regular with sc p L i q ď m i for i P t , . . . , n uu . The same definition holds foroperations that are only regularity-preserving on subclasses, or if we are onlyinterested in certain subclasses. Then the domain is restricted to this subclass.For example, in this work we only look at finite languages. See [10], for exam-ple, for an overview of a wealth of subclasses of regular languages that whereconsidered in the literature. But here, we also allow a state complexity boundto depend on different parameters than merely the state complexity of the in-put languages, namely later we will give a bound in terms of the lengths of thelongest strings in the unary projection languages. In that case, the state com-plexity function is expressed in terms of these parameters. The map ψ : Σ ˚ Ñ N k given by ψ p w q “ p| w | a , . . . , | w | a k q is called the Parikh-morphism . For a givenword w P Σ ˚ we define perm p w q : “ t u P Σ ˚ : ψ p u q “ ψ p w qu and for languages L Ď Σ ˚ we set perm p L q : “ Ť w P L perm p w q . The language perm p L q is also calledthe permutational (or commutative) closure of L . Definition 1.
The shuffle operation , denoted by (cid:1) , is defined by u (cid:1) v : “ " x y x y ¨ ¨ ¨ x n y n | u “ x x ¨ ¨ ¨ x n , v “ y y ¨ ¨ ¨ y n ,x i , y i P Σ ˚ , ď i ď n, n ě * , for u, v P Σ ˚ and L (cid:1) L : “ Ť x P L ,y P L p x (cid:1) y q for L , L Ď Σ ˚ . A language L Ď Σ ˚ with | Σ | “ unary language . For a language L Ď Σ ˚ , the languages t a | w | a | w P L u for a P Σ are called the unary projec-tion languages . We will need the well-known inequality of the arithmetic andgeometric mean. Theorem 1. (AM-GM inequality [1, 7]) Let x , . . . , x n be n non-negative num-bers, then n ? x ¨ ¨ ¨ x n ď x ` . . . ` x n n , (1) and equality holds precisely if x “ x “ . . . “ x n . For n, m P N , we set n “ n m “ n p n ´ q ¨ ¨ ¨ p n ´ m ` q for m ą First, in Section 3.1, we give our tight bound for the state complexity of thepermutation operation on finite languages. Then, in Section 3.2, we give boundsfor the maximal state complexity of a language whose longest strings in the
S. Hoffmann unary projection languages are bounded. Our upper bound is given by a recursiveformula, for which we also derive a closed form for binary alphabets. Lastly, inSection 3.3, we take a closer look at a restricted class of finite languages thatare maximal for the state complexity of their permutational closure. We givea bound for the state complexity of the permtuation operation in terms of thestate complexity of the original language. Here, the state complexity is definedin terms of complete automata. In [8, 20] incomplete minimal automata whereused. As every minimal complete automaton for a finite language has exactly oneadditional trap state more than a minimal incomplete automaton, it makes noessential difference and we can convert state bounds for both models by addingor subtracting one to the respective variables and expressions representing orbounding a state complexity. But note that in general this might not hold, forexample for the shuffle operation the bound for minimal incomplete automatadiffers from the bound for minimal complete automata [2, 6]. The next resultsays something about the structure of minimal automata for finite languages.
Lemma 1.
Let L Ď Σ ˚ be a finite language. Then, a minimal automaton A “p Σ, Q, δ, s , F q for L has a unique non-final trap state t , and if δ p q, u q “ q forany u P Σ ` , then q “ t . Also, we have a unique final state q f P F such that δ p q f , x q “ t for each x P Σ . If w P L is any word of maximal length in L ,then q f “ δ p s , w q , and for each q P Q zt t u , we have some u P Σ ˚ such that δ p q, u q “ q f . Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be finite. In [8, 20], bounds were given interms of the length of a longest string in L and in terms of the state complexityof the original language for binary alphabets. Here, we give a tight state boundin terms of the longest string in the unary projection languages t a | w | aj j | w P L u for each letter a j with j P t , . . . , k u . Theorem 2.
Suppose Σ “ t a , . . . , a k u . Let L Ď Σ ˚ be finite, then sc p perm p L qq ď ˜ k ź j “ p max t| u | a j | u P L u ` q ¸ ` . The bound is sharp, i.e., there exists a finite language L such that the aboveinequality is an equality.Proof. Set n j “ max t| u | a j | u P L u ` j P t , . . . , k u . Construct A “p Σ, Q, δ, s , F q with Q “ r n ` s ˆ . . . ˆ r n k ` s Y t t u and δ pp s , . . . , s k q , a j q “ " p s , . . . , s j ´ , s j ` , s j ` , . . . , s k q if s j ă n j t if s j “ n j . Also s “ p , . . . , q and F “ t δ p s , w q | w P L u . Then L p A q “ perm p L q .By definition, if w P L , then δ p s , w q P F . Also, by construction of A , with u P L p A q we also have perm p u q Ď L p A q . Hence, perm p L q Ď L p A q . Conversely, tate Complexity of Permutation on Finite Languages 5 if δ p s , w q P F , then | w | a j ď n j for each j P t , . . . , k u , as by construction of A we have F Ď r n s ˆ . . . ˆ r n k s . By definition of F we then have some u P L with δ p s , w q “ δ p s , u q . But, also by construction of A , for all x, y P Σ ˚ withmax t| x | , | y |u ď n j for each j P t , . . . k u , we have δ p s , x q “ δ p s , y q ô @ j P t , . . . , k u : | x | a j “ | y | a j . Hence, w P perm p u q Ď perm p L q . Next, we show that the bound is sharp. Let L n “ p ab q n . Then sc p L n q “ n `
2. We have perm p L n q “ t w P t a, b u n | | w | a “| w | b u “ t a n u (cid:1) t b n u and sc p perm p L n qq “ p n ` q `
1. For if u, v
P t a, b u ˚ withmax t| u | a , | u | b , | v | a , | v | b u ď n and u R perm p v q , then for w “ a n ´| u | a b n ´| u | b wehave uw P perm p L n q and vw R perm p L n q . Hence, the Nerode right-congruenceclasses in tr a x b y s | ď x, y ď n u are all distinct. Additionally, we have anequivalence class r a n ` s for all words u with uw R perm p L n q for all w P Σ ˚ . So,in total, we have p n ` q ` [\ If L is finite, then max t| w | a j | j P t , . . . , k u ď max t| w | | w P L u ď sc p L q .Hence, the next is implied. Corollary 1. If L Ď Σ ˚ is finite and non-empty, then sc p perm p L qq ď sc p L q | Σ | . Also, as L is finite if and only if perm p L q is finite, we have a lower bound forthe permutative closure. Note that we have no non-trivial lower bound for infinitelanguages. For example, define A n “ pt a, b u , r n s , δ, , t uq by setting δ p , a q “ , δ p , a q “ , δ p , a q “ , δ p , a q “ , . . . , δ p n ´ , a q “ n ´ , δ p n ´ , a q “ n ´ δ p , b q “ δ p , b q “ , δ p , b q “ , . . . , δ p n ´ , b q “ n ´ , δ p n ´ , b q “ n ´ δ p n ´ , b q “ n ´
1. Then L p A n q “ p b ` aL n a q ˚ with L “ b ˚ and L n ` “ p b p aL n a q ˚ b q ˚ for n ě
1. This gives perm p L p A n qq “ t w P t a, b u | | w | a ” p mod 2 qu , as b ˚ p aa q ˚ Ď L p A n q for all n ě a ’s to return to the start state. Hence sc p perm p L p A n qq “
2. Butsc p L p A n qq “ n , as for even m P r n s we have δ p s, p ba q m { q “ s “ m , and for odd m P r n s we have δ p s, a p ba q p m ´ q{ q “ s “ m .By setting t , u as the final states in A n , we could even construct languageswith perm p L p A n qq “ Σ ˚ for each n ě
1. In this case, sc p L p A n qq “ n for n ą p L p A qq “ Usually, as was done for most bounds in [8, 20], state complexity bounds forregularity preserving operations are formulated in terms of the state complexityof the original automaton. Hence, questions about the relations of the statecomplexity of L to the numbers max t| w | a j | w P L u for j P t , . . . , k u naturallyarose out of the state complexity bound given in Theorem 2, which is formulatedin terms of these numbers. Here, we ask how large the state complexity of a finitelanguage L could get when the numbers max t| w | a j | w P L u for j P t , . . . , k u are bounded. In [3], a similar question was tackled, but instead of the lengths ofwords in the unary projection languages, in this paper the lengths of the wordsin the language where bounded. Here, we introduce a function for the maximalstate complexity in Definition 2 and derive upper and lower bounds for it. S. Hoffmann
Definition 2.
The function h : N k Ñ N is given by h p n , . . . , n k q “ max t sc p L q | L Ď Σ ˚ , @ j P t , . . . , k u@ w P L : | w | a j ď n j u . This function is obviously monotone, but it is also strictly monotone.
Lemma 2.
Let p n , . . . , n k q P N and j P t , . . . , n u . Then h p n , . . . , n j , . . . , n k q ă h p n , . . . , n j ` , . . . , n k q . So, h p n , . . . , n k q “ max t sc p L q | L Ď Σ ˚ , @ j P t , . . . , k u : max t| w | a j | w P L u “ n j u . Let L Ď Σ ˚ be a finite language. The expression h p n , . . . , n k q with n j “ max t| u | a j | u P L u for j P t , . . . , k u gives an upper bound on the maximal statecomplexity of a language Parikh-equivalent to L , where two languages U, V Ď Σ ˚ are Parikh-equivalent if perm p U q “ perm p V q . The state complexity under Parikhequivalence was studied in [18]. As the bound in Theorem 2 is sharp, we have p ś kj “ p n j ` qq ` ď h p n , . . . , n k q . Also, we always need a non-final trap stateif we have at least one final state. Both observations give the next lower bound . Proposition 1.
Let p n , . . . , n k q P N k , then max t , p ś kj “ p n j ` qq ` u ď h p n , . . . , n k q . If we only allow a single symbol to appear, the value of the function couldbe easily calculated.
Proposition 2.
For each n ě we have h p , . . . , , n, , . . . , q “ n ` . Proof.
Let a P Σ be the symbol that is allowed to appear at most n times, theother symbols are not allowed to appear at all. Then sc pt a n uq “ n ` t a m | ď m ď n u could be accepted by an automaton with at most n ` [\ Next, we give an upper bound. For this, we define a function g : N k Ñ N byrecursion. Definition 3.
The function g : N k Ñ N is defined by setting g p , . . . , q “ and for p n , . . . , n k q P N k ztp , . . . , qu we set g p n , . . . , n k q “ ¨˝ k ÿ j “ ,n j ą g p n , . . . , n j ´ , n j ´ , n j ` , . . . , n k q ˛‚ ´ p r ´ q ` , where r “ |t n j | n j ą u| . Obviously, both functions g : N k Ñ N and h : N k Ñ N are symmetric, i.e.,every permutation of the arguments gives the same result. For arguments withat most a single non-zero entry, the values of g and h coincide. Or noting that L “ t ε u needs at least two states also gives 2 ď h p n , . . . , n k q withthe monotonicity of the function.tate Complexity of Permutation on Finite Languages 7 Proposition 3.
For each n ě we have g p , . . . , , n, , . . . , q “ n ` . Now, we show that the function g gives an upper bound for h . Proposition 4.
Let p n , . . . , n k q P N k , then h p n , . . . , n k q ď g p n , . . . , n k q .Proof. We use induction on the elements of N k , which could be done as thisset with the product order derived from the usual order on N is a well-partialorder [9]. By definition h p , . . . , q “ g p , . . . , q . Now, let p n , . . . , n k q P N k andsuppose inductively that for each j P t , . . . , k u with n j ą h p n , . . . , n j ´ , n j ´ , n j ` , . . . , n k q ď g p n , . . . , n j ´ , n j ´ , n j ` , . . . , n k q . Let L be a regular language with | w | a j ď n j for all j P t , . . . , k u . By Lemma 2,we can suppose max t| w | a j | w P L u “ n j for all j P t , . . . , k u . We use, aswritten in Section 2, that for regular L we have sc p L q “ |t u ´ L | u P Σ ˚ u| . Thequotients could be used as representatives of the states of a minimal automatonfor L . Intuitively, if we have some minimal automaton L , as we cannot loop backto the start state if L ‰ H , for each symbol a j P Σ with n j ą
0, we can look atthe automaton that we get if we start in the start that we get after reading a j .The reachable state set from this new start state does not contain the originalstart state, and it accepts the language a ´ j L . Then, we can apply our inductionhypothesis on these automata, which are also minimal, and noting that they allshare at least two states. By doing so, we can derive a bound for the number ofstates of the minimal automaton for L . Formally, we have t u ´ L | u P Σ ˚ u “ t L u Y ď a P Σ tp au q ´ L | u P Σ ˚ u . If n j ą
0, then a ´ j L ‰ H , and if n j “
0, then a ´ j L “ H . Also, as L is finite,with n “ sc p L q we have ` a nj ˘ ´ L “ H for any j P t , . . . , k u . So, H P tp au q ´ L | u P Σ ˚ u for any a P Σ , which gives t u ´ L | u P Σ ˚ u “ t L u Y ď a j P Σn j ą tp a j u q ´ L | u P Σ ˚ u . If j P t , . . . , k u with n j ą
0, then for each w P a ´ j L we have | w | a j ď n j ´ | w | a j ď n j for any j P t , . . . , k uzt j u . Hence, inductively, if n j ą
0, then ˇˇ t u ´ pp a j q ´ L q | u P Σ ˚ u ˇˇ ď g p n , . . . , n j ´ , n j ´ , n j ` , . . . , n k q . We have u ´ pp a j q ´ L “ p a j u q ´ L . Lastly, note that, if a ´ j L ‰ H , as a ´ j L is finite, if u is some longest string in a ´ j L , then p a j u q ´ L “ t ε u . Hence, foreach j P t , . . . , k u we have tH , t ε uu Ď tp a j u q ´ L | u P Σ ˚ u . Setting r “ |t j P S. Hoffmann t , . . . , k u | n j ą u| and combining everything gives |t u ´ L | u P Σ ˚ u| “ ˇˇˇˇˇˇ t L u Y ď a j P Σ,n j ą tp a j u q ´ L | u P Σ ˚ u ˇˇˇˇˇˇ ď ` k ÿ j “ ,n j ą g p n , . . . , n j ´ , n j ´ , n j ` , . . . , n k q ´ r ` “ g p n , . . . , n k q . Hence, we conclude h p n , . . . , n k q ď g p n , . . . , n k q for all p n , . . . , n k q P N . [\ A Closed Form of g : N k Ñ N for Binary Alphabets: Here, we assume Σ “ t a, b u . First, we define a sequence of sequences, which arose out of summinginitial terms of the previous sequence. Definition 4.
For each i P N we define a function G i : N Ñ N by setting G p n q “ n and G i ` p n q “ n ÿ j “ G i p j q We have G p n q “ ` ` . . . ` n “ n p n ` q . For larger indices, we have thefollowing closed form. Proposition 5.
For each i P N we have G i p n q “ i ! p n ` i ´ q i . (2) In particular, G i p q “ .Proof. We use the “finite calculus” as outlined in [1, 12]. We have G p n q “ n ,which fulfills Equation (2). Then, inductively, G i ` p n q “ n ÿ j “ G i p j q “ n ÿ j “ i ! p j ` i ´ q i “ i ! ˆ p n ` ` i ´ q i ` i ` ˙ “ p i ` q ! p n ` i q i ` . As p i ´ q i “ p i ´ qp i ´ q ¨ ¨ ¨ p i ´ ´ p i ´ qq and in the latter product the lastfactor equals zero, we get G i p q “ [\ We want to express the value of g p n, m q for n, m ą G i p n q for i P t , . . . , m u . But before we can do this, we need the followingresult, which is implied by the recursion equation from Definition 3. Proposition 6.
For any n, m ą we have g p n, m q “ ˜ n ÿ i “ g p i, m ´ q ¸ ` g p , m q ´ n tate Complexity of Permutation on Finite Languages 9 Proof.
We do induction on n and use Definition 3. First, as m ą g p , m q “ g p , m ´ q ` g p , m q ´ `
1. Then, inductively, g p n ` , m q “ g p n ` , m ´ q ` g p n, m q ´ “ g p n ` , m ´ q ` ˜« n ÿ i “ g p i, m ´ q ff ` g p , m q ´ n ¸ ´ “ ˜ n ` ÿ i “ g p i, m ´ q ¸ ` g p , m q ´ p n ` q . [\ Note that Proposition 6 does not hold if m “
0. But it also works for n “ ř i “ a i equal zero by definition. Proposition 7.
For any n, m ą we have g p n, m q “ G m ` p n q ` ˜ m ÿ i “ i ¨ G m ´ i ` p n q ¸ ` p m ` q . Proof.
We use induction on m and Proposition 6. By Proposition 6, for n ą
0, wehave g p n, q “ p ř ni “ g p i, qq` g p , q´ n “ ř ni “ p i ` q` ´ n “ G p n q` G p n q` m ě g p n, m ` q “ ˜ n ÿ l “ g p l, m q ¸ ` g p , m ` q ´ n “ ˜ n ÿ l “ « G m ` p l q ` ˜ m ÿ i “ i ¨ G m ´ i ` p l q ¸ ` p m ` q ff¸ ` g p , m ` q ´ n “ G m ` p n q ` ˜ m ÿ i “ i ¨ G m ` ´ i p n q ¸ ` p m ` q G p n q ` g p , m ` q“ G m ` p n q ` ˜ m ` ÿ i “ i ¨ G m ` ´ i p n q ¸ ` g p , m ` q“ G m ` p n q ` ˜ m ` ÿ i “ i ¨ G m ` ´ i p n q ¸ ` p m ` q ` . Hence, the claim is shown. [\ p L q “ U (cid:1) . . . (cid:1) U k Here, we look closer at finite languages L Ď Σ ˚ such that perm p L q “ U (cid:1) . . . (cid:1) U k with U j Ď t a j u ˚ . These languages are special, as for them the boundstated in Theorem 2 is actually attained. For these languages, we state a boundexpressed in terms of the state complexity of the original automaton. For ourclass in question, this bound is an improvement of the general bound statedin [8, 20] for binary alphabets. First, we state a result which implies that for thelanguage class under consideration, the state complexity of the permutationalclosure is maximal. Proposition 8.
Let L “ U (cid:1) . . . (cid:1) U k with U j Ď t a j u ˚ (which implies L “ perm p L q ). Then sc p L q “ ´ś kj “ p sc p U j q ´ q ¯ ` .Proof. For j P t , . . . , k u set n j “ p sc p U j q ´ q . Then n j is the length of thelongest string in U j . Let u “ a i ¨ ¨ ¨ a i k k and v “ a i ¨ ¨ ¨ a i k k with u ‰ v . First,suppose max t i j , i j u ď n j for all j P t , . . . , k u . Suppose, w.l.o.g., i j ă i j forsome j P t , . . . , k u . Set w “ a n ´ i ¨ ¨ ¨ a n k ´ i k k . Then uv P L , but vw R L ,as i j ` p n j ´ i j q ą n j . Otherwise, suppose, w.l.o.g., that i j ą n j for some j P t , . . . , k u . If also i j ą n j for some j P t , . . . , k u , then t uw, vw u X L “ H for every w P Σ ˚ . Hence u ” L v . If not, then i j ď n j for all j P t , . . . , k u .Set w “ a n j ´ i ¨ ¨ ¨ a n k ´ i k k . Then vw P L , but uw R L . So, the words a i ¨ ¨ ¨ a i k k with i j ď n j for all j P t , . . . , k u are all inequivalent with respect to the Neroderight-congruence, the words a i ¨ ¨ ¨ a i k k with i j ą n j for some j P t , . . . , k u areall equivalent, and none of these latter words is equivalent to any one of thepreviously considered words a i ¨ ¨ ¨ a i k k with i j ď n j for all j P t , . . . , k u . Thisgives sc p L q ě ´ś kj “ p sc p U j q ´ q ¯ ` [\ As for a finite unary language U j Ď t a j u ˚ , we have sc p U j q “ max t| u | | u P U j u `
2, we conclude that if L is finite with perm p L q “ U (cid:1) . . . (cid:1) U k , thenthe state complexity of the permutational closure is maximal. Next, we observethat for these languages, we can also bound the state complexity of the originallanguage from below. Note that, as perm p perm p L qq “ perm p L q , this also gives alower bound for the state complexity of perm p L q . Lemma 3. If L Ď Σ ˚ is finite and perm p L q “ U (cid:1) . . . (cid:1) U k with U j Ď t a j u ˚ for j P t , . . . , k u , then sc p L q ě p ř kj “ max t| u | | u P U j uq ` .Proof. Set m j “ max t| u | | u P U j u for j P t , . . . , k u and w “ a m ¨ ¨ ¨ a m k k .Then w P U (cid:1) . . . (cid:1) U k “ perm p L q . Hence we have some permutation u of w with u P L . If v P L is arbitrary, then | v | “ ř kj “ | v | a j ď ř kj “ m j “ | u | . So, | u | “ max t| w | | w P L u . For finite languages, the length of the longest string of L is at most sc p L q ´
2. This observation gives our claim. [\ Using Lemma 3 and the AM-GM inequality (1), we can derive a boundexpressed with the state complexity of the original language.
Theorem 3.
Let L Ď Σ ˚ be a finite language such that perm p L q “ U (cid:1) . . . (cid:1) U k with U j Ď t a j u ˚ for j P t , . . . k u and sc p L q “ n . Then sc p perm p L qq ď ˆ n ` | Σ | ´ | Σ | ˙ | Σ | ` Proof.
Set m j “ max t| u | | u P U j u for j P t , . . . , k u . By Theorem 2, we havesc p perm p L qq ď ´ś kj “ p m j ` q ¯ `
1. By the AM–GM inequality (1), we have ˜ k ź j “ p m j ` q ¸ ` ď ˜ p ř kj “ m j q ` kk ¸ k ` . tate Complexity of Permutation on Finite Languages 11 Using Lemma 3, we find p ř kj “ m j q ` k ď n ` p k ´ q , so ˜ p ř kj “ m j q ` kk ¸ k ď ˆ n ` p k ´ q k ˙ k . Combining everything gives our claim. [\ Note that the above bound does not hold in general. For example, let n ą m ě Σ “ t a, b u with L “ Σ m a n ´ m . Then sc p L q “ n ` p perm p L qq “ n ` p n ´ q ` p n ´ q ` . . . p n ´ m qq `
2. In particular, for m “ p n ´ q , we getsc p perm p L qq “ n p n ` q `
2, and n p n ` q ` ą n ` n ě We have given a tight bound for the state complexity of the permutation of afinite language. This bound is expressed in terms of the unary projection lan-guages and depends on the alphabet size. As the state complexity of a regularitypreserving operation is usually expressed in terms of the state complexity ofthe input language(s), the question about the relation of this state complexityand the unary projection languages arises. We derived bounds on how large thestate complexity for a finite language can get for given bounds on the numberof symbols in each word. The lower bound we have derived is tight, as it isachieved by the permutational closure of a finite language for which this clo-sure has maximal state complexity. But, we do not know if the upper bound istight. Beside from that, for future investigations, similar questions on the rela-tion between the state complexity sc p L q and the numbers max t| u | a j | u P L u for L Ď Σ ˚ and j P t , . . . , k u could be asked, for example, characterizing thosefinite languages for which the state complexity is strictly larger than that ofthe permutation closure, or for which the state complexity of the permutationalclosure is strictly larger. Lastly, we have looked at a restricted class and deriveda (non-tight) state complexity bound expressed in terms of the state complexityof the original automaton. Bibliography [1] Aigner, M.: Diskrete Mathematik. Vieweg+Teubner Verlag, Germany, 6th edn.(2006)[2] Brzozowski, J.A., Jir´askov´a, G., Liu, B., Rajasekaran, A., Szyku la, M.: On thestate complexity of the shuffle of regular languages. In: Cˆampeanu, C., Manea, F.,Shallit, J.O. (eds.) Descriptional Complexity of Formal Systems - 18th IFIP WG1.2 International Conference, DCFS 2016, Bucharest, Romania, July 5-8, 2016.Proceedings. Lecture Notes in Computer Science, vol. 9777, pp. 73–86. Springer(2016), https://doi.org/10.1007/978-3-319-41114-9 (2/3), 189–202 (2004)[4] Cˆampeanu, C., II, K.C., Salomaa, K., Yu, S.: State complexity of basic operationson finite languages. In: Boldt, O., J¨urgensen, H. (eds.) Automata Implementa-tion, 4th International Workshop on Implementing Automata, WIA’99, Potsdam,Germany, July 17-19, 1999, Revised Papers. Lecture Notes in Computer Science,vol. 2214, pp. 60–70. Springer (1999)[5] Cˆampeanu, C., Salomaa, K., Yu, S.: State complexity of regular languages: Finiteversus infinite. In: Calude, C., Paun, G. (eds.) Finite Versus Infinite, pp. 53–73.Discrete mathematics and theoretical computer science, Springer (2000)[6] Cˆampeanu, C., Salomaa, K., Yu, S.: Tight lower bound for the state complexityof shuffle of regular languages. J. Autom. Lang. Comb. (3), 303–310 (2002)[7] Cauchy, A.L.: Cours d’analyse de l’´Ecole Royale Polytechnique. Cambridge Li-brary Collection - Mathematics, Cambridge University Press (2009)[8] Cho, D., Goc, D., Han, Y., Ko, S., Palioudakis, A., Salomaa, K.: State complexityof permutation on finite languages over a binary alphabet. Theor. Comput. Sci. , 67–78 (2017)[9] Dickson, L.E.: Finiteness of the odd perfect and primitive abundant numbers withn distinct prime factors. American Journal of Mathematics (4), 413–422 (1913)[10] Gao, Y., Moreira, N., Reis, R., Yu, S.: A survey on operational state complexity.Journal of Automata, Languages and Combinatorics (4), 251–310 (2017)[11] G´omez, A.C., Guaiana, G., Pin, J.: Regular languages and partial commutations.Inf. Comput. , 76–96 (2013), https://doi.org/10.1016/j.ic.2013.07.003 [12] Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundationfor Computer Science. Addison-Wesley Longman Publishing Co., Inc., USA, 2ndedn. (1994)[13] Gruber, H., Holzer, M.: On the average state and transition complexity of finitelanguages. Theor. Comput. Sci. (2), 155–166 (2007)[14] Hoffmann, S.: State complexity, properties and generalizations of commutativeregular languages. Information and Computation (to appear) [15] Hoffmann, S.: Commutative regular languages - properties and state complexity.In: Ciric, M., Droste, M., Pin, J. (eds.) Algebraic Informatics - 8th InternationalConference, CAI 2019, Niˇs, Serbia, June 30 - July 4, 2019, Proceedings. LectureNotes in Computer Science, vol. 11545, pp. 151–163. Springer (2019)[16] Hoffmann, S.: State complexity bounds for the commutative closure of group lan-guages. CoRR abs/2004.11772 (2020), https://arxiv.org/abs/2004.11772 [17] Holzer, M., Jakobi, S.: Descriptional complexity of chop operations on unary andfinite languages. J. Autom. Lang. Comb. (2-4), 165–183 (2012)[18] Lavado, G.J., Pighizzini, G., Seki, S.: Operational state complexity underparikh equivalence. In: J¨urgensen, H., Karhum¨aki, J., Okhotin, A. (eds.)Descriptional Complexity of Formal Systems - 16th International Work-shop, DCFS 2014, Turku, Finland, August 5-8, 2014. Proceedings. Lec-ture Notes in Computer Science, vol. 8614, pp. 294–305. Springer (2014), https://doi.org/10.1007/978-3-319-09704-6_26 [19] Maslov, A.N.: Estimates of the number of states of finite automata. Dokl. Akad.Nauk SSSR (6), 1266–1268 (1970)[20] Palioudakis, A., Cho, D., Goc, D., Han, Y., Ko, S., Salomaa, K.: The state com-plexity of permutations on finite languages over binary alphabets. In: Shallit, J.O.,Okhotin, A. (eds.) Descriptional Complexity of Formal Systems - 17th Interna-tional Workshop, DCFS 2015, Waterloo, ON, Canada, June 25-27, 2015. Proceed-ings. Lecture Notes in Comp. Science, vol. 9118, pp. 220–230. Springer (2015)[21] Yu, S., Zhuang, Q., Salomaa, K.: The state complexities of some basic operationson regular languages. Theoretical Computer Science (2), 315–328 (Mar 1994)tate Complexity of Permutation on Finite Languages 13 Here we collect some proofs not given in the main text.
Let L Ď Σ ˚ be a finite language. Then, a minimal automaton A “p Σ, Q, δ, s , F q for L has a unique non-final trap state t , and if δ p q, u q “ q forany u P Σ ` , then q “ t . Also, we have a unique final state q f P F such that δ p q f , x q “ t for each x P Σ . If w P L is any word of maximal length in L ,then q f “ δ p s , w q , and for each q P Q zt t u , we have some u P Σ ˚ such that δ p q, u q “ q f .Proof. In a minimal automaton, a non-final trap state is always unique. Also, aminimal automaton admits a non-final trap state if and only if we have some word w P Σ ˚ such that wu R L for each u P Σ ˚ , which is obviously fulfilled for finitelanguages. If δ p q, u q “ q with q ‰ t , then, as q ‰ t , we have some w P Σ ˚ with δ p q, w q P F . Also, by minimality, every state is reachable, i.e., we have v P Σ ˚ with δ p s , v q “ q . This would give vu ˚ w Ď L , but as u P Σ ` , then L wouldbe infinite, which is excluded by assumption. Let q f “ δ p s , w q , with w P L ofmaximal length in L . Then, for each u P Σ ` , we have δ p q f , u q R F . Hence, for any x P Σ we have δ p q f , x q “ t , as both states are equivalent and the automaton isminimal. In any minimal automaton, a final state with this property is uniquelydetermined. Lastly, for any q P Q zt t u , we can find u P Σ ˚ such that δ p q, u q P F ,for otherwise q would equal t by minimality of the automaton. If q P F and δ p q, u q R F for each u P Σ ` , then q “ q f . Otherwise, suppose for all u P Σ ˚ we have δ p q, u q ‰ q f . By the above reasoning, we find a sequence u i P Σ ` and q i P F for i P N such that δ p q i , u i q “ q i ` P F with q “ q . But, as only at thetrap state we have a loop, this gives q i ` P F zt q , . . . , q i u . But such a sequenceis impossible for finite F . Hence, for some u P Σ ` we must have δ p q, u q “ q f . If q R F and q ‰ t , then δ p q, u q P F for some u P Σ ` , as otherwise we would have q “ t . Then, we can continue reasoning as above with δ p q, u q P F . [\ Let p n , . . . , n k q P N and j P t , . . . , n u . Then h p n , . . . , n j , . . . , n k q ă h p n , . . . , n j ` , . . . , n k q . So, h p n , . . . , n k q “ max t sc p L q | L Ď Σ ˚ , @ j P t , . . . , k u : max t| w | a j | w P L u “ n j u .Proof. Let p n , . . . , n k q P N k . Suppose L Ď Σ ˚ is a non-empty finite languagewith max t| u | a j | u P L u ď n j for j P t , . . . , k u . Fix j P t , . . . , k u . Intuitively,given an automaton for L , we can add additional states after the final state q f from Lemma 1 to read in more a j ’s, and these states are distinguishable.But, for our proof, instead of using autoamta, we will argue with quotients. ByLemma 1, reformulated for quotients, u is a longest string from L if and onlyif u ´ L “ t ε u . Set V “ t u P Σ ˚ | u ´ L “ t ε uu , m “ max t| u | a j | u P V u and U “ L Y t ua n j ` ´ mj | u P V u . (i) We have max t| u | a j | u P U u “ n j ` t| u | a r | u P U u ď n r for r P t , . . . , k uzt j u .The added words in t ua n j ` ´ mj | u P V u fulfill these bounds for the unaryprojection languages. More specifically, to argue that we actually havemax t| u | a j | u P U u “ n j ` t| u | a j | u P U u ď n j `
1, choose any word w P L with | w | a j “ max t| u | a j | u P L u . By Lemma 1, we have some x P Σ ˚ such that wx P V . Hence m “ | wx | a j “ | w | a j and | wxa n j ` ´ mj | “ n j `
1, where wxa n j ` ´ mj P U .(ii) Let u, w P Σ ˚ . If u ´ L ‰ w ´ L , then u ´ U ‰ w ´ U .Suppose u ´ L ‰ w ´ L for u, w P Σ ˚ . Without loss of generality, we canassume ux P L and wx R L for some x P Σ ˚ . We have t ε u Ď p ux q ´ L Ďp ux q ´ U . First, suppose p wx q ´ L ‰ H . Then, wx R V a n j ` ´ mj , as v ´ L “H for each v P V a n j ` ´ mj , as we read in words that are longer than thelongest strings in L . Hence, as p wx q ´ U “ p wx q ´ L Y p wx q ´ V a n j ` ´ mj ,we have t ε u X p wx q ´ U “ H , which implies p ux q ´ U ‰ p wx q ´ U . So u ´ U ‰ w ´ U . Now, suppose p wx q ´ L “ H . By Lemma 1, reformulated forquotients, we can choose y P Σ ˚ such that p uxy q ´ L “ t ε u , i.e., uxy P V .But then, a n j ` ´ mj P p uxy q ´ U . So t ε u Ď p uxya n j ` ´ mj q ´ U , but p wxya n j ` ´ mj q ´ U “ p wxya n j ` ´ mj q ´ L Y p wxya n j ` ´ mj q ´ V a n j ` ´ mj “ H , as wxy is not a prefix of any word in V . So, if u ´ L ‰ w ´ L , then u ´ U ‰ w ´ U .(iii) We have sc p L q ă sc p U q .The previous item (ii) implies sc p L q ď sc p U q . Next, we argue that we haveat least one more quotient for the language U than for L , i.e., sc p L q ă sc p U q .Choose any u P Σ ˚ . If u ´ L ‰ H , then, by Lemma 1, we can find x P Σ ˚ such that p ux q ´ L “ t ε u . Hence, if u ´ L ‰ H , then xa n j ` ´ mj P u ´ U forsome x P Σ ˚ . Hence, with (ii), we have sc p L q ´ t u ´ U | u ´ L ‰ Hu and, for any v P V , the quotient p va n j ` ´ mj q ´ U “ t ε u and, for any x P Σ ,the quotient p va n j ` ´ mj x q ´ U “ H . Hence, in total, sc p U q ě sc p L q ` p n , . . . , n k q , we can find another language whose unary projection languagesare not bounded by p n , . . . , n k q , but by p n , . . . , n j ` , . . . , n k q for any j Pt , . . . , k u and which has strictly larger state complexity. In particular, ap-plied to a language with state complexity h p n , . . . , n k q , gives our claim. So,if sc p L q “ h p n , . . . , n k q with | w | a j ď n j for each w P L and j P t , . . . , k u , thenmax t| w | a j | w P L u “ n j , which implies the alternative form for h p n , . . . , n k q . [\ tate Complexity of Permutation on Finite Languages 15 For each n ě we have g p , . . . , , n, , . . . , q “ n ` . Proof.
By definition g p , . . . , q “
2. Then, for any n ě
0, we can reason induc-tively: g p , . . . , n ` , . . . , q “ g p , . . . , n, . . . , q ` “ n ` ` “ p n ` q ` . [\ Lastly, let us tabulate some values of g p n, m q . n mn m