Fast Synchronization of Random Automata

A synchronizing word for an automaton is a word that brings that automaton into one and the same state, regardless of the starting position. Cerny conjectured in 1964 that if a n-state deterministic automaton has a synchronizing word, then it has a synchronizing word of size at most (n-1)^2. Berlinkov recently made a breakthrough in the probabilistic analysis of synchronization by proving that with high probability, an automaton has a synchronizing word. In this article, we prove that with high probability an automaton admits a synchronizing word of length smaller than n^(1+\epsilon), and therefore that the Cerny conjecture holds with high probability.


Introduction
A synchronizing word (or a reset word ) for an automaton is a word that brings that automaton into one and the same state, regardless of the starting position.This notion, first formalized by Černý in the sixties, arises naturally in automata theory and its extensions, and plays an important role in several application areas [14].Perhaps one of the reasons synchronizing automata are still intensively studied in theoretical computer science is a beautiful question asked by Černý [13] back in 1964: "Does every synchronizing n-state automaton admits a synchronizing word of length at most (n − 1) 2 ?" The bound of (n − 1) 2 , as shown by Černý, is best possible.This question, known as Černý's conjecture, is one of the most famous conjectures in automata theory.Though established for important subclasses of automata, Černý's conjecture remains open in the general case.The best known upper bound, established in the early eighties [12,6], is 1  6 (n 3 − n).For a more detailed account on Černý's conjecture, we refer the interested reader to Volkov's article [14].Probabilistic Černý conjecture.Considering Černý's conjecture from a probabilistic point of view is natural (see for instance [3]), and leads to the following questions: Question 1: Is a random automaton synchronizing with high probability?Question 2: Does a synchronizing n-state automaton admits a synchronizing word of length at most (n − 1)2 with high probability?
Here, with high probability means "with probability that tends to 1 as n goes to infinity".
Berlinkov recently made a breakthrough by giving a positive answer to Question 1 [2]: he proved that the probability that a random automaton is not synchronizing is in O(n −1 2 |A| ), for an alphabet A with at least two letters.Question 2 can be simulated and experimental evidence suggests that most automata are synchronized by a short synchronizing word, of length sublinear in the number of states.Note that simulating the second question is nontrivial, as finding the shortest reset word is hard [11]; the best experimental results we are aware of were obtained by Kisielewicz, Kowalski, and Szykula [9].
Our results.In this paper we give a positive answer to Question 2 when the automaton is chosen uniformly among deterministic and complete n-state automata on an alphabet with at least two letters.More precisely, we show that for any > 0, the probability that a random n-state automaton has a synchronizing word of length smaller than n 1+ tends to 1 when n goes to infinity.Of course, an immediate consequence is that if Černý's conjecture is false, a counterexample will hardly be found by mere uniform random exploration.
Our proof also gives another way to show that automata are synchronizing with high probability, based on a completely different method: Berlinkov used advanced properties on the highest tree in a random mapping to study the stable pairs of the automaton, where we directly build words that iteratively shrink the set of states, using only basic discrete probabilities and variations on the probabilistic pigeonhole principle 1 .The proof proposed by Berlinkov is arguably more complicated but also more precise since it gives the error term in O(n − 1 2 |A| ) for the probability of not being synchronizing 2 .There is little hope that the method presented below can be used to achieve such a precise estimation of the number of non-synchronizing automata.

Definitions and notations
Basic notations.For any integer n ≥ 1, let [n] = {1, . . ., n} be the set of integer from 1 to n.The cardinality of a finite set E is denoted by |E|.
Automata.Let A be a finite alphabet, a deterministic automaton on A is a pair (Q, δ), where Q is a finite set of states and δ is the transition function, a (possibly partial) mapping from Q × A to Q.If p, q ∈ Q and a ∈ A are such that δ(p, a) = q, then (p, a, q) is the transition from p to q labelled by a, and is denoted by p a − → q.It is an a-transition outgoing from p.In this article, we are not interested in initial and final states since they do not matter for the synchronization.We will also focus on deterministic automata only, and therefore, throughout the article, we will simply call "automaton" a deterministic automaton with no initial and final states.
An automaton A = (Q, δ) on A is classically seen as a labelled directed graph of set of vertices Q and whose edges are the transitions of A.
An automaton is complete when its transition function is a total function and incomplete otherwise.The transition function is extended inductively to Q × A * by setting δ(p, ε) = p for every p ∈ Q and, for every u ∈ A * , δ(p, ua) = δ(δ(p, a), u) when everything is defined, and undefined otherwise.If u ∈ A * , we denote by δ u the (possibly partial) function from Q to Q defined by δ u (p) = δ(p, u), for all p ∈ Q.
If A = (Q, δ) is an automaton on A, an extension of A is an automaton B = (Q, λ) on A such that for all p ∈ Q and all a ∈ A, if δ(p, a) is defined then λ(p, a) = δ(p, a).The automaton B is therefore obtained from A by adding some transitions.We denote by Ext(A) the set of all the extensions of an automaton A. If H is a set of automata, we denote by Ext(H) the union of all the Ext(A) for A ∈ H.

Synchronization.
Let A be an automaton on A. Two states p and q of A are synchronized by the word w ∈ A * when both δ w (p) and δ w (q) exist and are equal.
A synchronizing word for an automaton A = (Q, δ) is a word w ∈ A * such that δ w is a constant map: there exists a state r ∈ Q such that for every p in Q, δ w (p) = r.An automaton that has a synchronizing word is said to be synchronizing.Mappings.A mapping on a set E is a total function from E to E. When E is finite, a mapping f on E can be seen as a directed graph with an edge i → j whenever f (i) = j.An example of such a graph is depicted in Figure 1 page 10.
If f is a mapping on E, x ∈ E is a cyclic point of f (or f -cyclic point when there are several mappings) when there exists an integer i > 0 such that f i (x) = x.In the sequel, E will often be the set of states of an automaton, and we will therefore use the term "state" instead of "point": f -cyclic state, . . .If f is a mapping on E and x ∈ E, the height of x is the smallest i ≥ 0 such that f i (x) is a cyclic point.The height of a cyclic point is therefore 0. The height of a mapping on E is the maximal height of the elements of E. The mapping depicted in Figure 1 page 10 has height 3, and the maximal height is reached by 9.
Probabilities.Let (E, s) be a pair where E is a set and s is a size function s from E to Z ≥0 .The pair (E, s) is a combinatorial set3 when for every integer n ≥ 0, the set E n of size-n elements of E is finite.To simplify the definitions, we also assume that E n = ∅ for every n ≥ 1, which will always be the case in the following.Let (P n ) n≥1 be a sequence of total functions such that for each n ≥ 1, P n is a probability on E n .We say that a property P holds with high probability (whp) for (P n ) n≥1 when P n [P holds] → 1 as n → ∞.
We will often consider the uniform distribution on E, which is the sequence (P n ) n≥1 defined by P n [{e}] = 1  |En| for any e in E n : A sentence like "property P holds whp for the uniform distribution on E" therefore means that the probability that P holds tends to 1 as n tends to infinity, when for each n we consider the uniform distribution on E n .The reader is referred to [5] for more information on combinatorial probabilistic models.
Random mappings and random p-mappings.A random mapping of size n ≥ 1 is a mapping on [n] taken with the uniform distribution.If p is a probability mass function on [n], a random p-mapping is the distribution on the mappings on [n] such that the probability of a mapping f is i∈[n] p(f (i)): the image of each i ∈ [n] is chosen independently following the probability p.
A result stated as "a random p-mapping satisfies property P whp" means that for any sequence (p n ) n≥1 , where p n is a probability on [n], the probability that a p n -random mapping on [n] satisfies P tends to 1 as n tends to infinity.It is therefore a strong result that does not depend on the choice of (p n ) n≥1 .Random automata.In the sequel, the set of states of an n-state automaton will always be [n].With this condition, there are exactly n |A|n complete automata with n states on |A|, and we are therefore interested in the uniform distribution where each size-n complete automaton has probability n −|A|n .Note that one can also see this distribution as drawing uniformly at random and independently in [n] the image of each δ(p, a), for all p ∈ [n] and a ∈ A. These alternative way to look at random automata will be widely used in the sequel, especially in the following way: for a fixed incomplete automaton A with n states, the uniform distribution on complete automata of Ext(A) can be seen as setting uniformly at random and independently in [n] the transitions that are undefined in A.

Preliminary classical results
In this section, we recall some classical results that will be useful in sequel.Though elementary, these results are the main ingredients of this article.The proofs are not new but given for completeness.
We start with the following property for synchronizing automata: an automaton is synchronizing if and only if every pair of states can be synchronized.
Lemma 1 Let A be an n-state automaton and be a non-negative integer.If for every pair of states (p, q) in A there exists a word u of length at most such that δ u (p) = δ u (q), then A admits a synchronizing word of length at most (n − 1).
Proof: Assume we successfully synchronized i pairwise distinct states q 1 , . . .q i using a word u of length smaller than or equal to (i − 1): for all j, k ∈ {1, . . .i}, δ u (x j ) = δ u (x k ).Let x i+1 be a state distinct from x 1 ,. . .,x i and let v be a word of length at most that synchronizes δ u (x 1 ) and δ u (x i+1 ).Then the word uv synchronizes x 1 ,. . .,x i+1 and has length at most • i.The result follows by induction.
Random mappings and random p-mappings have been studied intensively in the literature [7,4,10], using probabilistic techniques or methods from analytic combinatorics.In this section, we only recall basic properties of the typical number of cyclic points and of the typical height of a random p-mapping.This can be achieved using variations on the probabilistic pigeonhole principle only; more advanced techniques can be used to obtain more precise statements 4 , but we will only need the following results in the sequel 5 .
Lemma 2 Let > 0 be a fixed real number.For n large enough, the probability that a random p-mapping of size n has more than n 1 2 + cyclic points or that its height is greater than n The proof of Lemma 2 consists in two steps.It is first established for uniform random mappings then extended to general p-random mappings using the following technical folklore lemma.
Lemma 3 Let n and be two positive integers such that ≤ n.Let (E, ≤) be a totally ordered finite set of cardinality n.Let f be a map from E to R ≥0 , and denote by s the sum of the images by f : s = x∈E f (x).The following result holds: where the sum range over all increasing -tuples of elements of E. The sum on the left is therefore maximal when f (x) = s n , for every x ∈ E.
We prove by induction on the value of ν that every map from E to R ≥0 that sums up to s satisfies the inequality stated in the lemma.If ν(f ) = 0 then f (x) = s n for every x ∈ E. Thus, for any -tuple (x 1 , . . ., x ) we have that and therefore, since there are n such increasing sequences, Assume now that ν(f ) = 0.For the induction step, we build another map g, starting from f , such that g sums up to s, ν(g) < ν(f ) and Consider the new map g obtained from f by changing the value of y and z the following way: It is direct to verify that g is always non-negative and sums up to s.Moreover, by construction ν(g) < ν(f ).We claim that To prove this inequality, we consider three cases: • If an increasing -tuple (x 1 , . . ., x ) does not contain y nor z, then we have • We sum the contributions of tuples containing exactly one of y or z: Hence the contributions of such tuples globally do not change the value of the sum when switching from f to g.
• If both y and z are in the tuple, then Let α and β be the two positive real numbers defined by α = f (y) − s n and β = s n − f (z).We have for such a tuple.This proves Equation ( 1) and concludes the proof by induction on the value of ν.

Proof of Lemma 2:
We start with the uniform case.
Number of cyclic points (uniform case): For any integer such that 1 ≤ ≤ n, the probability that there is a cyclic part of size in a uniform random mapping is at most P (n, ) = n !n − , since we need to choose the elements that form the cyclic part, the way they are mapped to each other, and this forces images of the map which are correctly set with probability 1 n each.This is an upper bound since we do not prevent the formation of other cycles in our counting.Moreover, Hence, the probability that there is a cyclic part of length greater than or equal to n Height (uniform case): Consider an element i ∈ [n].For any integer such that 0 < < n, the probability that a uniform random mapping f on We can therefore use the previous computations.If f has height greater than or equal to , then there exists a i with more than distinct iterates.Hence, using the union bound by summing the contribution of all i ∈ [n], we get that the probability that f has height greater than n 1/2+ is at most, for n large enough, This concludes the proof for the uniform case.
We now consider the case of random p-mappings.Number of cyclic points (non-uniform case): We start as in the proof for the uniform case.The difference is that if the points involved in the cyclic part of length are x 1 , x 2 , . . ., x then the upper bound for the probability is not !n − anymore 6 but If we sum this quantity on all possible -subsets of [n] we obtain an upper bound of At this point we can apply Lemma 3 with f = p, E = [n] and s = 1 to obtain a uniform bound for P n ( ): and this is the same bound as for the uniform case, yielding the same result.Height (non-uniform case): Similarly, we start with the same idea as in the proof for the uniform case.Fix some x ∈ [n].Let (x 1 , . . ., x ) be atuple of distinct elements in [n] \ {x}.The probability that a map f is such that x i = f i (x), for all 1 ≤ i ≤ , is simply p(x 1 )p(x 2 ) • • • p(x ).Hence the probability that x has distinct iterates that are different from x when applying f is p(x 1 )p(x 2 ) • • • p(x ) where (x 1 , . . ., x ) ranges over all -tuples of pairwise distinct elements of [n] \ {x}.We obtain an upper bound by allowing one of the x i 's to be equal to x, which simplifies the writing; the bound is: since there are !ways to permute the x i 's.This is the same quantity as P n ( ) for the number of cyclic points just above, yielding the same result and concluding the proof.

Main Result
The main result of this article is the following theorem.
Theorem 4 Let be a positive real number smaller than 1  8 , and let A be an alphabet with at least two letters.For the uniform distribution, an n-state deterministic and complete automaton on A admits a synchronizing word of length smaller than n 1+ with high probability.More precisely, the probability it has no such word is in O(n − 1 8 + ).
The statement does not hold for alphabets with only one letter, since there are cycles of length greater than 1 in a random mapping whp [4]: two distinct states in such a cycle cannot be synchronized.
As a consequence of Theorem 4, a random deterministic and complete automaton is synchronizing whp; our proof therefore constitutes an alternative proof of [2] for that property.Our statement is weaker since Berlinkov also obtained bounds in O(n − 1 2 |A| ) for the error term (the number of automata that are not synchronizing), which is tight for two-letter alphabets.On the other hand, it is arguably more elementary as we mostly rely on Lemma 2 and some basic discrete probabilities; in any cases, we hope to shed a new light on the reasons why automata are often synchronizing.
If we consider the uniform distribution on synchronizing automata, we directly obtain that there exists a small synchronizing word whp, yielding the following corollary.
Corollary 5 For the uniform distribution on synchronizing deterministic and complete automata on an alphabet with at least two letters, Černý's conjecture holds with high probability.
We prove Theorem 4 in two main steps: We first construct a word w n ∈ {a, b} * such that the image of δ wn for a random n-state automaton has size at most n 1/8+4 whp.This is done by building a set G n of incomplete automata, all of which have the desired property, and showing that a random n-state automaton extends an element of G n whp.Roughly speaking, G n and w n are built by three consecutive applications of Lemma 2, starting with incomplete automata with only a-transitions, which we then augment by b-transitions in two rounds.
It remains to synchronize those n 1/8+4 states.This is done by showing that for a random automaton that extends an element of G n , any two among those n 1/8+4 states can be synchronized by a word of the form b i w n whp, with i ≤ n 1/8+5 .Lemma 1 is then used to combine these words, and also w n , into a synchronizing word for that automaton.
The remainder of this section is devoted to a more detailed proof of Theorem 4. For the presentation, we will follow an idea used by Karp in his article on random direct graphs [8]: we start from an automaton with no transition, then add new random transitions during at each step of the construction, progressively improving the synchronization.
From now on, we fix a real > 0 small enough7 .Since it is clearly sufficient to establish the result for a two-letter alphabet, we consider that A = {a, b} in the sequel.

Generating the a-transitions
The first step consists in generating all the a-transitions.This forms a mapping for δ a that follows the uniformly distribution on size-n mappings.We can therefore apply Lemma 2, and obtain that words of the form a i can already be used to reduce the number of states to be synchronized. Let and let E n denote the set of incomplete automata A with n states such that: 1. the defined transitions of A are exactly its a-transitions; 2. the action δ a of a has at most α n cyclic states; 3. the height of δ a is at most α n .
An example of an element of E n is given below.
Example 1 Let A be a mapping with 18 states, which has only a-transitions and such that δ a is the mapping of Figure 1.
The set Cyc a (A) is made of the bold labels {2, 3, 7, 11, 13, 17}.Assume that for our we have α 18 = 6, then u n = aaaaaa is used to start the synchronization: By independency, the action of letter a in a uniform random complete automaton is exactly a uniform random mapping, yielding the following consequence of Lemma 2.
Lemma 6 A random complete automaton with n states extends an element of E n whp.More precisely, the probability that such an automaton does not extend an element of E n is at most exp(−n ).
For any automaton A whose a-transitions are all defined, let Cyc a (A) denote its set of δ a -cyclic states; they also are the δ a -cyclic states of any automaton that extends A.
Let u n = a αn .By Lemma 6, we can already start the synchronization using u n , since whp the image of the set of states [n] by δ un is included in Cyc a (A), which has size at most α n .In the sequel, we therefore work on synchronizing the elements of Cyc a (A).

Adding random b-transitions that start from the δ acyclic states
Let A be a fixed element of E n .We are now working on Ext(A) and we consider the process of adding a random b-transition starting from every state of Cyc a (A).Let B ∈ Ext(A) be an automaton obtained this way and let f B denote the restriction of δ bun to Cyc a (A).It is a total map, since all the needed btransitions are defined.Moreover, the image of f B is included in Cyc a (A), as Below is depicted the map f B , which is the restriction of δ bun to Cyc a (A); an edge p = x =⇒ q means that δ b (p) = x and δ un (x) = q, so that f B (p) = q: From a probabilistic point of view, if we fix A and build B by adding uniformly at random and independently the b-transitions that start from the states of Cyc a (A), the induced distribution for the mapping f B is usually not the uniform distribution on mappings of Cyc a (A).More precisely, for any q ∈ Cyc a (A) the probability that the image by f B of an element of Cyc a (A) is q is proportional to the number of preimages of q by δ un : it is exactly 1 n |δ −1 un ({q})|, the probability that a random state is mapped to q when reading u n .For any word ω ∈ A * , let P A,ω be the function from [n] to [0, 1] defined by From the observations above, we get that once A is fixed, f B is a random pmapping, where the distribution on Cyc a (A) is given by the restriction of P A,un to Cyc a (A). Let . Applying Lemma 2 to f B yields the following result.
Lemma 7 Let A be a fixed automaton of E n .Consider the random process of building B by adding a b-transition to every element of Cyc a (A), choosing the target uniformly and independently in [n].The probability that f B has more than β n cyclic states or that it is of height greater than β n is at most exp(−n /4 ).
Proof: Let c denote the number of δ a -cyclic states in A. Recall that f B is the map from Cyc a (A) to itself defined by f B (x) = δ bun (x), for every x ∈ Cyc a (A).We consider two cases: If c ≤ β n then there is nothing to prove as Cyc a (A) already has at most β n states.The probability is therefore 0 in this case.
If c > β n , we can apply Lemma 2 when n is large enough, since f B is a p-random mapping on a set with c elements.Therefore, the probability that there are more than c 1 2 + cyclic points or that the height is greater than c This concludes the proof, as c ≥ n 1 4 gives the announced upper bound.
For any automaton B whose a-transitions are all defined and whose btransitions starting from an element of Cyc a (B) are also all defined, let Cyc f (B) denote the set of f B -cyclic states of B.
Let v n = u n (bu n ) βn .At this point, the number of states to be synchronized has been reduced to less than n 1 4 +2 whp, since the image of δ vn is included in Cyc f (B), which has size at most β n .It has been achieved by generating all the a-transitions, but using only the b-transitions that start from the δ a -cyclic states: whp, there still are at least n − α n unset b-transitions that can be used to continue the synchronization.Nonetheless, before going on we will first refine the construction of B introduced in this section by forbidding some cases, for technical reasons explained in the next section.

Forbidding correlated shapes
We have reduced the number of states to be synchronized to no more than n 1/4+2 states whp, but this quantity is still too large for the idea used at the end of the proof, we need to shrink this set once more.For an alphabet with at least one more letter c, we could use the same kind of construction as in Section 4.2, considering the restriction of δ cvn to the cyclic states of f B and would obtain less than roughly n 1/8 states to be synchronized.This is because c-transitions can be generated independently of what has been done during the previous steps.Some care is required to adapt this idea for a two-letter alphabet.We aim at using the word bb instead of the letter c in the informal description above.Let B be an incomplete automaton that extends A ∈ E n and whose defined transitions are all the a-transitions and also the b-transitions that start from the δ a -cyclic states.We are interested in building an automaton C from B, by adding some new random b-transitions, in a way such that δ bbvn is totally defined on Cyc f (B).It means that for every q ∈ Cyc f (B), the state δ b (q) must have an outgoing b-transition in C. For such an extension C of B, let g C denote the restriction of δ bbvn to Cyc f (B).
The main point here is that for a fixed B, we want g C to be defined as a random p-mapping, so that we can use Lemma 2 once more.There are, a priori, two kind of issues that can prevent this: 1.When there exists a state q ∈ Cyc f (B) such that the b-transition starting from δ b (q) is already defined in B, that is, when δ b (q) ∈ Cyc a (B).
2. When two distinct states q and q in Cyc f (B) are such that δ b (q) = δ b (q ).
Fortunately, the second issue cannot occur: if δ b (q) = δ b (q ) then f B (q) = f B (q ), which is not possible for two distinct f B -cyclic states.
The first case can occur, and then the image of δ b (q) by b is already defined in B and therefore g C does not follow a p-distribution when we build C by generating the missing transitions uniformly at random8 .
On the other hand, if for every q ∈ Cyc f (B), δ b (q) / ∈ Cyc a (B), then it is easy to verify that g C is a random p-mapping: the image of q ∈ Cyc f (B) by g C is a given x when δ bbvn (q) = x, which is equivalent to δ b (δ b (q)) ∈ δ −1 vn ({x}).Since δ b (δ b (q)) is chosen uniformly at random in [n], it happens with probability P B,vn (x), using the notation of Equation ( 2).
We therefore forbid the bad cases and define the set F n of incomplete automata B with n states such that (we add the last condition to what was done in the previous section): 1. B extends an element of E n , 2. the defined transitions of B are all the a-transitions and the b-transitions starting from the states of Cyc a (B), 3. the map f B has height at most β n and has at most β n cyclic states, 4. for every q ∈ Cyc f (B), δ b (q) / ∈ Cyc a (B).
Example 3 Assume that for our , β 18 = 3.The automaton of Example 2 is in F n : looking at the mapping f B , we can see that the f B -cyclic states are 2 and 13, and their images by δ b , which are 1 and 8 respectively, are not in Cyc a (B).
If we forget the last condition in the definition of F n , the other requirements hold whp for every fixed A ∈ E n , as a consequence of Lemma 7. Lemma 8 below states that after our additional restriction, we still have a set large enough.
Lemma 8 With high probability a random complete automaton with n states extends an element of F n .More precisely, the probability that it does not extend an element of F n is at most 2n −1/4+3 , for n large enough.
Proof: Fix A ∈ E n , and consider the extensions B of A obtained by adding b-transitions to the δ a -cyclic states.A state x of Cyc f (B) is a bad state when there exists y ∈ Cyc f (B) and z ∈ Cyc a (A) such that y b − → z and z un − − → x.In such a case, y is the cyclic predecessor of x for the mapping f B and it does not satisfy the last condition of F n 's definition.Clearly, if B is not in F n then Condition 3 is not satisfied or there is at least one bad state in B For a given x ∈ Cyc a (A) and ∈ {0, . . ., n − 1} let us bound from above the probability that x is a bad state and in a f B -cycle of length + 1 when adding the b-transitions: there must exist distinct states x 1 , . . .x of Cyc a (A), all distinct from x, such that x and the image by b of x must be in Cyc a (A).Hence δ b (x ) must belong to Cyc a (A) ∩ δ −1 un ({x}).Consequently, the probability that such a cycle exists is We sum this quantity for every possible tuple (x 1 , . . ., x ) of distinct elements of E x = [n] \ {x}.We obtain, since there are !ways to order each {x 1 , . . ., x }: by applying Lemma 3 with f = P A,un , E = E x and s = 1 − P A,un (x).But an easy computation shows that !n−1 ≤ (n − 1) , hence the probability that x is a bad state in a f B -cycle of length + 1 is at most 1 n |Cyc a (A) ∩ δ −1 un ({x})|.We now use the union bound and sum the contribution of all x ∈ Cyc a (A).Since the δ −1 un ({x}) are disjoint, we obtained that the probability that there is a bad state in a cycle of length + 1 is at most 1 n |Cyc a (A)|.Hence, since A ∈ E n , this probability is at most than n −1/2+ .By Lemma 7, the probability that Condition 3 of the definition of F n is not satisfied is smaller that exp(−n /4 ).Hence, for every fixed A ∈ E n , the probability that there is a bad state or that Condition 3 does not hold is at most Note that we do not need to consider the cases where + 1 > n 1/4+2 in the first sum, since they do not satisfy Condition 3. We therefore obtained a uniform upper bound of 3 2 • n −1/4+3 for every A ∈ E n .Since a complete automaton can extend at most one element of E n , the law of total probabilities applies and yields that: the probability that a complete automaton with n states that extends an element of E n does not satisfy Condition 3 or Condition 4 is at most 3 2 • n −1/4+3 , for n large enough.This concludes the proof since the probability of not being in E n is smaller than exp(−n ).

Adding more random b-transitions
Starting from an element of B ∈ F n , we can now use the idea explained at the beginning of Section 4.3, and add the random b-transitions that are needed for δ bb to be totally defined on Cyc f (B).For such an extension C of B, recall that the mapping g C is the restriction of δ bbvn to Cyc f (B).Let Cyc x ∈ Cyc f (B)}, then the only b-transitions of C are those starting from Cyc a (B) and from X B ; 3. the map g C has no more than γ n cyclic states and has height at most γ n ; 4. for every q ∈ Cyc g (C) the b-transition of δ bb (q) is undefined.
The last condition in the definition of G n is here for the same kind of reasons than the last condition of F n : it is used to ensure some independency for the final step of the synchronization.
Lemma 9 A random complete automaton with n states extends an element of G n whp.More precisely, the probability it does not is at most 2n −1/4+3 .
Proof: We only explain why the last condition holds whp, since one can easily prove that the probability that Condition 3 does not holds is at most exp −n /8 using the same technique as for Lemma 7.
We even prove the stronger result that whp, for every q ∈ Cyc f (B) the b-transition of δ bb (q) is undefined.Once C is built by adding the needed transitions, the defined b-transitions start from Cyc a (B) or from X B .Since B ∈ F n , the cardinality of Cyc a (B) and X B are at most α n and β n , respectively.To build C, we iteratively add new random outgoing b-transitions for each element of X B ; when we add the i-th such transition, the probability it ends in a state that has a defined outgoing b-transition is therefore at most for n large enough, by basic computations.This conclude the proof after handeling the probability that the other conditions do not hold.
Let w n = v n (bbv n ) γn .Lemma 9 ensures that in a random complete automaton A, the image of δ wn is included in Cyc g (A), which has size at most n 1/8+4 .This concludes the first part of the synchronization: the word w n maps the set of states of A to the much smaller set of states Cyc g (A) whp.We will use another technique to finalize the synchronization, which only works because Cyc g (A) is small enough whp.

Synchronizing the states of Cyc g (C)
Let λ n = n 1/8+5 and let C be a fixed automaton of G n .Starting from C ∈ G n , we now prove that the elements of Cyc g (C) can be synchronized whp, using the remaining randomness of the undefined b-transitions.We follow the idea given at the beginning of Section 4 and first prove that with high enough probability, two states of Cyc g (C) can be synchronized by a word of the form b j w n .
Lemma 10 Let C ∈ G n and let p and q be in Cyc g (C).If we add all the missing b-transitions to C by drawing them uniformly at random and independently, then the probability that for all j ∈ {0, . . ., λ n } we have δ b j •wn (p) = δ b j •wn (q) is at most 6n −3/8+5 , for n large enough.
Proof: By definition of G n , the states p 2 = δ bb (p) and q 2 = δ bb (q) have no outgoing b-transitions.If p 2 = q 2 , then p and q does not satisfy the property for j = 2. Otherwise we consider the sequence of pairs of states (p i , q i ) that is generated using the following random process, starting from i = 3: 1. generate (p i , q i ) uniformly at random and set δ b (p i−1 ) = p i and δ b (q i−1 ) = q i in the automaton; 2. if δ wn (p i ) = δ wn (q i ) then stop the process and return a success9 (and the property does not hold for j = i); 3. otherwise, if p i or q i already have an outgoing b-transition, stop the process and return a failure; 4. in other cases, iterate the process for the next value of i by going back to step 1, until i = λ n .When i = λ n , the process halts and return a failure.
Hence we iteratively and in parallel create a sequence of b-transitions, starting from p 2 and q 2 .If the process returns a success, then clearly the property of the statement does not hold.Thus the probability of returning a failure is an upper bound for the probability that it holds.Given that the process has not halted after building up to (p i−1 , q i−1 ) for 1 ≤ i < λ n , the probability that it halts at next step and returns a success is the probability that two randomly chosen elements of [n] have the same image by δ wn , which is exactly Hence, given that the process has not halted after building up to (p i−1 , q i−1 ) for 1 ≤ i < λ n , the probability that it halts at next step and returns a failure only depends on i and satisfies because it is not a failure when both p i and q i are not in Y C and are not one of the 2(i − 3) states that get a b-transition during the previous iterations of the process.This is an upper bound, since some cases yield a success (for instance when p i = q i ).Therefore, for n large enough.Note that this bound does not depend on i, and we can therefore bound the probability of a failure given that the process halts when building (p i , q i ) by P(failure at step i | has not halted before) = The probability that the process halts at a given step is greater than the probability it halts and returns a success.Hence, the probability that the process has build (p λn , q λn ) without halting is smaller than or equal to Putting all together, we get that the probability of a failure is at most for n large enough, which concludes the proof.
To conclude the proof of Theorem 4, we use the union bound: for any automaton A that extends an element of G n , which happens whp, there are less than γ 2 n pairs of states in Cyc g (A); the probability that one of these pairs (p, q) cannot be synchronized using a word of the form b j • w n is therefore at most γ 2 n • 4n −3/8+5 , which tends to 0; more precisely, it is in O(n − 1 8 +13 ).To obtain the length of the synchronizing word, we apply Lemma 1 to the elements of Cyc g (A): whp there are at most γ n such states, which can be pairwise synchronized using words of the form b j w n , of length at most |w n |+λ n .Hence, the set Cyc g (A) can be synchronized using a word z of length at most (γ n − 1)(|w n | + λ n ), which is asymptotically equivalent to n 1+11 .To conclude, observe that w n z is synchronizing, and also of length asymptotically equivalent to n 1+11 .Changing into /13 yields the result.

Conclusion
In this article we proved that most complete automata are synchronizing, since they admit a synchronizing word of length smaller than n 1+ with high probability.
Note that our proof can be turned into a probabilistic algorithm to try to quickly find a synchronizing word: Compute the action of δ un , δ vn and then δ wn in linear time.Once it is done, check whether the property of Lemma 10 holds for every pair of elements of the image of δ wn , which is small with high probability.Experiments seem to indicate that the algorithm behaves way better in practice than its theoretical analysis: it looks like an important proportion of automata that fail to fulfill every step of our construction are still detected as synchronizing by the combination of computing δ wn and synchronizing the states of its image with the b j 's.
A natural continuation of this work is to prove that with high probability automata are synchronized by words that are way shorter than n 1+ .Experiments have been done [9], and seem to indicate that the expected length of the smallest synchronizing word is often sublinear, probably in √ n.There is plenty of room to improve our construction, as the synchronizing words we obtain have very specific shapes, but it might be quite difficult to have a proof that matches what was observed during the experiments of [9].

Figure 1 :
Figure 1: This mapping represents the action of a in the automaton A.

Example 2
This is the automaton of Example 1, where the b-transitions that start from the elements of Cyc a (A) have been added (in bold): g (C) denote the set of g C -cyclic states in C. Thanks to the last condition of the definition of F n , we need to randomly choose the b-transitions starting from the images by δ b of Cyc f (B), which are all distinct since two distinct states of Cyc f (B) cannot have the same image by δ b .Let γ n = n 1/8+4 and let G n denote the set of incomplete automata C with n states such that: 1. C extends an automaton B of F n , 2. if X B denote the set of images of Cyc f (B) by δ b , i.e.X B = {δ b (x) : /8−4 by Cauchy-Schwarz inequality.Let Y C denote the set of states of C that have a defined b-transition.Since C ∈ G n , the only b-transitions of C start from elements of Cyc a (C) and from their images by b, and thus |Y C | ≤ 2α n .