Synchronized automata (1)

33
Synchronized automata Nondeterministic automata Unambiguous automata Synchronized automata (1) Marie-Pierre B´ eal, Dominique Perrin May 24, 2012 Marie-Pierre B´ eal, Dominique Perrin Synchronized automata (1)

Transcript of Synchronized automata (1)

Page 1: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Synchronized automata (1)

Marie-Pierre Beal, Dominique Perrin

May 24, 2012

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 2: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Outline

Cerny conjecture (DP)

Synchronized automataNondeterministic automataUnambiguous automataAperiodic automataLinear representations

Road coloring (MPB)

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 3: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Synchronizing words

We first consider deterministic automata.A synchronizing word is a word w such that there are paths labeledby w and all have the same terminal state. An automaton whichhas a synchronizing word is called synchronized.Elementary arguments give the cubic bound 1

2n(n − 1)2 for the

length of a synchronizing word for an n-state synchronizedautomaton. Computing the minimal length of a synchronizingword is NP-complete (Eppstein, 1990).

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 4: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

An example

A deterministic automaton with four vertices and two edges goingout of each vertex labeled B or R .

1 2

34

BRB is a synchronizing sequence: starting anywhere, it leads to 1.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 5: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Another example

With a different coloring:

1 2

34

there is no synchronizing sequence: the sets {1, 3} and {2, 4}cannot be collapsed further:

1, 3 2, 4

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 6: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Cubic bounds

Let A be a synchronized automaton with n states. For each set P

of states there is a word w of length at most n(n − 1)/2 such thatCard(P · w) < Card(P). By iteration, this proves the existence of asynchronizing word of length at most 1

2n(n − 1)2.

Refinement: a sequence P1,P2, . . . of k element subsets of an n

element set is called 2-renewing if each Pi contains a pair Ri suchthat Ri is not contained in Pj for j < i .

Proposition (Frankl, 1982)

A 2-renewing sequence has at most(

n−k+2

2

)

elements.

Consequence: existence of a synchronizing word of length at most(n3 − n)/6.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 7: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Complexity

Proposition (Eppstein,1990)

The existence of a synchronizing word of length ℓ is NP-complete.

Proof: polynomial reduction from the satisfiability of booleanformulas. Given a formula ψ = c1 ∧ c2 ∧ . . . ∧ cm with each ci adisjuction of x1, x2, . . . , xn or their negations, one builds anautomaton A(ψ) which has a synchronizing word on length n ifand only if ψ is satisfiable.As usual a binary word of length n is interpreted as a truthassignignement for the n variables.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 8: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Cerny conjecture

Conjecture (Cerny, 1964)

Any complete n-state synchronized automaton has a synchronizing

word of length at most (n − 1)2.

The hypothesis that the automaton is complete is perhaps notnecessary?

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 9: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Cerny automata

0

1

2

3

a, b

aa

a

b

b

b

0

1

23

4

a, b

a

a

a

ab

bb

b0

1

2

3

4

5

a, b

a

aa

a

ab

b

b

b

b

Figure: The automata C4, C5, C6

The word (ban−1)n−2b is a synchronizing word of length (n − 1)2.There is no shorter one.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 10: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

A nice proof (Ananisev, Gusev, Volkov)

0

1

2n − 2

n − 1

a, b

aa

ab

bb

b 0

1

2n − 2

n − 1

a

c a, ca, c

a, c

Figure: The automata Cn and Dn with c = ba

The cycles of Dn are nonnegative integer combinations of n andn − 1. The following lemma is well-kown.

Lemma

If k, ℓ ≥ 1 are relatively prime kℓ− k − ℓ is the largest integer not

expressible as a nonnegative integer combination of k, ℓ.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 11: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Proof (Cont’d)

Let w be a synchronizing word of minimal length for Cn. Setw = w ′b. Then Q · w ′ = {0, 1}. Let v be obtained from w ′

replacing each ba by c (there are no consecutive b in w).Then vc is synchronizing for Dn and thus Dn has cycles of alllengths ≥ |vc |. This forces

|vc | > n(n − 1) − n − (n − 1) = n2 − 3n + 1.

We cannot have |vc | = n2 − 3n + 2 because 1 · vc = 2 would implythat vc minus its first letter sends 2 to 2 although there is no cycleof length n2 − 3n + 1 in Dn. Thus |vc | ≥ n2 − 3n + 3 and|w ′| = |v | − (n − 2) ≥ n2 − 2n and finally |w | ≥ n2 − 2n + 1.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 12: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

The generalized conjecture

The rank of a word w in a deterministic automaton A = (Q,E ) isthe size of its image Q · w . A synchronizing word has rank 1.It has been conjectured by Pin that if an automaton admits a wordof rank at most k, then there exists such a word of length at most(n − k)2. This generalizes the Cerny conjecture. Pin’s conjecturewas proved to be false (Kari, 2001). The counterexamplecorresponds to n = 6 and k = 2.A new conjecture proposed by Volkov states that an automaton ofminimal rank k admits a word of rank k of length at most (n− k)2.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 13: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Kari’s automaton

1

2

3 4

5

6

a a

a

a a

a

b

b

b

b b

bShortest words of rank 2: x = baabababaabbabaab andy = baababaabaababaab of length 17. Shortest synchronizing wordxaababaab of length 24 = 52 − 1.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 14: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

A funny conjecture

Conjecture (Trahtman,2006)

The set of n-state complete deterministic automata with minimal

synchronizing word of length (n − 1)2 consists of the sequence of

Cerny automata and eight automata of size at most 6.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 15: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

The eight exceptional automata

1

2

3 4

5

6a aa a aa

b

b

b

b b

b

1 2 3

4

b

a b

a

b

b

a

a

1 2 3

b

a

c

c

a, c b a, b

1

2

3

c

c

a, b

a, ba

b c

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 16: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

1

2

3

4

5a, b

cc

bb

a

a

a

b

c

c

a, b

c

1

2

3

aa, b

b

bb

1 2 3

4

a

cc a, bb

a, c

c

a

bb 1

2

3

4

b

b

a

a

c c

c b, c

a, b

a

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 17: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Nondeterministic automata

A word w is synchronizing for a nondeterministic automaton ifthere is at least one path labeled by w and, for any states p, q, r , s,

pw−→ q, r

w−→ s implies p

w−→ s and r

w−→ q.

The automaton is synchronized if there is a synchronizing word.This is consistent with the previous definition. Indeed, if theautomaton is deterministic, the condition implies that q = s.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 18: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Rank

Associate to a word w the relation ϕA(w) = {(p, q)|pw→ q}.

The rank of a relation m on a set Q is the minimal cardinality of aset R such that m = uv with u a Q × R relation and v an R × Q

relation.A word w is synchronizing for a nondeterministic automaton A ifand only if the relation ϕA(w) has rank one. Indeed, if w issynchronizing, then ϕA(w) = uv where u is the column Q-vector v

is the row Q-vector defined as follows. One has up = 1 if and onlyif the is a path labeled w starting from p and vq = 1 if and only ifthere is a path labeled w ending in q.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 19: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Example

The automaton below is synchronized. Indeed, the word ab is suchthat

ϕA(ab) =

0 0 00 0 10 0 1

=

011

[

0 0 1]

and thus is synchronizing.

1

2

3

a

ab

a, b

a, b

Figure: A synchronized nondeterministic automaton.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 20: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Unambiguous automata

A nondeterministic automaton is unambiguous if, for any pair p, qof states, and any word w , there is at most one path labeled by w

going from p to q. A deterministic automaton is unambiguous.The converse is not true.One may check that an automaton is unambiguous by computingits square. The square of A is the automaton on Q ×Q with edges(p, q)

a→ (r , s) if p

a→ r and q

a→ s are edges of A. The automaton

A is unambiguous if and only if there is no path in its square ofthe form (p, p)

u→ (r , s)

v→ (q, q) with r 6= s.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 21: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Example

Let A be the automaton represented on the left.

1

2

3

a

ab

a, b

a, b

1, 1

2, 2

3, 3

1, 2

2, 1

a

ab

a, b

a, b

a, b a, b

a, b

a, b

Figure: An unambiguous automaton and part of its square.

This automaton is unambiguous as one may check by computingthe square of the automaton A represented on the right (with onlythe states accessible from the states (p, p) represented).

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 22: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Synchronizing words and recognizability of morphisms

Let f : A∗ → A∗ be a morphism with f (a) ∈ aA∗. Let x = f ω(a).Let

I = {|f (x0 · · · xn)| | n ≥ 0}

The morphism f is n-recognizable if for i ∈ I ,xi−n · · · xi+n = xj−n · · · xj+n implies j ∈ I .Example: The Fibonacci morphism f (a) = ab, f (b) = a is2-recognizable.

a b a a b a b . . .

Martin’s theorem: any primitive morphism such that x is notperiodic is recognizable.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 23: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Using the fact that

(i) for any code X there is an unambiguous automatonA = (Q, 1, 1) recognizing X ∗

(ii) The fixpoint of a primitive morphism is uniformly recurrent

one obtains

Proposition

Assume that f is injective and primitive and let A = (Q, 1, 1) be

an unambiguous automaton recognizing f (A)∗. If there is a

synchronizing word w ∈ F (x), then

(i) There is an n ≥ 1 such that any word of F of length n is

synchronizing.

(ii) The morphism f is n-recognizable.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 24: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Example

Set f (a) = ab and f (b) = a. Then x = abaababa · · · is theFibonacci word. The automaton A is represented below.

1 2a

a

b

The word a is synchronizing. Thus aa, ab and ba are synchronizingand f is 2-recognizable.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 25: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Example

Set f (a) = ab and f (b) = ba. Then x = abbabaab · · · is theThue-Morse word. The automaton A is represented below.

2 1 3

a

b

a

b

The words aa and bb are synchronizing. Thus f is 5-recognizable.In this case the automaton is deterministic and one could use aone-sided notion of recognizability from left to right (in the sameway for the previous case from right to left).

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 26: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

A nondeterministic automaton is complete if, for any word w ,there exists a pair p, q of states such that p

w−→ q is a path.

The following result gives a cubic upper bound for the length ofsynchronizing words.

Theorem (Carpi, 1988)

Let A be an n-state strongly connected complete unambiguous

automaton. If A is synchronized, it has a synchronizing word of

length at most (n2 − n + 2)(n − 1)/2.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 27: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

We introduce some terminology concerning monoids of relations ona set. For a relation m on a set Q, we denote indifferently(p, q) ∈ m or mpq = 1, considering the relation either as a subsetof Q × Q or as a boolean Q × Q matrix. We denote by mp∗ therow of of index p of the matrix m, which is the characteristicvector of the set {q ∈ Q | (p, q) ∈ m}.A monoid of relations M on a set Q is unambiguous if for anym, n ∈ M and p, q ∈ Q there exists an most one element r of Q

such that (p, r) ∈ m and (r , q) ∈ n. The monoid is transitive if forany p, q ∈ M there is an m ∈ M such that (p, q) ∈ m.An automaton is unambiguous if and only if its transition monoidis unambiguous. The automaton is strongly connected if and onlyits transition monoid is transitive.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 28: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

We use the following lemmas.A row of an element of M which is maximal among the rows of theelements of M is called a maximal row.

Lemma

Let M be a transitive unambiguous monoid of relations not

containing zero. If v is a maximal row, then vm is a maximal row

for any m ∈ M.

Lemma

Let M be a transitive unambiguous monoid of relations not

containing zero. For two elements m,m′ of M, if m ≤ m′ then

m = m′.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 29: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

The following lemma is the key of Carpi’s theorem.

Lemma

For a state p ∈ Q and a word u ∈ A∗, if ϕ(u)p∗ is not a maximal

row, there is a state q and a word v of length at most n(n − 1)/2such that ϕ(u)p∗ < ϕ(vu)q∗.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 30: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Proof of Carpi’s theorem.By the last Lemma and its symmetric form, there exist pairs(p1, u1), (p2, u2), . . . , (ps , us) in Q × A∗ and(v1, q1), (v2, q2), . . . , (vt , qt) in A∗ × Q such that, withxi = ϕ(ui · · · u1)pi∗ and yj = ϕ(v1 · · · vj)∗qi

,

(i) u1 = v1 = 1 and p1 = q1.

(ii) for 2 ≤ i ≤ s, the word ui has length at most n(n − 1)/2 andxi > xi−1.

(iii) for 2 ≤ j ≤ t, the word vj has length at most n(n − 1)/2 andyj > yj−1.

(iv) xs is a maximal row and yt is a maximal column.

Let u = us · · · u1 and v = v1 · · · vt . We have|u| ≤ (s − 1)n(n − 1)/2 and |v | ≤ (t − 1)n(n − 1)/2. Thus|uv | ≤ (s + t − 2)n(n − 1)/2. Since A is unambiguous, we havexsyt = 1.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 31: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Thus s + t ≤∑

q∈Q(xs)q +∑

q∈Q(yt)q ≤ n + 1. Let finally z ∈ A∗

be such that qtz→ ps with |z | ≤ n − 1. Then w = vzu is such that

ytxs ≤ ϕ(w). By the second Lemma, this implies ϕ(w) = ytxs ,whence the conclusion.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 32: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Example

We illustrate the proof on the automaton of the previous example.We start with u1 = v1 = ε and p1 = q1 = 1. The rowϕ(ǫ)1∗ =

[

1 0 0]

is not maximal butϕ(ǫ)1∗ < ϕ(a)3∗ =

[

1 1 0]

. Thus we choose u2 = a and p2 = 3.

Symmetrically, the column ϕ(ǫ)∗1 =[

1 0 0]t

is not maximal but

ϕ(ǫ)∗1 < ϕ(b)∗3 =[

1 1 0]t

. Thus we choose v2 = b andq2 = 3. Then ab is a synchronizing word.

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)

Page 33: Synchronized automata (1)

Synchronized automataNondeterministic automata

Unambiguous automata

Question: is Cerny conjecture true for unambiguous automata?

Marie-Pierre Beal, Dominique Perrin Synchronized automata (1)