<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Series</journal-title>
      </journal-title-group>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Kleene Closure and State Complexity</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Galina Jirásková</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Matúš Palmovský</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Mathematical Institute, Slovak Academy of Sciences Grešákova 6</institution>
          ,
          <addr-line>040 01 Košice</addr-line>
          ,
          <country country="SK">Slovakia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2013</year>
      </pub-date>
      <volume>1003</volume>
      <fpage>94</fpage>
      <lpage>100</lpage>
      <abstract>
        <p>We prove that the automaton presented by Maslov [Soviet Math. Doklady 11, 1373-1375 (1970)] meets the upper bound 3/4 · 2n on the state complexity of Kleene closure. This fixes a small error in this paper that claimed the upper bound 3/4 · 2n − 1. Our main result shows that the upper bounds 2n−1 + 2n−1−k on the state complexity of Kleene closure of a language accepted by an n-state DFA with k final states are tight for every k in the binary case. We also present some results of our calculations. We consider not only the worst case, but we study all possible values that can be obtained as the state complexity of Kleene closure of a regular language accepted by a minimal n-state DFA. Using the lists of pairwise non-isomorphic binary automata of 2,3,4, and 5 states, we compute the frequencies of the resulting complexities for Kleene closure, and show that every value in the range from 1 to 3/4 · 2n occurs at least ones. In the case of n = 6, 7, 8, we change the strategy, and consider binary automata, in which the first symbol is a circular shift of the states, and the second symbol is generated randomly. We show that all values from 1 to 3/4 · 2n are attainable, that is, for every m with 1 ≤ m ≤ 3/4 · 2n, there exists an nstate binary DFA A such that the state complexity of L(A)∗ is exactly m.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Kleene closure is a basic operation on formal languages
which is defined as</p>
      <p>
        L∗ = { w | w = v1v2 · · · vk, k ≥ 0, vi ∈ L for all i} .
It is known that if L is recognized by an n-state
deterministic finite automaton (DFA), then the language L∗ is
recognized by a DFA of at most 3/4 · 2n states [
        <xref ref-type="bibr" rid="ref13 ref8">8, 13</xref>
        ]. The first
worst-case example meeting this upper bound was
presented already by Maslov in 1970 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. However, he did
a small error and did not give any proof in his paper.
      </p>
      <p>
        Later, Yu, Zhuang, and Salomaa [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] proved that the
size of the minimal DFA for Kleene closure depends on
the number of final states of a given DFA, and that the
upper bound is 2n−1 + 2n−1−k, where k is the number of
final and non-initial states.
      </p>
      <p>∗Research supported by grants VEGA 2/0183/11, APVV-0035-10.
† Research supported by grants VEGA 2/0183/11, APVV-0035-10.</p>
      <p>
        In this paper we give a proof of Maslov’s result and we
fix an error in his paper [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] by proving that Maslov’s
automaton meets the upper bound 3/4 · 2n. Then we show
that the upper bounds 2n−1 + 2n−1−k are tight for every n
and k with 1 ≤ k ≤ n − 1. This is the main result of our
paper. The witness automata are defined over a binary
alphabet. The size of the alphabet is optimal since the state
complexity of Kleene closure over a unary alphabet is only
(n − 1)2 + 1.
      </p>
      <p>In the second part of our paper we consider not only
the worst case, but rather study all possible values that can
be obtained as the number of states of the minimal DFA
recognizing the Kleene closure of a regular language
represented by a minimal n-state DFA. The problem is known
as "the magic number problem" in the literature, and so
called "magic numbers" are exactly the "holes" in the
hierarchy that cannot be obtained in such a way.</p>
      <p>
        The problem was first stated for NFA to DFA conversion
by Iwama, Kambayashi, and Takaki in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. It is known
that in the ternary case, no magic numbers exist, that is,
each value from n to 2n may be obtained as the size of the
minimal DFA equivalent to a given minimal n-state NFA
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. On the other hand, it is known that in the unary case,
magic numbers exist [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], but we do not know which values
are magic. The binary case is still open.
      </p>
      <p>
        For Kleene closure, the possible resulting vales are in
the range from 1 to 3/4 · 2n, for an alphabet of at least
two symbols, and in the range from 1 to (n − 1)2 + 1 for a
unary alphabet, and it is known that for a growing alphabet
of size 2n, no magic numbers exist [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>Here we study the binary case. Using the lists of
pairwise non-isomorphic automata of 2,3,4, and 5 states, we
compute the frequencies of the resulting complexities for
Kleene closure, and show that every value in the range
from 1 to 3/4 · 2n occurs at least ones. We display our
results in graphs, and compute the average complexity.</p>
      <p>In the case of n = 6, 7, 8, we change the strategy, and
consider binary automata, in which the first symbol is a
circular shift of the states, and the second symbol is
generated randomly. We consider an arbitrary number of final
states. We show that all values from 1 to 3/4 · 2n are
attainable, and we show that for every m with 1 ≤ m ≤ 3/4 · 2n,
there exists an n-state binary DFA A such that the state
complexity of L(A)∗ is exactly m.</p>
      <p>
        Thus our calculations show, that in the binary case, up
to n = 8, no magic numbers exists. Moreover, for every n,
the numbers 1, n, and 2n−1 + 2n−1−k with 1 ≤ k ≤ n − 1 are
attainable by the complexity of Kleene closure. The
situation is completely different in the case of a unary alphabet,
where two holes of length n exist for every n [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>Let Σ be a finite alphabet and Σ∗ the set of all strings over
Σ. The empty string is denoted by ε . The length of a string
w is | w| . A language is any subset of Σ∗. We denote the
size of a set A by | A| , and its power-set by 2A.</p>
      <p>A deterministic finite state automaton is a quintuple
A = (Q, Σ,δ , s, F ), where Q is a finite set of states; Σ is a
finite set of input symbols; δ is the transition function that
takes as arguments a state and an input symbol and returns
a state; s is an element of Q called the initial state; F is
the set of final states (or accepting states), F ⊆ Q. The
language accepted or recognized by the DFA A is defined
as the set L(A) = { w ∈ Σ∗ | δ (s, w) ∈ F } .</p>
      <p>A nondeterministic finite automaton is a quintuple A =
(Q, Σ,δ , s, F ), where Q, Σ, s, and F are the same as for a
DFA, and δ is the transition function that takes a state in Q
and an input symbol in Σ as arguments and returns a subset
of Q. The language accepted or recognized by the NFA A
is defined as the set L(A) = { w ∈ Σ∗ | δ (s, w) ∩ F 6= 0/} .</p>
      <p>Two automata are equivalent if they recognize the same
language.</p>
      <p>A DFA A is minimal if every equivalent DFA has at
least as many states as A. It is known that every regular
language has a unique, up to isomorphism, minimal DFA,
and that a DFA A = (Q, Σ,δ , s, F ) is minimal if an only if
(i) all its states are reachable, that is, for every state q in
Q, where exists a string w in Σ∗ such that δ (s, w) = q;
and
(ii) no two distinct states are equivalent; two states p and
q are equivalent if for every string w in Σ∗, δ (p, w) ∈
F if and only if δ (q, w) ∈ F.</p>
      <p>The state complexity of a regular language L, denoted by
sc(L), is number of states in the minimal DFA accepting
the language L.</p>
      <p>
        Every NFA can be converted to an equivalent DFA
by the subset construction [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] as follows. Let A =
(Q, Σ,δ , s, F ) be an NFA. Construct the DFA A′ =
(2Q, Σ,δ ′ , { s} , F ′ ), where F ′ = { R ⊆ Q | R ∩ F 6= 0/} , and
δ ′ (R, a) = Sr∈R δ (r, a) for each R in 2Q and each a in Σ.
The DFA A′ is called the subset automaton of the NFA A.
The subset automaton need not be minimal since some of
its states may be unreachable or equivalent.
      </p>
      <p>To prove that states of a DFA are not equivalent, we will
use the following observation.</p>
      <p>Proposition 1. Let N be an NFA. Let for every state q of
the NFA N, there exists a string wq such that wq is accepted
by N only from the state q. Then the subset automaton
corresponding to the NFA N does not have equivalent states.
Proof. Let S, T be subsets of states of N, where S 6= T .
Without loss of generality, there exists a state q such that
q ∈ S and q ∈/ T . Then the string wq is accepted from S but
wq is not from T . Hence S and T are not equivalent.</p>
      <p>For languages K and L the concatenation K · L is defined
as K · L = { uv | u ∈ K, v ∈ L} . The language Lk with k ≥ 0
is defined inductively by L0 = { ε } , L1 = L, Li+1 = Li · L.
Definition 1. The Kleene closure of a language L is the
language L∗ defined as</p>
      <p>L∗ = [ Li.</p>
      <p>i≥0
3</p>
    </sec>
    <sec id="sec-3">
      <title>NFA for Kleene Closure</title>
      <p>In this section we describe the construction of a
nondeterministic automaton recognizing the Kleene closure of a
given language reprezented by DFA.</p>
      <p>Let A = (Q, Σ,δ , s, F ) be the minimal DFA accepting
a language L. Construct an NFA A∗ for the language L∗
from DFA A as follows:
• For each state q in Q and each symbol a in Σ such that</p>
      <p>δ (q, a) ∈ F, add the transition on a from q to s.
• If s ∈/ F , then add a new start state q0 to Q and make
this state accepting. For each symbol a in Σ add the
transition on a
from q0 to δ (s, a) if δ (s, a) ∈/ F , and
from q0 to δ (s, a) and from q0 to s if δ (s, a) ∈ F.</p>
      <p>We illustrate this construction in the following example.</p>
      <p>Example 1. Consider the DFA A shown in Fig. 1. In
Fig. 2, we add the following transitions: the transition
from s to the state s on the letter b because A has the
transition from s to the final state 2; the transition from 1 to s on
a because A has the transition from 1 to the final state 2;
the transition from 2 to s on b because A has the transition
from 2 to the final state 2.</p>
      <p>Since s is non-final, we add the new initial state q0,
make this state final, and we add transitions from q0 as
follows Since there is a transition from the old initial state
s to state 1 on the letter a in A, and 1 is non-final, we add
the new transition from the state q0 to 1 on a, and since
there is transition from s to the state 2, which is final in A,
we add the new transition from state q0 to 2 and transition
from q0 to s on the letter b.</p>
      <p>
        Yu, Zhuang, and Salomaa [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] presented the witness
language accepted by DFA shown in Fig. 3, and they
proved that it meets the upper bound 3/4 · 2n.
      </p>
      <p>
        The first witness language was presented already by
Maslov [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] in 1970. Maslov claimed, without any proof,
the upper bound for Kleene closure is 3/4 · 2n − 1 and that
the DFA from Fig. 4 meets this bound. However, Maslov’s
automaton, in fact, meets the bound 3/4 · 2n.
      </p>
      <p>Here we fix this error and provide a proof.</p>
      <p>0
1
2
n−3
n−2</p>
      <p>n−1</p>
      <p>
        First, construct an NFA N for the language L(A)∗ by
adding the transition on a from n − 2 to 0, by adding a new
initial and final state q0, and by adding the transition on a
from q0 to 1 and the transition on b from q0 to 0. The NFA
N is shown in Fig. 5.
The state complexity of Kleene closure is defined as the
minimal number of states that are sufficient and necessary
in the worst case for a DFA to accept the Kleene closure
of a regular language represented by an n-state DFA. The
following upper bound is from [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. For, the sake of
completeness we give a simplified proof here.
      </p>
      <p>
        Lemma 1 (Upper Bound [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]). Let A = (Q, Σ,δ , s, F ) be
an n-state DFA such that | F \ { s}| = k. Then the minimal
DFA for the language L(A)∗ has at most 2n−1 + 2n−1−k
states.
      </p>
      <p>Proof. Construct the NFA N for the language L(A)∗ as
described above. Consider the subset automaton of the NFA
N. Let S be a reachable subset of automaton. Notice that
if a final state of N is in S, than the state s is also in S. It
follows that only the following subsets can be reachable in
the subset automaton:
1. { q0} ;
2. S ⊆ Q with s ∈ S,
3. S ⊆ Q \ (F ∪ { s} ) and S 6= 0/.</p>
      <p>This gives at most 1 + 2n−1 + 2n−1−k − 1 reachable sets,
which gives the desired upper bound.</p>
      <p>Notice that the number 2n−1 + 2n−1−k is maximal if
k = 1. For k = 1, we have 2n−1 + 2n−1−k = 2n−1 + 2n−2 =
3/4 · 2n. Thus we get the following upper bound.</p>
      <p>Corollary 1. Let L a language accepted by an n-state
DFA. Then the minimal DFA for the language L∗ has at
most 3/4 · 2n states.</p>
      <p>The next two lemmata show that the subset automaton
of the NFA N has 3/4 · 2n reachable and pairwise
distinguishable states.</p>
      <p>Lemma 2. The subset automaton of the NFA N shown in
Fig. 5 has 3/4 · 2n reachable states.</p>
      <p>Proof. By induction on | S| , we prove that every subset S
of { 0, 1, . . . , n − 1} , such that n − 1 ∈ S implies 0 ∈ S, is
reachable. The base is | S| = 1. The set { q0} is reachable
since it is the initial state of the subset automaton. The
set { i} , where 0 ≤ i ≤ n − 2, is reached from { q0} by the</p>
      <p>b ai
string bai since we have { q0} −→ { 0} −→ { i} .</p>
      <p>Assume that every set S with | S| = k, where 1 ≤ k ≤
n − 1, is reachable. Let S = { i1, i2, i3, . . . , ik, ik+1} , where
0 ≤ i1 &lt; i2 &lt; · · · &lt; ik &lt; ik+1 ≤ n − 1, be set of size k + 1.</p>
      <p>Consider three cases:
(i) i1 = 0 and ik+1 = n − 1.</p>
      <p>Take S′ = { i2 − 1, i3 − 1, . . . , ik − 1, n − 2} . Then
| S′ | = k and therefore S′ is reachable by the induction
hypothesis. Since S′ −→a { 0, i2, i3, . . . , ik, n − 1} = S,
the set S is reachable.
(ii) i1 = 0 and ik+1 &lt; n − 1.</p>
      <p>Take S′ = { 0, i2 + x, i3 + x, . . . , ik + x, n − 1} , where
x = n − 1 − ik+1. Then | S′ | = k + 1 and S′
contains states 0 and n − 1. Therefore, the set S′
is reachable as shown in case (i). Since S′ −b→x
{ 0, i2, i3, . . . , ik, ik+1} = S, the set S is reachable.
(iii) i1 &gt; 0 and ik+1 &lt; n − 1.</p>
      <p>Take S′ = { 0, i2 − i1, i3 − i1, . . . , ik − i1, ik+1 − i1} .</p>
      <p>Then | S′ | = k + 1 and S′ contains state 0. Therefore
the set S′ is reachable as shown in cases (i) and (ii).</p>
      <p>i
Since we have | S′ | −a →1 { i1, i2, i3, . . . , ik, ik+1} = S, the
set S is reachable.</p>
      <p>We have shown that the subset automaton has 3/4.2n
reachable states.</p>
      <p>Lemma 3. All the reachable states of the subset
automaton corresponding to the NFA N shown in Fig. 5 are
pairwise distinguishable.</p>
      <p>Proof. Notice that the string an−1−i is accepted by the
NFA N only from the state i. By Proposition 1, no two
distinct subsets of { 0, 1, . . . , n − 1} are equivalent.</p>
      <p>Next, we need to show that { q0} and some final subset
S are distinguishable. If S is a final subset, then n − 1 ∈
S. Consider the string an. The set { q0} goes on an to
{ 0, 1} , which is non-final set since n ≥ 3. However, the
state n − 1 goes on an to n − 1 in the NFA. It follows that
an is accepted by the subset automaton from S. This the
string an distinguishes { q0} and S.</p>
      <p>Hence all reachable states of the subset automaton of N
are pairwise distinguishable.</p>
      <p>As a corollary of the two lemmata above, we get the
following result.</p>
      <p>Theorem 1. Let L be the language accepted by the
Maslov’s automaton shown in Fig. 4. Then the minimal
DFA for the language L∗ has 3/4 · 2n states.</p>
      <p>Proof. Let N be the NFA for the language L∗ shown in
Fig. 5. By Lemma 2, the subset automaton of N has
3/4 · 2n reachable states. By Lemma 3, these states are
distinguishable. It follows that the minimal DFA for L∗
has 3/4 · 2n states, which meets the upper bound given by
Corollary 1.</p>
      <p>Notice that the upper bound given by Lemma 2 depends
on the number of final states in a given DFA. Now, in the
main result of our paper, we present automata with k final
states that meet the upper bound 2n−1 + 2n−1−k.</p>
      <p>To this aim, consider an n-state DFA A = (Q, Σ,δ , s, F ),
where
•</p>
      <p>Q = { 0, 1, . . . , n − 1} ;
• Σ = { a, b} ;
• s = 0;
• F = { n − k, n − k + 1, n − k + 2, . . ., n − 1} ;
• δ (i, a) = (i + 1) mod n,
δ (0, b) = 0,
δ (i, b) = i + 1 if 1 ≤ i ≤ n − 3,
δ (n − 2, b) = 0,
δ (n − 1, b) = n − 1.</p>
      <p>
        The DFA A with k = 3 is shown in Fig. 6. Notice that
this automaton is obtained by a modification of YZS’94
automaton in Fig. 3 presented in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. These two automata
differ only in transitions on b in the states n − 2 and n − 1.
      </p>
      <p>Construct an NFA N for the language L(A)∗ as
described in Section 3. For k = 3, the NFA N shown in
Fig. 7. Consider the subset automaton of N, and let as
show that this subset automaton has 2n−1 + 2n−1−k
reachable and pairwise distinguishable states.</p>
      <p>b
a
a,b
a,b
a,b
a,b
a,b</p>
      <p>a
0
1
2
n−4
n−3</p>
      <p>n−2
b
b
q0
a
a,b</p>
      <p>Proof. Notice that if a reachable set contains a final state
of N, then it must contain also the state 0.</p>
      <p>The set { q0} is reachable since it is the initial state of
subset automaton. The set { 0} is reached from { q0} by
b, and since we have { 0} −→ai { i} if 1 ≤ i ≤ n − k − 1, all We conclude this section with two observations showing
subsets S with | S| = 1 are reachable. that the a numbers 1 and n can be attained by the
complex</p>
      <p>Next we have ity of Kleene closure.
{ n − k − 1} −→a { 0, n − k} −→b · · · −→b { 0, n − 2} , Proposition 2. For every n, there exists a binary language
a bn−3 b
{ 0, n − 2} −→ { 0, 1, n − 1} −−→ { 0, n − 2, n − 1} −→ { 0, n − 1} , L accepted by a minimal n-state DFA such that the
lana bi−1 guage L∗ has state complexity 1.
{ 0, n − 1} −→ { 0, 1} −−→ { 0, i} if 1 ≤ i ≤ n − k − 1.</p>
      <p>Finally, if 1 ≤ i &lt; j ≤ n − k − 1 then { i, j} is reached Proof. Let L = { a, b} ∪ { w | | w| ≥ n − 1} . The minimal
from { 0, j − i} by ai. Thus all S with | S| = 2 are reachable. DFA for L has n states. Since a ∈ L, b ∈ L, we have L∗ =</p>
      <p>Assume that every set S with | S| = t, where 2 ≤ t ≤ { a, b} , and therefore the state complexity of L∗ is 1.
n − 1, is reachable. Let S = { i1, i2, . . . , it , it+1} , where 0 ≤ Proposition 3. For every n, there exists a binary language
i1 &lt; i2 &lt; · · · &lt; it &lt; it+1 ≤ n − 1, be set of size t + 1. L accepted by a minimal n-state DFA such that the
lanConsider three cases: guage L∗ has state complexity n.
(i) i1 = 0 and it+1 = n − 1.</p>
      <p>Let S′ = { 0, i3 − i2, i4 − i2, . . . , it − i2, n − 2} . Then
S′ is of size t, thus it is reachable by the induction
hypothesis. Since we have</p>
      <p>bi2−1
S′ −→a { 0, 1, i3 − i2 + 1, . . . , it − i2 + 1, n − 1} −−−→ S,
the set S is reachable.
(ii) i1 = 0 and it+1 &lt; n − 1.</p>
      <p>Let S′ = { 0, i3 − i2, . . . , it+1 − i2, n − 1} . Then S′ is of
size t + 1 and contains 0 and n − 1, thus S′ is reachable
by (i). Since we have
S′ −→a { 0, 1, i3 − i2 + 1, . . . , it − i2 + 1, it+1 − i2 + 1}
bi2−1
−−−→ S,
the set S is reachable.
(iii) i1 &gt; 0 and it+1 &lt; n − k.</p>
      <p>Take S′ = { 0, i2 − i1, i3 − i1, . . . , it − i1, it+1 − i1} .</p>
      <p>Then | S′ | = t + 1 and S′ contains state 0. Therefore
the set S′ is reachable as shown in cases (i) and (ii).</p>
      <p>i
Since we have S′ −a →1 { i1, i2, i3, . . . , it , it+1} = S, the
set S is reachable.</p>
      <p>This proves the reachability of 2n−1 + 2n−1−k states.</p>
      <p>Lemma 5. All reachable states of the subset automaton of
the NFA N are pairwise distinguishable.</p>
      <p>Proof. Notice that in the NFA N, the string an−1−ibn is
accepted only from the state i. By Proposition 1 this proves
the distinguishability of subsets of { 0, 1, . . . , n − 1} . Now
we need to show that { q0} is not equivalent to any final
subset S of { 0, 1, . . . , n − 1} . If S is final, then there is
a final state i ≥ n − k such that i ∈ S. Then an−1−ibn is
accepted by the subset automaton from S and rejected from
{ q0} . This concludes the proof.</p>
      <p>Now, we can state our main result.</p>
      <p>Theorem 2. Let n ≥ 3 and 1 ≤ k ≤ n − 1. There exists
an n-state DFA A with k final states such that the minimal
DFA for the language L(A)∗ has 2n−1 + 2n−1−k states.</p>
      <p>Proof. Let L = ((a + b)n)∗. The minimal DFA for L has
n states. Next, we have L = L∗ and therefore the state
complexity of L∗ is n.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Two to Five-State Automata: Freqency of</title>
    </sec>
    <sec id="sec-5">
      <title>Possible Complexities for Kleene Closure</title>
      <p>In this section, we consider not only the worst case, but
rather study all possible values that can be obtained as
the number of states of the minimal DFA recognizing the
Kleene closure of a regular language represented by a
minimal n-state DFA.</p>
      <p>
        For Kleene closure, the possible resulting vales are in
the range from 1 to 3/4 · 2n, and it is known that for a
growing alphabet of size 2n, no gaps in the hierarchy of
possible complexities exist [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>Here we study the binary case. Using the lists of
pairwise non-isomorphic minimal deterministic finite
automata of 2,3,4, and 5 states, we computed the
frequencies of the resulting complexities for Kleene closure, and
showed that every value in the range from 1 to 3/4 · 2n
occurs at least ones.
5.1</p>
      <sec id="sec-5-1">
        <title>Results for Two to Five-State Automata with</title>
      </sec>
      <sec id="sec-5-2">
        <title>Average Value of Complexity for Kleene Closure</title>
        <p>Our results for n = 2, 3, 4, 5 concerning the frequency of
the resulting complexities, including the average
complexity, are displayed in the four graphs shown in Figures 8-11
on the next page.</p>
        <p>Notice that for n = 4, 5 the complexity one has the
highest frequency. On the other hand, there are only a four
DFA’s whose Kleene closure has complexity 2. Starting
with complexity 5, the frequency has a decreasing
tendency. The average values approximately n, which
coresponds to the fact that the high complexities occur very
rarely.</p>
        <p>Although, in the worst case, the Kleene closure is a
hard operation with an exponential complexity, its
average complexity is only n, which allows the operation to be
effectively used in practical applications.
This subsection is different from the previous one. For
n ≥ 6 we do not have input text files. We change the
strategy, and consider binary automata, in which the first
symbol is a circular shift of the states, and the second symbol
is generated randomly. We consider an arbitrary number
of final states. We run our application on such randomly
generated automaton. We consider an arbitrary number of
final states. We show that all values from 1 to 3/4 · 2n
are attainable, and for every m with 1 ≤ m ≤ 3/4 · 2n, we
provide an n-state binary DFA A such that the state
complexity of L(A)∗ is exactly m. The lists of these automata
for n = 6, 7, 8 follow.</p>
        <p>Thus our computations show, that in the binary case,
up to n = 8, no holes in the state complexity of Kleene
closure exist. Moreover, for every n, the numbers 1, n,
and 2n−1 + 2n−1−k with 1 ≤ k ≤ n − 1 are attainable by the
complexity of Kleene closure.
7</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>
        We studied the complexity of languages that results from
the Kleene closure operation on regular languages. First,
we proved that the n-state automata presented by Maslov
in his 1970 paper meets the upper bound 3/4 · 2n on the
state complexity of Kleene closure. We fixed a small error
in the Maslov’s paper [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], which claimed the upper bound
3/4 · 2n − 1.
      </p>
      <p>Then, in the main result of our paper, we provided the
nstate binary automata with k final states, that meet the
upper bound 2n−1 + 2n−1−k on the state complexity of Kleene
closure.</p>
      <p>In the second part of the paper, we considered all
possible values of the complexity of Kleene closure in the
binary case. Using our application and the lists of pairwise
non-isomorphic minimal automata of 2,3,4, and 5 states,
we computed the frequency of the resulting complexities
of Kleene closure and the average complexity of Kleene
closure. We showed that each possible complexity occurs
at least once.</p>
      <p>For n = 6, 7, 8, we considered automata, in which the
first symbol is a circular shift of the states, the second
symbol is generated randomly, and the number of final states
is arbitrary. For every possible value m in the range from 1
to 3/4 · 2n, we found an n-state DFA accepted a language
such that the minimal DFA for the Kleene closure of this
language has exactly m states.</p>
      <p>Thus for n ≤ 8, every value in the range from 1 to
3/4 · 2n is attainable by the complexity of the Kleene
closure in the binary case. Whether this is true for larger
values of n remains open. Also getting the whole range of
complexities from 1 to 3/4 · 2n for any fixed alphabet, or
at least for an alphabet that grows at most linearly with n,
is of great interest to us.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Brzozowski</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leiss</surname>
          </string-name>
          , E.:
          <article-title>On equations for regular languages, finite automata, and sequential networks</article-title>
          ,
          <source>Theoret. Comput. Sci</source>
          .
          <volume>10</volume>
          ,
          <fpage>19</fpage>
          -
          <lpage>35</lpage>
          (
          <year>1980</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2] Cˇ evorová, K.:
          <article-title>Kleene star on unary regular languages</article-title>
          .
          <source>DCFS</source>
          <year>2013</year>
          , to appear.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Geffert</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>(Non)determinism and the size of one-way finite automata</article-title>
          . In: Mereghetti,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Palano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Pighizzini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Wotschke</surname>
          </string-name>
          <string-name>
            <surname>D</surname>
          </string-name>
          . (eds.) 7th
          <source>International Workshop on Descriptional Complexity of Formal Systems</source>
          , pp.
          <fpage>23</fpage>
          -
          <lpage>37</lpage>
          . University of Milano, Italy (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Hopcroft</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>An n log n algorithm for minimizing states in A finite automaton STAN-CS-71-190</article-title>
          . Computer Science (
          <year>1971</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Iwama</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kambayashi</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Takaki</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Tight bounds on the number of states of DFAs that are equivalent to n-state NFAs</article-title>
          .
          <source>Theoret. Comput. Sci</source>
          .
          <volume>237</volume>
          ,
          <fpage>485</fpage>
          -
          <lpage>494</lpage>
          (
          <year>2000</year>
          ). Preliminary version in: Bozapalidis,
          <string-name>
            <surname>S</surname>
          </string-name>
          . (ed.)
          <source>3rd International Conference on Developments in Language Theory</source>
          . Aristotle University of Thessaloniki (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Jirásková</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>On the state complexity of complements, stars, and reversals of regular languages</article-title>
          . In:
          <string-name>
            <surname>Ito</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toyama</surname>
            <given-names>M. (eds.) DLT</given-names>
          </string-name>
          <year>2008</year>
          .
          <article-title>LNCS</article-title>
          , vol.
          <volume>5257</volume>
          , pp.
          <fpage>431</fpage>
          -
          <lpage>442</lpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Jirásková</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Magic numbers and ternary alphabet</article-title>
          .
          <source>Int. J. Found. Comput. Sci</source>
          .
          <volume>22</volume>
          (
          <issue>2</issue>
          ):
          <fpage>331</fpage>
          -
          <lpage>344</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Maslov</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          :
          <article-title>Estimates of the number of states of finite automata</article-title>
          .
          <source>Soviet Math. Doklady</source>
          <volume>11</volume>
          ,
          <fpage>1373</fpage>
          -
          <lpage>1375</lpage>
          (
          <year>1970</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Sipser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Introduction to the theory of computation</article-title>
          . PWS Publishing Company, Boston (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Rabin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scott</surname>
          </string-name>
          , D.:
          <article-title>Finite automata and their decision problems</article-title>
          .
          <source>IBM Res. Develop</source>
          .
          <volume>3</volume>
          ,
          <fpage>114</fpage>
          -
          <lpage>129</lpage>
          (
          <year>1959</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Šebej</surname>
            <given-names>J.:</given-names>
          </string-name>
          <article-title>Reversal of regular language and state complexity</article-title>
          .
          <source>Master's thesis</source>
          . P.J. Šafárik University in Košice, Slovakia (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>Chapter 2: Regular languages</article-title>
          . In: Rozenberg,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Salomaa</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <source>Handbook of Formal Languages - Vol. I</source>
          , pp.
          <fpage>41</fpage>
          -
          <lpage>110</lpage>
          . Springer, Heidelberg (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhuang</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salomaa</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>The state complexity of some basic operations on regular languages</article-title>
          .
          <source>Theoret. Comput. Sci</source>
          .
          <volume>125</volume>
          ,
          <fpage>315</fpage>
          -
          <lpage>328</lpage>
          (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>