scieee AI-readable full text Open interactive document viewer

Diameter and stationary distribution of random r-out digraphs

Addario-Berry, Louigi,Balle, Borja,Perarnau Llobet, Guillem

Abstract

Let D(n, r) be a random r-out regular directed multigraph on the set of vertices {1, . . . , n}. In this work, we establish that for every r = 2, there exists ¿r > 0 such that diam(D(n, r)) = (1 + ¿r + o(1)) logr n. The constant ¿r is related to branching processes and also appears in other models of random undirected graphs. Our techniques also allow us to bound some extremal quantities related to the stationary distribution of a simple random walk on D(n, r). In particular, we determine the asymptotic behaviour of pmax and pmin, the maximum and the minimum values of the stationary distribution. We show that with high probability pmax = n -1+o(1) and pmin = n -(1+¿r)+o(1). Our proof shows that the vertices with p(v) near to pmin lie at the top of “narrow, slippery towers”; such vertices are also responsible for increasing the diameter from (1+o(1)) logr n to (1 + ¿r + o(1)) logr n.

Full text

DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS LOUIGI ADDARIO-BERRY∗, BORJA BALLE†, AND GUILLEM PERARNAU? Abstract. Let D(n, r) be a random r-out regular directed multigraph on the set of vertices {1,...,n}. In this work, we establish that for every r≥2, there exists ηr>0 such that diam(D(n, r)) = (1 + ηr+o(1)) logrn. The constant ηris related to branching processes and also appears in other models of random undirected graphs. Our techniques also allow us to bound some extremal quantities related to the stationary distribution of a simple random walk on D(n, r). In particular, we determine the asymptotic behaviour of πmax and πmin, the maximum and the minimum values of the stationary distribution. We show that with high probability πmax =n−1+o(1) and πmin =n−(1+ηr)+o(1). Our proof shows that the vertices with π(v) near to πmin lie at the top of “narrow, slippery towers”; such vertices are also responsible for increasing the diameter from (1+o(1)) logrn to (1 + ηr+o(1)) logrn. 1. Introduction Call a random directed graph Dwith vertices V(D) = {v1, . . . , vn}arandom r-out digraph if each vertex in V(D) has out-degree r, and the nr heads of edges in E(D) are iid and uniformly distributed over V(D). We allow digraphs to have multiple edges and loops. It is useful to have a canonical construction: for each pair (i, j)∈[n]×[r], let Li,j be a uniformly random element of [n], and write D(n, d) for the random r-out digraph with vertex set [n] = {1, . . . , n}and edge set {(i, Li,j):(i, j)∈[n]×[r]}. Given a digraph D, for u, v ∈V(D) we write dist(u, v) = distD(u, v) for the number of edges in a shortest oriented path from uto v, or set dist(u, v) = ∞if there exists no such path. The diameter of Dis diam(D) = max{dist(u, v) : u, v ∈[n],dist(u, v)<∞}.(1.1) Say Dis strongly connected if dist(u, v)<∞for all u, v ∈V(D). An induced subgraph D[S] of Dis a strongly connected component of Dif D[S] is strongly connected but for all S0with S⊂S0,D[S0] is not strongly connected. In order to study cases where D is not necessarily strongly connected, we write D0=D0(n, r) for the strongly connected component of D(n, r) with the largest number of vertices (if there is more than one such component, D0is the one whose smallest labelled vertex is minimal). Let λr= max{λ: 1 −λ=e−rλ}, and let ηr=1 logr(1 −λr)−1−1=log r λrr−log r.(1.2) Observe that λr→1 and ηr→0 when r→ ∞. The main contribution of this paper is to determine diam(D(n, r)) in probability1. ∗Department of Mathematics and Statistics, McGill University, Montreal, Canada †Work done at School of Computer Science, McGill University, Montreal, Canada (Now at DeepMind, London, UK) ?Universitat Politcnica de Catalunya, Barcelona, Spain E-mail addresses:[email protected], [email protected], [email protected]. 1A sequence of random variables Xnconverges to Xin probability if for every  > 0, P(|Xn−X|> )→0 as n→ ∞. If Xn/Yn→Xin probability then we also write Xn= (X+op(1))Yn. 1 2 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS Theorem 1.1. For every r≥2, we have diam(D(n, r)) = (1 + ηr+op(1)) logrnand diam(D0(n, r)) = (1 + ηr+op(1)) logrn. As a consequence of our analysis we can obtain estimates for the smallest and largest probability in the stationary distribution of a random walk on D(n, r). Before stating our result we give a few classical definitions that can be found in [26,30]. Given S⊂V(D), say that D[S] is attractive if for all v∈V(D) there is a directed path from vto S. It is easily seen that a digraph can contain at most one attractive strongly connected component D[S]. Grusho [19] proved that D0is the unique attractive strongly connected component of D(n, r), with high probability2. Recently, Balle [5] showed that D0is ergodic whp. It is well-known that if Dhas an attractive and ergodic strongly connected component D0, then a simple random walk on Dhas a unique stationary distribution π=πDwith support in D0. We write πmax(D) = max{πD(v) : v∈V(D)}and πmin(D) = min{πD(v) : πD(v)>0, v ∈V(D)}, respectively. Unlike in the undirected case, the stationary distribution of a directed graph is not usually determined by the degree sequence and one can find pathological examples where πmin(D) is exponentially small in the number of vertices of D. Moreover, having a large πmin is crucial to ensure that the mixing time of a random walk in Dis small. In the second part of the paper we will prove the following estimates for πmax(D(n, r)) and πmin(D(n, r)). Theorem 1.2. For every r≥2, we have πmax(D(n, r)) = n−1+op(1) and πmin(D(n, r)) = n−(1+ηr)+op(1). One of our main motivations for the study of D(n, r) comes from the analysis of random Deterministic Finite Automata (DFA). DFA can be described using r-out regular directed graphs, where each of the rout-going arcs is labeled with distinct symbols from an alphabet of size r. A possible model of random DFA with nstates can be obtained by considering a random r-out directed graph D(n, r) and by assigning random labels on the out-going arcs. This particular model has been used in the literature on automata theory to study properties of “generic” DFA and average behavior of DFA algorithms (see Section 2.1 for a more detailed account of related work). In particular, the first analysis of the diameter of D(n, r) appeared in the classic book of Trakhtenbrot and Barzdin [37, Theorem 5.5]. The authors of [37] showed that for every r≥2 there exists a constant Cr≥1 such that with high probability diam(D)≤Crlogrn. This upper bound has been recently used, together with a lower bound on πmin(D(n, r)), to stablish the possibility of efficently learning random DFA [1]. Thus, our results also have direct consequences on the complexity of learning random DFA. Here we present some other graph-theoretic implications of Theorems 1.1 and 1.2: •The results obtained can be easily transferred to random simple r-out digraphs. Let Dsim(n, r) be chosen uniformly at random from the set of directed simple graphs (no loops or multiple edges) with vertex set [n] such that each vertex has out-degree r. The conditional distribution of D(n, r), given that it is simple, is precisely that of Dsim(n, r). Furthermore, it is not hard to show (see [27]) that P(D(n, r) is simple) = e−Θ(r2). In particular, this probability is bounded away from zero for fixed r, so any property that holds whp for D(n, r) also holds whp for Dsim(n, r). •It is not hard to deduce from our arguments that for all u, v ∈V(D(n, r)), conditional on the event that v∈D0(n, r), we have distD(n,r)(u, v) = (1 + op(1)) logrn. 2Here and for the remainder of the paper, with high probability, or whp, means with probability tending to 1 as n→ ∞. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 3 This shows that the typical distance in D(n, r) is (1 + op(1)) logrn. We leave the details to the interested reader. •The random r-out, s-in digraph D(n, r, s) is defined similarly to D(n, r), but each vertex chooses sin-neighbours as well as rout-neighbours, all independently and uniformly at random; see [17]. In particular, D(n, r)d =D(n, r, 0)3. It may be interesting to consider the diameter and the stationary distribution for D(n, r, s) when s6= 0. One case follows from Theorem 1.1: since the diameter of a digraph is the same as the diameter of the digraph obtained by flipping the direction of all the edges, diam(D(n, 0, r)) d = diam(D(n, r, 0)). In contrast, studying the stationary distribution of D(n, 0, r) seems less interesting: typically there will be many vertices with no out-edges where a simple random walk will eventually become stuck. Outline. The paper is organized as follows. We start in Section 2by discussing our motivation for addressing these problems and by putting our results in the context of other models for random (di)graphs. In Section 3we introduce the notation that will be used throughout the paper and state some basic concentration inequalities and facts about branching processes. In Section 4.1 we finish the proof of the upper bound on the diameter of D(n, r) (Theorem 1.1) assuming some technical estimates. The breadth-first search procedure that will be used to explore the graph is described in Section 5. In Section 6we study the behaviour of the in-neighbourhoods of D(n, r) by comparing them with Poisson Galton-Watson trees, while in Section 7we study its out-neighbourhoods. In Section 8, we prove the technical estimates, completing the proof of the upper bound given in Section 4.1. The proof of the lower bound on the diameter of D(n, r) (Theorem 1.1) occupies Section 9. We conclude the paper by proving Theorem 1.2 in Section 10. 2. Related Work In this section we survey related work, both arising from literature on random DFA and from work on other models of random graphs. 2.1. Random Deterministic Finite Automata. Adeterministic finite automaton (DFA) over an alphabet Σ = {σ1, . . . , σr}is given by a set V={v1, . . . , vn}and a function L: [n]×[r]→[n]. We think of the pair (V, L) as specifying a directed multigraph Dwith vertices Vand edges {(vi, L(i, j)) : i∈[n], j ∈[r]}; every vertex of Dhas out-degree r, and the redges leaving a vertex vare labeled with distinct symbols from Σ. In addition, a DFA is equipped with a distinguished vertex scalled the initial state, and with a binary labelling B:V(D)→ {0,1}; the vertices in B−1({1}) are the accepting states of the DFA. The DFA is formally given by the tuple Q= (V, Σ, L, s, B). Let Σ?denote the set of all finite strings with symbols in Σ. Words w=w1w2. . . wt∈Σ? correspond to walks x0(w), x1(w), . . . , xt(w) on V:x0=sand, for 1 ≤i≤t,xiis reached from xi−1by following the edge with label wi. We write Q(w) = xt(w) for the final state of the walk. The DFA accepts the word wif B(Q(w)) = 1. The set L(Q) = {w∈Σ?:B(Q(w)) = 1}is the language recognized by the DFA. The set of languages recognized by some DFA are precisely the regular languages. To see the connection with random out-regular graphs, observe that we may build a uniformly random DFA with nlabelled states and alphabet of size ras follows. Let D(n, r) be as in the first paragraph of the paper, using the random variables (Li,j : (i, j)∈[n]×[r]). Then for (i, j)∈[n]×[r], let L(i, j) = Li,j); equivalently, assign label σito edge (i, Li,j). Choose the starting state suniformly at random from [n], and choose Buniformly at random from the set of functions f: [n]→ {0,1}. 3For any two random variables Xand Y, we use the notation Xd =Yto denote that the corresponding probability distributions are equal. 4 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS DFA and regular languages play a crucial role in language theory and there is a vast literature on algorithms over DFA, ranging from minimization and property testing, to synthesis, learning and composition [34]. Next we describe the problem of learning random DFA from uniformly sampled examples, whose complexity is related to the diameter and stationary distribution of D(n, r) [1]. Learning regular languages from different sources of information is a prominent problem in computational learning theory [24], which is most often studied within the context of so-called grammatical inference problems [16]. An important problem in this area concerns the possibility of learning regular languages under the probably approximately correct (PAC) learning model introduced by Valiant [38]. Roughly speaking, this asks for an efficient algorithm such that, when supplied with a large enough sample containing iid strings drawn from some arbitrary probability distribution µon Σ?and labels indicating whether each string belongs to some hidden regular language, the algorithm outputs a representation of a regular language (e.g. a DFA) which is close to the hidden regular language in a sense that depends on the distribution which generated the sample strings. Several results from the 90’s indicate that, in its full generality, PAC learning of DFA is hard due to complexity-theoretic as well as cryptographic reasons [23,32] (see also the recent strengthened result [13]). A natural question to ask in such a scenario is whether there exists a reasonable simplification of the problem for which a positive answer is possible. This requires one to come up with scenarios that rule out the worst-case problems arising from specially crafted regular languages and distributions over examples appearing in the proofs of the aforementioned lower bounds. One possibility is to study the average case. This approach can be formalized by considering regular languages defined by random DFA. In particular, one can ask for an algorithm that with high probability (as the number of the states in the DFA goes to infinity) can learn the regular language recognized by a random DFA. There exists evidence suggesting that such relaxation might not be enough to achieve efficient learning in general: it was recently showed by Angluin et al. that generic instances of DFA (as well as decision trees and DNF formulas) are hard to learn from statistical queries when examples can be sampled from an arbitrary distribution [3]. Nevertheless, prior to Angluin et al.’s result it was showed that generic decision trees and generic DNF formulas can be efficiently learned when samples are drawn according to the uniform distribution [20,35]. In view of the panorama described in the previous paragraphs, a natural question to ask is whether random DFA can be efficiently learned when sample strings are drawn from the uniform distribution. More precisely, one would like to answer the following sorts of questions. Fix a uniformly random DFA Qwith states [n] and alphabet [r]. Then fix m∈Nand let (xi, i ≥1) be iid words sampled uniformly at random from [r]m. (1) Given the sequences (xi, i ≥1) and (B(Q(xi)), i ≥1), is it possible to construct a DFA ˆ Qthat recognizes the same language as Qwith high probability? (2) Given the sequences (xi, i ≥1), (Q(xi)), i ≥1) and (B(Q(xi)), i ≥1), is it possible to construct a DFA ˆ Qthat recognizes the same language as Qwith high probability? In both cases, if the answer is yes then it is natural to ask for efficient algorithms (average case running time polynomial in n,m,r, and any other parameters involved). The questions can be weakened by only requiring that ˆ Qrecognizes the same set of words of length m. A further weakening is to only require that P(ˆ Q(y) = Q(y)) >1−when yis uniformly distributed over [r]m. The results in [1] establish that in order to answer the second question, it would be sufficient to understand several specific properties of a random walk on a randomly generated DFA. When a string is sampled from the uniform distribution over [r]mand is labeled according to the state that it reaches, the label immediately corresponds to the final state of DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 5 a simple random walk of length mover the DFA starting from the initial state. Thus, the analysis of the algorithm in [1] relies on bounds on the diameter, stationary distribution, and mixing time on random r-out regular digraphs. Angluin and Chen base their analysis on previous results about the strongly connected component D0of D(n, r). The first of such results is due to Grusho, who showed that the strongly connected component D0is attractive and its order satisfies |V(D0)|= (1 + op(1))λr·n[19] (we remark that its order is also the asymptotic order of the giant component in the Erd˝os-R´enyi random graph G(n, r/n)). The average-case analysis of algorithms for the minimization of Deterministic Finite Automata (DFA) has led to multiple rediscoveries of Grusho’s result [7,11,12]. As mentioned above, the diameter of D(n, r) was first studied by Trakhtenbrot and Barzdin in [37], who showed that for every r≥2, we have diam(D(n, r)) = O(logrn), whp. Several other properties of random DFA have been studied, both in learning theory and in other contexts, using the D(n, r) model. For example, first Korshunov’s group, and later Nicaud’s group, have studied the probability that random DFA exhibit particular structures, mainly motivated by the analysis of sample and reject algorithms for enumeration of subclasses of automata (see [28] and references therein). Motivated by worst-case hardness results for learning a DFA, Angluin and co-authors have used properties of random DFA to study the problem of learning a generic DFA [2,3]. The average-case complexity of DFA minimization algorithms has also received some attention recently [6,15]. Finally, a series of results have led to a solution of the long-standing ˇ Cern´y conjecture about synchronization of finite automata in the case of random DFA [8,29,36]. 2.2. Diameter and stationary distribution of other random graph models. In this subsection we describe some previous results on the diameter and the stationary distribution of certain random graph models and relate them to Theorem 1.1 and to Theorem 1.2. This provides an intuition for the results we have obtained on the diameter of D(n, r). We consider the following models of random (di)graphs. •For p∈[0,1), G(n, p) is the random graph with vertex set [n] in which every edge is included independently with probability p. •For d∈N,G(n, d) is the random d-regular simple graph with vertex set [n] chosen uniformly at random among all such graphs. •For p∈[0,1), D(n, p) is the random digraph with vertex set [n] in which every oriented edge is included independently with probability p. For an undirected graph G= (V, E) and u, v ∈Vwe write distG(u, v) for the minimum number of edges in a path from uto v, or set distG(u, v) = ∞if there exists no such path. The diameter of Gis then defined just as in (1.1). Bollob´as and Fernandez de la Vega [10] studied the diameter of G(n, d) and showed that for every integer r≥2, we have diam(G(n, r + 1)) = (1 + op(1)) logrn . (2.1) The diameter of G(n, p) was recently studied by Riordan and Wormald [33], who showed that for every constant r > 0, we have diam(G(n, r/n)) = (1 + 2ηr+op(1)) logrn . (2.2) In fact, they proved a stronger result, showing convergence in distribution of the diameter after appropriate recentering and rescaling. Although, in this paper we only determine the first order asymptotic behaviour of diam(D(n, r)), it is possible that similar techniques as the ones presented in [33] could be of use to determine its second order term. The extra term 2ηris essentially due to the existence of “remote” vertices in the giant component of G(n, r/n), whose neighbourhoods are exceptionally small up to distance about ηrlogrn. Our result on the diameter of D(n, r) from Theorem 1.1 can be related to (2.1) and (2.2) in the following way. Given u, v ∈[n], one way to determine distD(n,r)(u, v) is to perform an 6 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS outward breadth-first search (BFS) starting at u, to perform an inward BFS (i.e. following edges from head to tail) starting at v, and to stop at the first time the two searches uncover a common vertex. (See Section 5.1 for a careful definition of breadth-first search.) This technique was used by Bollob´as and Fernandez de la Vega in [10]. Since the BFS explores vertices in order of distance, such a procedure is guaranteed to build a shortest path from uto v. On the one hand, in the outward BFS of D(n, r) starting from u, every vertex has exactly rout-edges when explored. Similarly, in a BFS exploration of G(n, r + 1), when a vertex vis discovered via an edge from one of its neighbours, this leaves redges to unveil when vis itself explored (unless vis discovered multiple times, which at least at the start of the BFS is unlikely). Thus, a BFS of G(n, r + 1) looks similar to an outward BFS of D(n, r). On the other hand, in the inward BFS of D(n, r) starting from v(or at least near the start of the process) the number of in-edges arriving at a vertex are roughly distributed as a Binomial random variable with ntrials and success probability r/n. Thus, a BFS of G(n, r/n) looks similar to an inward BFS of D(n, r). The preceding paragraphs suggest that shortest paths in D(n, r) are in some sense hybrids of shortest paths in G(n, r+1) and in G(n, r/n). This, together with (2.1) and (2.2), provides some intuition for the value of the diameter of D(n, r) from Theorem 1.1: it is the average of the limit values in those formulae. An undirected model which is closely related to D(n, r) is the random r-out graph, obtained by selecting a directed graph according to D(n, r) and then forgetting about the directions of the edges. This model was introduced by Fenner and Frieze [17] and its diameter is whp (1 + op(1)) log2rn(see [18, Exercise 16.5.3]). There is interesting related work on distances in graphs with random edge weights. We mention in particular the paper of Janson [21] on typical and extreme distances in randomly edge-weighted complete graphs, and the subsequent work by Bhamidi and van der Hofstad [9], which establishes distributional convergence for the diameter. To conclude this section, we discuss the stationary distribution of a simple random walk in these other models. While in undirected graphs the stationary distribution (if it exists) is completely determined by the degrees of the vertices, this is not the case in directed graphs. Cooper and Frieze [14] give a very precise description of the stationary distribution of D(n, c/n) when c=c(n)>(1 + ) log n, for any constant  > 0, and use their result to compute the cover time of D(n, c/n). It is worth noticing that for such values of c, both the in-degrees and out-degrees are of logarithmic order and concentrated around their expected values, which turns to be very useful for the analysis. It seems harder to find an interesting question about the stationary distribution of D(n, c/n) when c=c(n)<(1 −) log nsince like in random r-in regular digraphs, typically there are vertices with no out-edges. 3. Notation and preliminaries We write [n] = {1,2, . . . , n},N={1,2, . . .}, and N0={0,1,2, . . .}. The notation A⊂B allows that A=B; we write A(Bfor strict containment. Unless we explicitly indicate otherwise, asymptotic notations will always refer to the case n→ ∞. We omit floors and ceilings when doing so improves readability. All logarithms are natural unless a subscript specifies otherwise. For any two random variables Xand Y, we use the notation Xd =Yto denote that the corresponding probability distributions are equal. For random variables X, Y , we write XY, and say Xis stochastically dominated by Y, if P(X≤t)≥P(Y≤t) for all t∈R. We say X1, . . . , Xkare independently stochastically dominated by Y1, . . . , Ytif P(Xi≤ti,1≤i≤k)≥Qk i=1 P(Yi≤ti), for all (t1, . . . , tk)∈Rk. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 7 3.1. Digraphs. Let D= (V(D), E(D)) be a directed graph. For S, S0⊆V(D) let E(S, S0) = ED(S, S0) = (u, v)∈Eu∈S, v ∈S0. Given S⊂[n], D[S] = (S, E(S, S)) is the subgraph of Dinduced by S. Given u∈[n] and an integer k≥0, write N+ k(D, u) = {v∈[n] : dist(u, v) = k} and N+ ≤k(D, u) = ∪j≤kN+ j(u). Similarly, let N− k(D, u) = {v∈[n] : dist(v, u) = k}and N− ≤k(D, u) = ∪j≤kN− j(u). We write N+(D, u) = N+ 1(D, u) and N−(D, u) = N− 1(D, u). We also let d+ k(D, u) = |N+ k(D, u)|, and define d+ ≤k(D, u), d− k(D, u), and d− ≤k(D, u) correspondingly. We write N+ k(u) = N+ k(D, u), etcetera, when Dis clear from context. 3.2. Concentration Inequalities. We write Bin(N, p) to denote a Binomial random variable with Ntrials and success probability p. We write Po(r) to denote a Poisson random variables with parameter r. We also write Ber(p) to denote a Bernoulli random variable with success probability p. We will use the following version of Chernoff’s bound for large deviations that can be found in [22]. Lemma 3.1 (Chernoff’s inequality).For any t≥0we have P(Bin(N, p)≥Np +t)≤e−t2 2(Np+t/3) ,(3.1) and P(Bin(N, p)≤Np −t)≤e−t2 2Np .(3.2) We will also use Chebyshev’s inequality: for any random variable Xand any t≥0, P(|X−E(X)| ≥ t)≤σ2 t2, where σ2=E(X2)−E(X)2. 3.3. Trees and branching processes. In any rooted tree, we view edges as oriented from child to parent. Fix a rooted tree Twith root v=v(T). Then for all u∈V(T), N−(T, u) is the set of children of u. For u6=v, let p(u) = pT(u) be the parent of uin T, so N+(T, u) = {p(u)}. For k≥0, let T≤kbe the subtree of Tinduced by N− ≤k(T, v) = {u∈V(T) : distT(u, v)≤k}; we view T≤kas rooted at v. Also, write Tk=N− k(T, v) = {u∈V(T) : distT(u, v) = k}. Aplane tree is a rooted tree in which the children of each node have a left-to-right order. Given a plane tree T, there is a canonical labelling of V(T) by distinct elements of {∅} ∪ Si≥1Ni, as follows. The root vhas label ∅; its children are labelled from left to right as 1,...,|N−(T, v)|. Given u∈V(Tk) with label w1w2. . . wk, the children of uare labelled from left to right as (w1. . . wki, 1≤i≤ |N−(T, u)|). Conversely, given a rooted tree Twith tvertices and an ordering of V(T) as v1, . . . , vt, say w∈V(T) has index jif w=vj, for 1 ≤j≤t. We view V(T) as a plane tree using the convention that the children of each vertex are listed from left to right in increasing order of index. If V(T)⊂Nthen we always use the ordering inherited from N. Thus, for arooted tree Twith V(T)⊂N, and a plane tree T0, we say Tand T0are isomorphic, and write T∼ =T0, if Tand T0are identical when viewed as plane trees. Finally, fix a non-negative, integer-valued random variable ξ. A Galton-Watson tree with branching mechanism ξis the random, potentially infinite family tree Tξof a branching process started from a single individual, in which each individual reproduces independently according to ξ(i.e. the number of offspring of each individual has the distribution of ξ). The random tree Tξis naturally viewed as a plane tree; see [25] for details and a careful construction. If ξis Po(r) distributed we call Tξa Poisson(r) Galton-Watson tree. 8 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS 4. Proof of Theorem 1.1 In this section we describe our proof technique for Theorem 1.1, and prove it assuming some technical estimates. We prove such estimates in Sections 8and 9. 4.1. Upper bound. This subsection sketches the proof of our upper bound on the diameter of D(n, r). For the remainder of this subsection, let D=D(n, r) and write d− k(v) = d− k(D, v), N− k(v) = N− k(D, v) etcetera. In order to derive an upper bound on the diameter of Dwe first show in Lemma 4.1 that for any fixed vertex v, the in-neighbourhood N− k(v) is either empty or large, for some kslightly larger than ηrlogrn, whp. Then, in Proposition 4.2, we show that conditional on N− k(v) being large (and a set of other technical conditions), the distance between any vertex uand N− ≤k(v) is at most logrn, whp. Putting both things together, we are able to prove the upper bound for diam(D). Lemma 4.1. Fix v∈[n], let k0(v) = min{k:d− k(v)6∈ (0,log4n)}. Then for every ∈(0,1/10), there exists δ > 0such that Pk0(v)>(ηr+) logrnor d− ≤k0(v)(v)≥log7n=O(n−(1+δ)). Next, if v∈[n] has N+(v) = {v}(i.e., if all edges leaving vare self-loops) then call valoop vertex. Let ESL be the event that Dcontains some loop vertex. Each vertex is independently a loop vertex with probability n−r, so P(ESL) = 1 −(1 −n−r)n= Θ(n1−r).(4.1) Note that if r≥3, the probability of a given vertex being a loop vertex is O(n−3). This bound is small enough that it would allow union bounds over pairs of vertices, which would simplify some proofs. Since we aim to prove our result also in the case r= 2, we need to be a bit more careful in our computations. Proposition 4.2. Fix k, n ∈Nand u, v ∈[n]. Let Ek={d− k(v)≥log4n, d− ≤k(v)≤ log7n}, and fix a graph Hwith v∈V(H)⊂[n]such that P(D[N− ≤k(v)] = H, Ek, ESL)>0. Then P(dist(u, N− ≤k(v)) >logrn−logrlogrn, ESL |D[N− ≤k(v)] = H) = O(n−3), the preceding bound holding uniformly over kand over all Hsatisfying the above conditions. We prove Lemma 4.1 and Proposition 4.2 in Section 8. In the remainder of the section, we finish the proof of the upper bound from Theorem 1.1, assuming Lemma 4.1 and Proposition 4.2. Proof of the upper bound in Theorem 1.1.Fix  > 0. We show that P(diam(D)≤(1+ηr+ ) logrn) = 1 −o(1). Since diam(D0(n, r)) ≤diam(D(n, r)), the same bound immediately holds for D0(n, r). Let k∗= (ηr+) logrnand let `∗= logrn−logrlogrn−1. By (4.1) for every r≥2, we have that P(ESL) = O(n−1). So P(∃u, v ∈[n],dist(u, v)∈(k∗+`∗,∞)) ≤O(n−1) + X v∈[n] P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), ESL). DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 9 Define k0=k0(v) as in Lemma 4.1, and let E={k0≤k∗, d− ≤k0(v)<log7n}. Then by Lemma 4.1, P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), ESL) ≤P(E, ESL) + P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), E, ESL) =O(n−(1+δ)) + P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), E, ESL), Now let Hbe the set of graphs Hwith v∈V(H) such that P(D[N− ≤k0(v)] = H, E, ESL)>0. Then P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), E, ESL) ≤sup H∈H P(∃u∈[n],dist(u, v)∈(k∗+`∗,∞), ESL |D[N− ≤k0(v)] = H) ≤sup H∈H X u∈[n] P(dist(u, v)∈(k∗+`∗,∞), ESL |D[N− ≤k0(v)] = H). For each H∈ H there is a (non-random) constant k=k(H) such that if D[N− ≤k0(v)] = Hthen k0=k(H), so the events D[N− ≤k0(v)] = Hand D[N− ≤k(v)] = Hare identical. Furthermore, given that D[N− ≤k(v)] = Hwe either have d− k(v) = 0 or d− k(v)≥log4n. In the latter, if D[N− ≤k(v)] = Hthen Ekoccurs, so P(D[N− ≤k(v)] = H, Ek, ESL)>0, so we can apply Proposition 4.2 (with k=k(H) = k0). In both cases we obtain P(dist(u, v)∈(k∗+`∗,∞), ESL |D[N− ≤k0(v)] = H) =P(dist(u, v)∈(k∗+`∗,∞), ESL |D[N− ≤k(v)] = H) =O(n−3), and conclude that P(∃u, v ∈[n],dist(u, v)∈(k∗+`∗,∞)) =O(n−1) + X v∈[n] O(n−(1+δ)) + X u,v∈[n] O(n−3) = O(n−δ). It follows that with high probability diam(D)≤k∗+`∗≤(1 + ηr+) logrn. 4.2. Lower bound. This subsection sketches the proof of our lower bound on the diameter of D(n, r). Together with the proof in Subsection 4.1, this concludes the proof of Theorem 1.1. In order to derive a lower bound on the diameter of Dwe first introduce the concept of flags; that is, vertices vwhich have atypically small but non-empty in-neighbourhoods N− k(v) that induce a tree in D, for values of kslightly smaller than ηrlogrn(see Definition 4.3). In Lemma 4.4 we show that the probability that a given vertex is a flag is relatively large, and in Corollary 4.5 we show that whp there exists many flags. Moreover, there are no flags outside of D0(Lemma 4.6). Using the existence of flags in D0, we conclude the lower bound for diam(D). Let us now precisely define the notion of flag. Definition 4.3. For v∈[n], let k1=k1(v) = min{k:d− k(v)≥log4n}; this is ∞if d− k(v)<log4nfor all k. A vertex vis an -flag (or simply a flag, if is clear from context) if k1∈[(ηr−/2) logrn, ∞), |N− ≤k1(v)| ≤ log7n, and D[N− ≤k1(v)] is a tree. We write F=F()⊆[n] for the set of -flags. The condition that D[N− ≤k1(v)] is a tree means that along any shortest path from N− k1(v) to v, at each node wthere are (r−1) possible “wrong turns” that lead to [n]\N− k1(v). We will use this when bounding πmin in Section 10. 16 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS the last inequality for nlarge since p≤n0.999. Now write q0=ω2/k and p0= (r+ α)`+1 logrn<n0.999. By Corollary 5.3 and the Chernoff bound (3.2), we have P(d− `+1(v)≤d− `(v)|d− `(v)≥ω2/k, E`) ≤sup q0≤q≤p≤p0 P(d− `+1(v)≤d− `(v)|d− `(v) = q, d− ≤`(v) = p) ≤sup q0≤q≤p≤p0 P(d− `+1(v)≤q|d− `(v) = q, d− ≤`(v) = p) ≤sup q0≤q≤p≤p0 P(X≤q) ≤sup q0≤q≤p≤p0 P(X≤E(X)−(2r/3−1)q) ≤sup q0≤q≤p≤p0 e−(2r/3−1)2q2 2(rq+(2r/3−1)q/3) ≤e−q0 18r+2 , in the last line using that r≥2. Finally, q0=ω2/k ≥log2 rn, so e−q0/(18r+2) =O(n−4). Combining the preceding inequality with (6.3), (6.4) and (6.5) yields P(d− ≤k(v)≥ω2, d− k(v)≤ω)≤ k−1 X j=1 k−1 X `=j P(d− `+1(v)≤d− `(v)|d− `(v)≥ω2/k, E) + O(kn−4) ≤O(k2n−4) = O(n−3). The next lemma compares the law of T−(v) to that of a Poisson(r) Galton-Watson tree. A similar result, in the setting of undirected graphs, can be found in [33, Lemma 2.2]. Lemma 6.3. Let r≥2and let T0be a v-rooted plane directed tree where all edges point to the root. Suppose that |V(T0)| ≤ n/2. Then, for any k≥0we have P(T− ≤k(D, v)∼ =T0) = eO(|V(T0)|2/n)P(T≤k∼ =T0). where Tis a Galton-Watson branching tree whose offspring is Poisson with parameter r. Proof. Fix k∈N0and a plane tree T0of height at most k, and write t=|V(T0)|. Recall the canonical labelling of V(T0) with labels from ∅ ∪ Si≥1Niintroduced in Section 3.3. Consider the iBFS procedure on T0started at its root v. To make sense of this, we must specify the order in which the children of a vertex uare added to the set of discovered vertices. We use the left-to-right order: so if uis explored at step i(i.e. u− i(T0, v) = u) then the rightmost child of uis the last element of S− i(T0, v). Let ai=|C− i(T0, v)|be the number of children of u− i(T0, v), and let s=|V(T0 ≤k−1)|be the number of vertices of T0at distance at most k−1 from the root. In order to check if T≤k(D, v) and T0are isomorphic, it suffices to perform ssteps of the iBFS exploration from vin D. We then have P(T− ≤k(D, v)∼ =T0) = P|C− i(D, v)|=ai,0≤i<s = s−1 Y i=0 P|C− i(D, v)|=ai| |C− j(D, v)|=aj,0≤j < i = s−1 Y i=0 P |C− i(D, v)|=ai| |S− i(D, v)|= 1 + i−1 X j=0 (aj−1) , where the last line is due to the symmetry of the model. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 17 Writing qi= 1 + Pi−1 j=0(aj−1), by Corollary 5.4 we then have P(|C− i(D, v)|=ai| |S− i(D, v)|=qi) =n−i−qi ai1−1−1 n−irai1−1 n−ir(n−qi−ai−i) =eOai(ai+r) n−i−qi(n−i−qi)ai ai!r n−iai1−1 n−ir(n−qi−ai−i) . Now let Tbe a Poisson(r) Galton-Watson tree; write ρfor the root of T. Build Tvia iBFS starting from ρ. In this manner, we may couple Twith a sequence (ξi, i ≥0) of iid Po(r) random variables so that for 0 ≤i < |V(T)|we have |C− i(T, ρ)|=ξi. It follows that P(T≤k∼ =T0) = P∩s−1 i=0 ξi=ai= s−1 Y i=0 P(ξi=ai) = s−1 Y i=0 e−rrai ai!. Using that 1 + x≤ex, this gives P(|C− i(D, v)|=ai| |S− i(D, v)|=qi) P(ξi=ai)=eOai(ai+r) n−i−qi(n−i−qi)ai (n−i)ai·1−1 n−ir(n−qi−ai−i) e−r =eOqi+a2 i n−i−qi. Since i+qi≤t≤n/2, Ps−1 i=0 a2 i≤t2, and s≤t, we have s−1 X i=0 qi+a2 i n−i−qi ≤ s−1 X i=0 t+a2 i n/2=Ot2 n. It follows that P(T− ≤k(D, v)∼ =T0) P(T≤k∼ =T0)= s−1 Y i=0 P(|C− i(D, v)|=ai| |S− i(D, v)|=qi) P(ξi=ai)=eO(t2/n). Lemma 6.4 ([33], Lemma 2.1).Let Tbe a Poisson(r)Galton-Watson tree. There exist constants c, C > 0such that for every ω≥2and k≥1we have c·min{(r(1 −λr))k−k0,1} ≤ P(0 <|Tk|< ω)≤C(r(1 −λr))k−k0, where k0=blogrωc. Recall that the probability of survival in Tis PPk≥0|Tk|=∞∈(0,1). Essentially, the preceding lemma states that given the branching process survives for the first kgenerations, the probability that |Tk|< ω decays exponentially in k(provided that ωis small enough with respect to k). The final and principal result of this section is to prove a corresponding bound with d− k(v) in place of |Tk|. Proposition 6.5. For every v∈[n],k≤0.99 logrnand log3 rn≤ω≤n1/6 P(0 < d− k(v)< ω) = (1 + o(1))P(0 <|Tk|< ω) + O(n−3) = Θ((r(1 −λr))k−k0) + O(n−3). where k0=blogrωc. 18 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS Proof. Write Zk=|Tk|. We first prove an upper bound on P(0 < d− k(v)< ω). By Lemma 6.3, P(0 < d− k(v)< ω) = X {T0:|T0 k|∈(0,ω)} PT≤k(D, v)∼ =T0 ≤X {T0:|T0 k|∈(0,ω) |T0|≤n1/3} eO|V(T0)|2 nP(T≤k∼ =T0) + P(d− ≤k(v)≥ω2, d− k(v)∈(0, ω)) ≤(1 + o(1))P(0 < Zk< ω) + O(n−3), where in the last inequality we used Lemma 6.2. We now turn to the lower bound. A similar argument to that above gives P(0 < d− k(v)< ω)≥(1 + o(1))P(0 < Zk< ω)−P( k X j=0 Zj≥ω2, Zk< ω). Bounding the second probability is straightforward. First, fix j < k and a, b ∈N. Given that Zj=a, by the branching property, each of the asubtrees of Trooted at a node in Tjsurvives independently with probability p:= P(|T | =∞). Note that p > 0 is independent of n. But Zkis at least the number of such subtrees which survive, so P(Zk< b |Zj=a)≤P(Bin(a, p)< b). Finally, if Pk j=0 Zj≥ω2then max0≤j≤kZj≥ω2/(k+ 1). In other words, letting j0= inf{j:Zj≥ω2/(k+ 1)}, we must have j0≤k. It follows from the preceding paragraph (conditioning on the value of j0≤k) that P( k X j=0 Zj≥ω2, Zk< ω)≤P(Bin(ω2/(k+ 1), p)< ω) = O(n−3), the final inequality by a Chernoff bound since ω2/(k+ 1) ≥ωlog2n. The proposition follows from Lemma 6.4. 7. Out-neighbourhoods: technical lemmas Recall that ESL is the event that Dcontains no loop vertices. As in the statement of Proposition 4.2 we now fix k∈[n], let Ek={d− k(v)≥log4n, d− ≤k(v)≤log7n}, and fix a graph Hwith v∈V(H)⊂[n] such that P(D[N− ≤k(v)] = H, Ek, ESL)>0. It is useful to write BH=N− k(H, v); note that this is a deterministic set since His deterministic, and on D[N− ≤k] = Hwe have N− k(v) = BH. Let ˆn=n− |V(H)|+|BH|. By the assumptions on Hwe have ˆn≥n−log7n+ log4n. For any event A, write PH(A) = P(A|D[N− ≤k] = H). The following fact describes the distribution of Dunder PH. Its proof follows from straightforward considerations and is omitted. Fact 7.1. Given that D[N− ≤k] = H, the conditional distribution of D(n, r)is that of the graph ˆ Ddefined as follows. First, ˆ D[V(H)] = H. Next, independently for each w /∈V(H), let ˆ Lw= (ˆ Lw,1,...,ˆ Lw,r)be a vector chosen uniformly at random from the ˆnrvectors (s1, . . . , sr)∈(([n]\V(H)) ∪BH)r. Then for each i∈[r]add a directed edge from wto ˆ Lw,i. Finally, for w∈V(H), let tw=r− |EH(w, H)|; this is the number of edges with tail wand head not in H. Independently for each w∈V(H), let ˆ Lw= (ˆ Lw,1,...,ˆ Lw,tw)be a vector chosen uniformly at random from ([n]\V(H))tw, and for each i∈[tw]add a directed edge from wto ˆ Lw,i. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 19 For the remainder of the section, fix u∈[n] and write N∗ j=N+ j(u)\V(H), d∗ j=|N∗ j|. We continue with a simple lemma. Lemma 7.2. We have PH(d∗ 5<5, N+ ≤5(u)∩V(H) = ∅, ESL) = O(n−3) Proof. If N+ ≤5(u)∩V(H) = ∅then d∗ 5=d+ 5. In this case, since r≥2, it is a simple combinatorial exercise to check that if also d∗ 5<5 then D[N∗ ≤5] has at least two more edges than vertices. For any fixed digraph b Dwith at least two more edges than vertices and with no self loops, it is easily seen that PH(D[N+ ≤5]∼ =ˆ D, N+ ≤5(u)∩V(H) = ∅) = O(n−3). (This is not true for digraphs with self-loops if r= 2; the probability vitself is a loop vertex is O(n−2) and in this case d∗ 5= 0.) The number of isomorphism classes of digraphs with diameter at most 5 and maximum out-degree ris bounded, and the result follows.  We next show that with high probability, each generation N∗ jis approximately rtimes larger than the last, until jis nearly (logrn)/2. Lemma 7.3. Let σ= inf{i≥5 : d∗ i< ri−5+5}. Then PH(5 < σ ≤(logrn)/8) = O(n−3). Proof. Fix j > 5. If d∗ 5≥5 and d∗ i+1 ≥rd∗ i−4 for every 5 ≤i<j, then by induction d∗ j≥rj−5+ 5. We thus have PH(5 < σ ≤j)≤PH d∗ 5≥5, j [ i=5 {|d∗ i|< ri−5+ 5}!≤ j−1 X i=5 P(d∗ i+1 ≤rd∗ i−4). Now fix 5 ≤i < j. Condition on N∗ ≤i, and recall that the random variables {Lw,m :w∈ N∗ i, m ∈[r]}are the heads of edges from vertices in N∗ i. Reveal the values of these random variables one-at-a-time; say a conflict occurs if Lw,m ∈N∗ ≤i∪V(H) or Lw,m =Lw0,m0for a previously revealed Lw0,m0. If d∗ i+1 ≤rd∗ i−4 then at least 4 conflicts occur. Under PH, the random variables Lw,m are independent and uniform over ([n]\V(H)) ∪ BH. When Lw,m is revealed there are less than ri+2 +|BH|locations that can cause a conflict, since |N∗ ≤i+1|< ri+2, so the probability of a conflict is less than (ri+2 +|BH|)/ˆn. The set {Lw,m :w∈N∗ i, m ∈[r]}has size at most ri+1, and |BH| ≤ log7n; it follows that PH(d∗ i+1 ≤rd∗ i−4) ≤PBin(ri+1,(ri+2 +|BH|)/ˆn)≥4 ≤ri+1 4·ri+2 + log7n ˆn4 ≤C(r8i+ log28 n) n4, where in the last inequality we used that ˆn≥n−log7n. For j≤(logrn)/8 we thus have PH d∗ 5≥5, j [ i=5 {|d∗ i|< ri−5+ 5}!≤ j−1 X i=5 C(r8i+ log28 n) n4=O(n−3). The third lemma of the section shows that out-neighbourhoods continue to grow rapidly until they reach size close to n/ log n. Lemma 7.4. There is C0>0such that for all iwith ri≤n/ logrn−2 log7n, PHd∗ i≥log3 rn, d∗ i+1 ≤rd∗ i·1−2r2 logrn≤e−C0log2n. Proof. We have PHd∗ i≥log3 rn, d∗ i+1 ≤rd∗ i·1−2r2 logrn ≤sup a∈[log3 rn,ri+1] PHd∗ i+1 ≤rd∗ i·1−2r2 logrn|d∗ i=a. 20 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS Condition on N∗ ≤i, and reveal the random variables {Lw,m :w∈N∗ i, m ∈[r]}one-at- a-time as in the previous proof. When Lw,m is revealed there are less than ri+2 +|BH| locations that can cause a conflict, so under PHthe probability of a conflict is at most (ri+2 +|BH|)/ˆn. If d∗ i+1 ≤rd∗ i−tthen at least tconflicts occur, so we obtain PHd∗ i+1 ≤rd∗ i·1−2r2 logrn|d∗ i=a≤PBinar, ri+2 +|BH| ˆn≥2r3a logrn. Using that ri≤n/ logrn−2 log7nand that |BH| ≤ log7nand ˆn≥n−log7n, it is straightforward to verify that ar(ri+2 +|BH|)/ˆn≤r3a/ logrn. A Chernoff bound then gives PHd∗ i+1 ≤rd∗ i·1−2r2 logrn|d∗ i=a≤e−3r3a/(8 logrn)≤e−C0log2n, for some constant C0=C0(r). The latter inequality follows since a≥log3 rn. The following is an easy consequence of the preceding lemma, and concludes the section. Corollary 7.5. Let j∗= 3 logrlogrn+ 5 and let `∗= logrn−logrlogrn−1. Then there are c, C > 0such that PHd∗ j∗≥log3 rn, d∗ `∗≤cn logrn≤e−Clog2n. Proof. If d∗ i≥log3 rnand d∗ i+1 ≥rd∗ i·1−2r2 logrnthen d∗ i+1 ≥log3 rn. Since `∗−j∗= logrn−4 logrlogrn−6 we also have 1−2r2 logrn`∗−j∗ r`∗−j∗log3n≥1−2r2 logrnlogrn−1n r6log4 rn·log3 rn≥e−2r2 r6·n logrn, where we used that (1 −b/x)x−1≥e−bx. With c=e−2r2 2r6, it follows from the preceding inequalities that if d∗ j∗≥log3 rnbut d∗ `∗< cn/ logrnthen there is i∈[j∗, `∗−1] such that d∗ i≥log3 rnand d∗ i+1 < rd∗ i·1−2r2 logrn. By Lemma 7.4, there exists some C0such that PHd∗ j∗≥log3 rn, d∗ `∗<cn logrn≤ `∗−1 X i=j∗ PHd∗ i≥log3 rn, d∗ i+1 ≤rd∗ i·1−2r2 logrn ≤(`∗−j∗)·e−C0log2n ≤e−Clog2n, for some constant C < C0. 8. Upper bound on the Diameter In this section we prove Lemma 4.1 and Proposition 4.2 from Subsection 4.1. Throughout the section, we fix u, v ∈[n]. Recall that k∗= (ηr+) logrnand that `∗= logrn−logrlogrn. Proof of Lemma 4.1.It suffices to prove the lemma assuming  < 1/10. Let k∗= (ηr+ ) logrn, and let δ= 2ηr. An easy computation shows that ηr≤4/5 for every r≥2, so k∗≤0.9 logrn. Recall the definition k0=k0(v) = min{k:d− k(v)6∈ (0,log4n)}. If k0> k∗ DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 21 then 0 < d− k∗(v)<log4n, so by Proposition 6.5 we have P(k0> k∗) = P(0 < d− k∗(v)<log4n) ≤O(r(1 −λr))k∗−4 logrlog n+O(n−3) ≤Or(logr(r(1−λr)))(ηr++o(1)) logrn+O(n−3) =Or−(1+2δ+o(1)) logrn+O(n−3) =On−(1+δ), where we used that 1 + logr(1 −λr) = −η−1 r. For all i < k0we have d− i(v)<log4n, so if k0≤k∗then d− ≤k0−1(v)< k∗log4n≤log6n. In this case, for nlarge, to have d− ≤k0(v)≥log7nwe must have d− k0≥(log7n)/2. It follows by Corollary 5.3 and a Chernoff bound P(k0≤k∗, d− ≤k0(v)≥(log7n)/2) ≤sup k≤k∗−1 sup q<log4n sup p<log6n P(d− k+1(v)≥(log7n)/2|d− k(v) = q, d− ≤k(v) = p) ≤P(Bin(rn/2,2 log4n/n)≥(log7n)/2) ≤e−(log7n)/8. Combining the two preceding bounds, the lemma follows.  The proof of Proposition 4.2 occupies the remainder of the section. Let τ= min{j≥ 1 : N+ j(u)∩N− ≤k(v)6=∅}, so in particular dist(u, v) = τ+k. Lemma 8.1. Fix  > 0and let τ0= min{j≥1 : |N+ j(u)\V(H)| ≥ n/ log n}. Then for nlarge, PH(τ > τ0+ 1) = e−r log3n Proof. First, P(D[N− ≤k(v)] = H, τ > τ0+ 1) =X F P(D[N− ≤k(v)] = H, D[N+ ≤τ0(u)\V(H)] = F, τ > τ0+ 1) =X F P(D[N− ≤k(v)] = H, D[N+ ≤τ0(u)\V(H)] = F) ·P(τ > τ0+ 1 |D[N− ≤k] = H, D[N+ ≤τ0(u)\V(H)] = F). where the sums are over graphs Fwith V(F)∩V(H) = ∅, such that u∈V(F) and such that, for some ` > 0, V(F) = S` j=0 N+ j(F, u) and `= min{i:|N+ i(F, u)| ≥ n/ log n}. We now bound the final probability. Under such conditioning, the out-edges from N+ τ0 are uniformly distributed over ([n]\V(H)) ∪BH. There are more than r(n/ log n) such out-edges; to have τ > τ0+ 1 the heads of such edges must all avoid BH; so P(τ > τ0+ 1 |D[N− ≤k(v)] = H, D[N+ ≤τ0(u)\V(H)] = F)≤1−|BH| ˆnr(n/ log n) ≤1−log4n nr(n/ log n) , 22 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS the last inequality since |BH| ≥ log4nand ˆn<n. Using that 1 −x≤e−xthis gives P(D[N− ≤k] = H, τ > τ0+ 1) ≤e−r log3nX F P(D[N− ≤k(v)] = H, D[N+ ≤τ0(u)\V(H)] = F) ≤e−r log3nP(D[N− ≤k(v)] = H). The result follows.  Proof of Proposition 4.2.Recall that we set `∗= logrn−logrlogrn−1, and the notation N∗ j=N+ j(u)\V(H), d∗ j=|N∗ j|from Section 7. Once nis large enough that `∗+ 1 >5 we have PH(dist(u, N− ≤k(v)) > `∗+1, ESL) = PH(dist(u, N− ≤k(v)) > `∗+1, N+ ≤5(u)∩V(H) = ∅, ESL), and we focus on the latter probability. It is convenient to use the shorthand E={N+ ≤5(u)∩ V(H) = ∅} ∩ ESL. Now take ∈(0, c), where cis the constant from Corollary 7.5. and let τ0be as in Lemma 8.1. Then by that lemma, PH(dist(u, N− ≤k(v)) > `∗+ 1, E)≤PH(τ0> `∗, E) + e−r log3n. We bound the second probability by PH(τ0> `∗, E)≤PH(τ0> `∗, d∗ j∗≥log3 rn) + PH(d∗ j∗<log3 rn, E). The first term on the right is at most e−Clog2nby Corollary 7.5. We further divide the second as PH(d∗ j∗<log3 rn, E)≤PH(d∗ j∗<log3 rn, d∗ 5≥5) + PH(d∗ 5<5, E). Recall that σ= inf{i≥5 : d∗ i< ri−5+ 5}. If d∗ j∗<log3 rnthen d∗ j∗< rj∗−5; if also d∗ 5≥5 then 5 < σ ≤j∗. Lemma 7.3 then implies that the first probability on the right is O(n−3). By the definition of Eand by Lemma 7.2, the second probability is also O(n−3). Combining all these bounds we obtain PH(dist(u, N− ≤k(v)) > `∗+ 1,ESL) = O(n−3), as required.  9. Lower Bound on the Diameter In this section we prove Lemma 4.4, Equation (4.2) and Lemma 4.6 from Subsection 4.2. Recall that k∗=k∗(n, ) = (ηr−/2) logrn. Proof of Lemma 4.4.We assume nlarge throughout. Given a tree T, let k1(T) = inf{k: |Tk| ≥ log4n}, let A(T) be the event that |Tk∗| ∈ [log3n, log3n], let B(T) be the event that maxi≤k∗|Ti| ≤ log6n, and C(T) be the event that k1≤k∗+ 5 logrlog nand |Tk1| ≤ log5n. (We may view a deterministic tree as a random tree in the same way as we may view a constant as a random variable, so it is reasonable to call A(T), B(T) and C(T) events even if Tis deterministic.) We first bound the probability that A, B and Coccur for a Poisson(r) Galton-Watson tree T. Let ω= log3nand k0= logrω. By the Kesten-Stigum theorem (see e.g. [4, pp. 24–29]) r−k|Tk|converges almost surely to an absolutely continuous random variable on (0,∞). As it also converges in probability, for every fixed 0 < c1< c2, inf kP(c1rk≤ |Tk| ≤ c2rk)>0, where the infimum is taken over all ksuch that [c1rk, c2rk]∩Nis non-empty. Taking c1= and c2= 1, there exists c0>0 such that P(|Tk0| ∈ [ω, ω]) > c0. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 23 By Lemma 6.4 with ω= 2 and k=k∗−k0, there is a > 0 such that P(|Tk∗−k0|= 1) ≥a(r(1 −λr))k∗−k0 ≥arlogr(r(1−λr))(ηr−/2−o(1)) logrn ≥ar−(1−/2ηr−o(1)) logrn ≥ar−(1−/2) logrn =an/2−1, where we used that logr(r(1 −λr)) = −η−1 rand that ηr<1. We conclude that P(A(T)) ≥P(|Tk∗−k0|= 1)P(|Tk0| ∈ [ω, ω]) > ac0n/2−1. Next, if B(T) occurs then let i≤k∗be minimal such that |Ti|>log6n. In order for A(T) to additionally occur the number of descendants of Tialive at time k∗must be less than log3n. Writing pfor the survival probability of a Poisson(r) branching process, it follows as in the proof of Proposition 6.5 that P(A(T), B(T)) ≤P(Bin(log6n, p)≤log3n)≤n−3, the last inequality by a Chernoff bound. To bound the probability of C(T), let N=N(T) be the number of vertices in Tk∗with at least one descendant in Tk∗+5 logrlog n; if Tk∗=∅then N= 0. If C(T) does not occur then one of the following must occur. (a) N < log2n. (b) N≥log2nbut k1> k∗+ 5 logrlog n. (c) |Tk1|>log5n. If A(T) occurs then |Tk∗| ≥ log3n, so by the branching property (i.e. the independence of subtrees rooted at elements of Tk∗), we have P(A(T), N < log2n)≤P(Bin(log3n, p)≤log2n)< n−3 for large n, by a Chernoff bound. Next, to have k1> k∗+ 5 logrlog n, every vertex in T∗ kmust have fewer than log4ndescendants in Tk∗+5 logrlog n, so by Lemma 6.4 and the branching property we have P(N≥log2n, k1> k∗+ 5 logrlog n)≤(P(|T5 logrlog n| ∈ (0,log4n)))log2n ≤C(r(1 −λr))5 logrlog n−logrlog4nlog2n ≤C(r(1 −λr))log log nlog2n ≤n−3 for large n, the last inequality because r(1−λr)<1. Finally, by the Markov property and the definition of k1, writing Po(t) for a Poisson(t) random variable, we have P(|Tk1|>log5n)≤sup m<log4n P(Po(rm)>log5n|Po(rm)≥log4n) ≤P(Po(rlog4n)>log5n−log4n). Standard estimates for the Poisson upper tail (see, e.g., [31], Lemma 1.2) then yield P(|Tk1|>log5n)≤n−3. Combining these bounds, we obtain that, for nlarge, P(A(T), B(T), C(T)) ≤P(C(T)|A(T), B(T)) ≤3n−3. Combining inequalities, and choosing β > 0 appropriately, yields P(A(T), B(T), C(T)) ≥an/2−1−4n−3≥3nβ−1. 24 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS Now, if A(T), B(T) and C(T) all occur then |T≤k1| ≤ k∗log6n < log7n, so we may use Lemma 6.3 to transfer our bound from the Poisson(r) Galton-Watson tree to the tree T− ≤k1(v). We obtain P(A(T− ≤k1(v)), B(T− ≤k1(v)), C(T− ≤k1(v))) = 1 + Olog14 n nP(A(T), B(T), C(T)) ≥2nβ−1. Given that A(T− ≤k1(v)), B(T− ≤k1(v)) and C(T− ≤k1(v) all occur, in order to have v∈F() it is sufficient that D[N− ≤k1(v)] is a tree, i.e. that D[N− ≤k1(v)] = T− ≤k1(v). Finally, when A(T− ≤k1(v)), B(T− ≤k1(v)) and C(T− ≤k1(v)) all occur we have |V(T− ≤k1(v))|< log7n. By Corollary 5.2, in this case for each element u∈V(T− ≤k1(v)), the probability that there is a non-tree edge uto V(T− ≤k1(v)) is at most (rlog7n)/n. It follows that P(A(T− ≤k1(v)), B(T− ≤k1(v)), C(T− ≤k1(v)), D[N− ≤k1(v)] 6=T− ≤k1(v)) ≤rlog14 n n< nβ−1. The result follows.  The next lemma is our key tool for controlling joint probabilities of in-neighbourhoods of distinct vertices. Results of this type are standard in sparse random undirected graphs. Lemma 9.1. Fix u, v ∈[n]and trees T, T0, with roots uand v, respectively, and with V(T)∪V(T0)⊂[n]and V(T)∩V(T0) = ∅. Then P(D[N− ≤h(u)] = T, D[N− ≤h0(v)] = T0) = 1 + O|V(T)|2 n− |V(T0)|+|V(T0)|2 n− |V(T)| ·P(D[N− ≤h(u)] = T)·P(D[N− ≤h0(v)] = T0). Proof. Recall that Tiis the i-th generation of tree T. Write hand h0for the respective heights of Tand T0, and tand t0for their respective sizes. In order that D[N− ≤h(u)] = T, it is necessary and sufficient that the following events occur. •For each x∈V(T)\ {u}, there is an edge from xto pT(x) in D; call this event A1(u, T). •There are no other edges within D[V(T)]; call this event A2(u, T). •There are no edges from [n]\D[V(T)] to V(T)\Th; call this event A3(u, T). Note that A3is independent of A1and A2, so we have P(D[N− ≤h(u)] = T) = P(A1(u, T), A2(u, T)) ·n−t+|Th| nr(n−t) .(9.1) We now consider two such events simultaneously. Observe that if T0has root vand height h0, and V(T0)∩V(T) = ∅, then A1(u, T)∩A2(u, T) is independent of A1(v, T0)∩A2(v, T0). We thus have P(D[N− ≤h(u)] = T, D[N− ≤h0(v)] = T0) =P(A1(u, T), A2(u, T)) ·P(A1(v, T0), A2(v, T0)) ·P(A3(u, T), A3(v, T0)|A1(u, T), A2(u, T), A1(v, T0), A2(v, T0)) .(9.2) Given that A1(u, T) and A2(u, T ) occur, there are precisely 1+(r−1)tedges leaving V(T), and the heads of these edges are uniformly distributed over [n]\V(T). The conditional probability no such edges have head in V(T0)\T0 h0is n−t−t0+|T0 h0| n−t1+(r−1)t . DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 25 Similar considerations for edges leaving V(T0) and edges with tail in [n]\(V(T)∪V(T0)) yield the identity P(A3(u, T), A3(v, T0)|A1(u, T), A2(u, T), A1(v, T0), A2(v, T0)) =1−t0− |T0 h0| n−t1+(r−1)t ·1−t− |Th| n−t01+(r−1)t0 ·1−t+t0− |Th|−|T0 h0| nr(n−t−t0) . Combined with (9.1) and (9.2), straightforward arguments give P(D[N− ≤h(u)] = T, D[N− ≤h0(v)] = T0) =1 + Ot2 n−t0+(t0)2 n−tP(D[N− ≤h(u)] = T)·P(D[N− ≤h0(v)] = T0). The following corollary provides a proof for Equation (4.2). Corollary 9.2. For distinct u, v ∈[n]we have P(u, v ∈F)≤(1 + o(1))(P(u∈F) + log15 n/n)P(v∈F). Proof. We first divide according to whether or not N− ≤k1(u)(u)∩N− ≤k1(v)(v) is empty: P(u, v ∈F) =P(u, v ∈F, N− ≤k1(u)(u)∩N− ≤k1(v)(v)6=∅) + P(u, v ∈F, N− ≤k1(u)(u)∩N− ≤k1(v)(v) = ∅). We start with the first term on the right. If v∈Fthen |N− ≤k1(v)(v))| ≤ log7n, so by symmetry P(v∈F, u ∈N− ≤k1(v)(v)) ≤log7n n·P(v∈F). Next, by conditioning on N− ≤k1(v)(v) we have P(u, v ∈F, u 6∈ N− ≤k1(v)(v), N− ≤k1(u)(u)∩N− ≤k1(v)(v)6=∅) ≤X {T∈T (v): u6∈V(T)} P(D[N− ≤k1(v)(v)] = T)·P(u∈F, N− ≤k1(u)(u)∩V(T)6=∅ | D[N− ≤k1(v)(v)] = T). In order to bound the final probability, first fix Tas in the supremum and suppose that D[N− ≤k1(v)(v)] = T. Consider the iBFS procedure starting from u. Recall that at step i, R− iis the set of explored vertices and S− iis the set of discovered vertices. Let i0= min{i: |R− i∪S− i|>log7n}. If u∈Fthen |N− ≤k1(u)(u)| ≤ log7n, so to have N− ≤k1(u)(u)∩V(T) = ∅ it suffices that (R− i0−1∪S− i0−1)∩V(T) = ∅. Since |V(T)| ≤ log7n, by Lemma 5.5 we thus have P(u∈F, N− ≤k1(u)(u)∩V(T)6=∅ | D[N− ≤k1(v)(v)] = T)≤r(log7n+ 1) log7n n−2 log7n. Together with the two preceding displayed equations, for nlarge this gives P(u, v ∈F, N− ≤k1(u)(u)∩N− ≤k1(v)(v)6=∅) ≤log7n n·P(v∈F) + X {T∈T (v):u6∈V(T)} P(D[N− ≤k1(v)(v)] = T)·r(log7n+ 1) log7n n−2 log7n ≤log15 n n·P(v∈F),(9.3) the last inequality since X {T∈T (v):u6∈V(T)} P(D[N− ≤k1(v)(v)] = T) = P(v∈F, u 6∈ N− ≤k1(v)(v)]) . 32 DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM R-OUT DIGRAPHS References [1] D. Angluin and D. Chen. Learning a random dfa from uniform strings and state information. In International Conference on Algorithmic Learning Theory (ALT), 2015. [2] D. Angluin, L. Becerra-Bonache, A. H. Dediu, and L. Reyzin. Learning finite automata using label queries. International Conference on Algorithmic Learning Theory (ALT), 2009. [3] D. Angluin, D. Eisenstat, L. A. Kontorovich, and L. Reyzin. Lower bounds on learning random structures with statistical queries. International Conference on Algorithmic Learning Theory (ALT), 2010. [4] K. B. Athreya and P. E. Ney. Branching Processes. Grundlehren Der Mathematischen Wissenschaften. Springer-Verlag, Berlin Heidelberg, 1972. [5] B. Balle. Ergodicity of random walks on random DFA. arXiv:1311.6830, 2013. [6] F. Bassino, J. David, and C. Nicaud. Average case analysis of Moore’s state minimization algorithm. Algorithmica, 2012. [7] D. Berend and A. Kontorovich. The state complexity of random dfas. Theoretical Computer Science, 652:102–108, 2016. [8] M. V. Berlinkov. On the probability of being synchronizable. In Conference on Algorithms and Discrete Applied Mathematics, pages 73–84. Springer, 2016. [9] S. Bhamidi and R. Van der Hofstad. Diameter of the stochastic mean-field model of distance. Combinatorics, Probability and Computing, 26(6):797–825, 2017. [10] B. Bollob´as and W. Fernandez de la Vega. The diameter of random regular graphs. Combinatorica, 2(2):125–134, 1982. [11] X. S. Cai and L. Devroye. The graph structure of a deterministic automaton chosen at random. Random Structures & Algorithms, 51(3):428–458, 2017. [12] A. Carayol and C. Nicaud. Distribution of the number of accessible states in a random deterministic automaton. Symposium on Theoretical Aspects of Computer Science (STACS), 2012. [13] P. Chalermsook, B. Laekhanukit, and D. Nanongkai. Pre-reduction graph products: Hardnesses of properly learning dfas and approximating edp on dags. In Foundations of Computer Science (FOCS), 2014. [14] C. Cooper and A. Frieze. Stationary distribution and cover time of random walks on random digraphs. Journal of Combinatorial Theory, Series B, 102(2):329–362, 2012. [15] S. De Felice and C. Nicaud. Brzozowski algorithm is generically super-polynomial for deterministic automata. International Conference on Developments in Language Theory (DLT), 2013. [16] C. De la Higuera. Grammatical inference: learning automata and grammars. Cambridge University Press, 2010. [17] T. I. Fenner and A. M. Frieze. On the connectivity of random m-orientable graphs and digraphs. Combinatorica, 2(4):347–359, 1982. [18] A. Frieze and M. Karo´nski. Introduction to random graphs. Cambridge University Press, 2015. [19] A. A. Grusho. Limit distributions of certain characteristics of random automaton graphs. Mathematical Notes of the Academy of Sciences of the USSR, 14(1):633–637, 1973. [20] J. C. Jackson and R. A. Servedio. Learning random log-depth decision trees under uniform distribution. SIAM Journal on Computing, 2005. [21] S. Janson. One, two and three times log n/n for paths in a complete graph with random weights. Combinatorics, Probability and Computing, 8(04):347–361, 1999. [22] S. Janson, T. Luczak, and A. Rucinski. Random graphs, volume 45. John Wiley & Sons, 2011. DIAMETER AND STATIONARY DISTRIBUTION OF RANDOM r-OUT DIGRAPHS 33 [23] M. J. Kearns and L. G. Valiant. Cryptographic limitations on learning boolean formulae and finite automata. Journal of the ACM, 1994. [24] M. J. Kearns and U. V. Vazirani. An introduction to computational learning theory. MIT press, 1994. [25] J.-F. Le Gall. Random real trees. Ann. Fac. Sci. Toulouse S´erie 6, XV:35–62, 2006. [26] D. A. Levin, Y. Peres, and E. L. Wilmer. Markov chains and mixing times. American Mathematical Soc., 2009. [27] B. D. McKay. Asymptotics for 0-1 matrices with prescribed line sums. Enumeration and Design,(Academic Press, 1984), pages 225–238, 1984. [28] C. Nicaud. Random deterministic automata. In Mathematical Foundations of Computer Science (MFCS), 2014. [29] C. Nicaud. Fast synchronization of random automata. In APPROX/RANDOM 2016, volume 60, pages 43–1, 2016. [30] J. R. Norris. Markov chains. Cambridge university press, 1998. [31] M. Penrose. Random geometric graphs, volume 5 of Oxford Studies in Probability. Oxford University Press, Oxford, 2003. [32] L. Pitt and M. K. Warmuth. The minimum consistent DFA problem cannot be approximated within any polynomial. Journal of the ACM, 1993. [33] O. Riordan and N. Wormald. The diameter of sparse random graphs. Combinatorics, Probability and Computing, 19(5-6):835–926, 2010. [34] J. Sakarovitch. Elements of automata theory. Cambridge University Press, 2009. [35] L. Sellie. Exact learning of random dnf over the uniform distribution. ACM Symposium on Theory of Computing (STOC), 2009. [36] E. Skvortsov and Y. Zaks. Synchronizing random automata. Discrete Mathematics & Theoretical Computer Science, 2010. [37] B. A. Trakhtenbrot and Y. M. Barzdin. Finite automata : behavior and synthesis. North-Holland, 1973. [38] L. G. Valiant. A theory of the learnable. Communications of the ACM, 1984.