Limiting behavior for the distance of a random walk

In this paper we study some aspects of the behavior of random walks on large but ﬁnite graphs before they have reached their equilibrium distribution. This investigation is motivated by a result we proved recently for the random transposition random walk: the distance from the starting point of the walk has a phase transition from a linear regime to a sublinear regime at time n/ 2. Here, we study the examples of random 3-regular graphs, random adjacent transpositions, and riﬄe shuﬄes. In the case of a random 3-regular graph, there is a phase transition where the speed changes from 1/3 to 0 at time 3 log 2 n . A similar result is proved for riﬄe shuﬄes, where the speed changes from 1 to 0 at time log 2 n . Both these changes occur when a distance equal to the average diameter of the graph is reached. However in the case of random adjacent transpositions, the behavior is more complex. We ﬁnd that there is no phase transition, even though the distance has diﬀerent scalings in three diﬀerent regimes.


Introduction
Random walks on large finite graphs have been the subject of intense research over the last 25 years. First used as mathematical models for problems related to card shuffling, they have also recently found some applications in the field of large-scale genome evolution (see respectively, e.g., [11], and [15; 16]). Since the pioneering work of Diaconis and Shahshahani [14], much of the work has traditionally focused on the cutoff phenomenon, which describes the way random walks on finite graphs converge (with respect to a given metric on probability distributions on the underlying graph) to their equilibrium distribution in a dramatically short period of time. See, for instance, the excellent monographs by Diaconis [11] and Saloff-Coste [23]. However, much less is known about how a random walk behaves before it has reached its equilibrium distribution. The goal of this paper is to precisely study aspects of this question for different examples. The result of our analysis is that in some cases there is an intermediary phase transition (in the sense of the phase transition of [6], recalled below), while in some other cases there is a more complex system of transitions between different regimes with no precise cutoff.
The starting point of our investigation is a result we recently proved for a random walk on the permutation group S n on n markers. Let (X n t , t ≥ 0) be the continuous-time random transposition random walk. This means that X n t is a permutation and that at rate 1, we change the current permutation by performing a transposition of two randomly chosen elements. X n may be thought of as a continuous-time simple random walk on the Cayley graph of S n generated by the set of transpositions. Let D n t be the graphical distance of X n t from its starting point, i.e., D n t is the minimal number of transpositions necessary to change X n t into X n 0 . The main result of Berestycki and Durrett [6] is that D n t has a phase transition at time n/2 as n → ∞. Writing → p for convergence in probability, Theorem 3 in [6] may be restated as follows.
Theorem 0. Let t > 0. As n → ∞, n −1 D n tn → p f (t) where f (t) is defined by: The function f (t) is differentiable but the second derivative blows up as t ↓ 1/2. For t > 1/2 we have f (t) < t. In words, the distance from the starting point of the random walk X n asymptotically has a phase transition from linear to sublinear speed at time t = n/2.
Having seen this result, we ask in what situations does a random walk on a finite graph have a similar phase transition.
Organization of the paper. The rest of the paper is organized as follows. In the rest of this section we state our results which concern four different examples: random walk on a high-dimensional hypercube, random walk on a large random 3-regular graph, random adjacent transposition random walk, and the Gilbert-Shannon-Reeds riffle shuffle. We then discuss some related results and open problems in section 2. The proofs are in section 3, 4 and 5.

Random walk on the hypercube
We start with a trivial example. Let X n t be the random walk on the hypercube {0, 1} n that jumps at rate 1, and when it jumps the value of one randomly chosen coordinate is changed. We assume that X n 0 = 0. By considering a version of the chain that jumps at rate 2, and when it jumps the new coordinate takes on a value chosen at random from {0, 1} it is easy to see that, when n = 1, P 0 (X 1 t = 1) = (1 − e −2t )/2. Let D n t be the distance from X n t to X n 0 , i.e., the number of coordinates that disagree. Since the coordinates in the continuous time chain are independent, we easily obtain the following result. Although this result is very simple, we note that Diaconis et al. [13] have shown that a discretetime variant of this random walk undergoes an intermediary phase transition whose features present striking similarities with Theorem 0. After t moves, let W (t) be the distance below which the probability of the random walk being at a given vertex of the hypercube is above average, i.e. P t (x) ≥ 1/2 n (this W is well-defined because the probability of being at a particular vertex depends only the distance of that vertex to the origin). Then a consequence of the results of [13] is that there exists an α > 0 such that if t = λn for some λ > 0, Moreover a numerical approximation of α and a parametric relationship between ρ and λ are given (see (3.10) in [13]). A similar but simpler parametric relationship exists between t and f (t) in Theorem 0. However the precise relation to our work remains elusive at this point.

Random walk on a random 3-regular graph
A 3-regular graph is a graph where all vertices have degree equal to 3, and by random 3-regular graph we mean a graph on n vertices chosen uniformly at random from all 3-regular graphs on the n vertices.
The key to our proof is a construction of random 3-regular graphs due to Bollobás and de la Vega [9] (see also Bollobás [8]). This construction goes as follows. We suppose n is even. Expand each vertex i into 3 "mini-vertices" 3i, 3i + 1 and 3i + 2, and consider a random matching σ(j) of the 3n mini-vertices. A random 3-regular graph G n is then obtained by collapsing back the n groups of 3 mini-vertices into n vertices while keeping the edges from the random matching. We may end up with self-loops or multiple edges, but with a probability that is positive asymptotically, we do not, so the reader who wants a neat graph can condition on the absence of self-loops and multi-edges. In this case the resulting graph is a uniform 3-regular random graph.
Departing from our choices in the previous example, we consider the discrete time random walk X n k , k ≥ 0, that jumps from j to ⌊σ(3j + i)/3⌋ where i is chosen at random from {0, 1, 2}. (We have used this definition since it works if there are self-loops or multiple edges.) LetD n t be the distance from the starting point at time t.
An intuitive description of a random 3-regular graph, as seen from vertex 1, can be given as follows. Grow the graph by successively adding vertices adjacent to the current set. Branching process estimates will show that as long as the number of vertices investigated is O(n 1−ǫ ), this portion of the graph looks very much like a regular tree in which each vertex has 2 edges going away from the root and 1 leading back towards the root. Thus, until the distance ofX n from X 0 is ≥ (1 − ǫ) log 2 n,D n k evolves like a biased random walk on the nonnegative integers, with transition probabilities p(x, x + 1) = 2/3 and p(x, x − 1) = 1/3, and reflection at 0. After k moves we expect this walk to be at distance k/3. On the other hand, once the walk reaches a distance corresponding to the diameter of the graph, which is log 2 n by Bollobàs and de la Vega [9], or Theorem 2.13 in Worwald [24], it should remain at this level. Indeed, it cannot go any further, since this is the diameter. On the other hand the tree structure below makes it hard for it to come down back toward the root.
Open Problem 1. The techniques developed for the random walk on a 3-regular graph should be useful when dealing with random walk on the giant cluster of a Erdős-Rényi random graph with p = c/n and c > 1, which locally has the geometry of a "Poisson mean c Galton-Watson tree". We conjecture that the random walk exhibits a phase transition like the one in Theorem 1 but with a different constants in place of 3 and 1 on the right-hand side. One technical problem is that the diameter is strictly larger than the average distance between points log n/(log c), see Chung and Lu [10], so we don't have the easy upper bound.

Random adjacent transpositions
Let X n t be the continuous time random adjacent transposition random walk on n markers. An intuitive description of the process is as follows. We are thinking of X t (j) as the location of particle j, but the dynamics are easier to formulate in terms of Y t (i) := X −1 t (i), which is the number of the particle at location i. At rate 1, we change the permutation by picking 1 ≤ i ≤ n − 1 at random and exchanging the values of Y n t (i) and Y n t (i + 1). Without loss of generality we can suppose X n 0 is the identity permutation I. In other words, we have n particles numbered 1 to n initially sorted in increasing order, and at rate 1 we exchange two adjacent particles. More formally, at rate 1, we change the value of the permutation from X n t − to X n t by setting where τ is equal to the transposition (i, i + 1) with probability 1/(n − 1) for 1 ≤ i ≤ n − 1.
Given a permutation σ, there is a convenient formula which gives the distance d adj (σ) from σ to I, i.e., the minimum number of adjacent transpositions needed to build σ.
If we view the set of permutations S n of {1, . . . , n} as a graph where there is an edge between σ and σ ′ if and only if σ ′ can be obtained from σ by performing an adjacent transposition (in the sense defined above), then X t has the law of simple random walk on this graph and d adj (X t ) is the length of the shortest path between the current state of the walk, X t , and its starting point, the identity.
Erikkson et al. [19] and later Eriksen [18], who were also motivated by questions in comparative genomics, considered the problem of evaluating the distance for the discrete time chainX n k . Relying heavily on formula (2) they were able to carry out some explicit combinatorial analysis, to obtain various exact formulae for this expected distance, such as this one: where C r are the Catalan numbers and d r is a less famous non-negative integer sequence, defined in [18].
While formula (3) is exact, it is far from obvious how to extract useful asymptotics from it. We will take a probabilistic approach based on the formula If 1 ≤ i ≤ n is fixed, the trajectory X n t (i) of the i th particle is a continuous time simple random walk on {1, . . . , n} starting at i with jumps at rate 2/(n − 1) and reflecting boundaries at 1 and n that cause the particle to stay put with probability 1/2. Two such trajectories, say those of particles i and j with i < j, move by the nearest neighbor stirring process on {1, . . . , n} (which for indistinguishable particles produces the simple exclusion process). When the particles are not adjacent, they perform independent simple random walks. When they are adjacent, the only things that can happen are an exchange of the two particles, or one of them moves away from the other (see figure below for an illustration). As the reader can probably guess, and Durrett and Neuhauser [17] have proved on Z, when n is large the random walks behave as if they are independent.
On different time scales we see three different behaviors. At small times, the behavior is given by a messy formula that defines a smooth function. For an integer x ≥ 0, let T x denote the hitting time of the level x by a rate 4 continuous time random walk on Z starting at 0. Let {Y (t), t ≥ 0} and {Y ′ (t), t ≥ 0} be moved by random stirring on Z, with Y (0) = 0 and Y ′ (0) = 1. (That is, each edge of Z is endowed with a Poisson process with intensity 1. When the clock associated with an edge rings and that at least one end of the edge is occupied by a particle, we put that particle at the other end of the edge, while if both ends are occupied we simply exchange the particles -in particular, the particles never occupy the same site.) Let p(u) be the probability that at time u the relative order of the two particles has changed, i.e., , and note that this is the same as requiring the particles to have been exchanged an odd number of times. For all t > 0, let and recall the formula for the distance D t n given in (4).
is infinitely differentiable, and moreover it has the asymptotic behavior where B t is a standard Brownian motion.
To check the second equality in the limit, recall that by the reflection principle, for all x ≥ 0, so integrating gives An anonymous referee points out that the expression (5) which defines the function f describing the limiting behavior of the distance at small times may be simplified using well-studied special functions. From our point of view, the interest of that formula is that it is not the same as in other regimes, as we will see in Theorems 3 and 4.
The next result looks at the distance of the random walk at times of order n 3 , i.e., when each particle has moved of order n 2 times, and hence has a significant probability of hitting a boundary. Let p t (u, v) denotes the transition function ofB, a one-dimensional Brownian motion run at speed 2 reflecting at 0 and 1.
In between the two extremes we have a simple behavior, anticipated by the limit in Theorem 2.
Theorem 4. Let s = s(n) with s → ∞ and s/n 2 → 0. Then Recently, Angel et al. [2] (see also [3]) have also used the simple exclusion process to analyze a process on the Cayley graph of the symmetric group generated by adjacent transpositions, but this time in the context of sorting networks.

Riffle shuffles
The Gilbert-Shannon-Reeds shuffle, or riffle shuffle, is a mathematical model for the way card players shuffle a deck of cards. It can be viewed as a nonreversible random walk on the permutation group. We identify the order of the deck of n cards with an element of the permutation group S n by declaring that π(i) is the label of the card in position i of the deck (and hence π −1 (i) is the position in the deck of the card whose label is i). The most intuitive way to describe this shuffle is to say that at each time step, σ m is obtained from σ m−1 by first cutting the deck into two packets, where the position of the cut has a Binomial (n, 1/2) distribution. The two packets are then riffled together in the following way: if the two packets have respective sizes a and b, drop the next card from the first packet with probability a/(a + b) and from the second with probability b/(a + b). This goes on until cards from both packets have been dropped, and the resulting deck forms σ n . This shuffle has been extensively studied. See, e.g., Bayer and Diaconis [4] and Aldous [1], for results about the mixing time of this random walk, which is (3/2) log 2 n for the total variation distance.
Bayer and Diaconis [4] were able to prove the following remarkable exact formula for the probability distribution of the random walk after a given number of steps. Let π ∈ S n be a permutation, viewed as an arrangement of cards, and let r = R(π) be the number of rising sequences of π.
A rising sequence of π is a maximal subset of cards of this arrangement consisting of successive face values displayed in order. For instance, if n = 13 and the deck consists of the following arrangement: 1 7 2 8 9 3 10 4 5 11 6 12 13 then there are two rising sequences: Theorem 1 of Bayer and Diaconis [4] states that after m shuffles, Note that a consequence of the Bayer-Diaconis formula (6) is that the chance of π is positive if and only if 2 m − R(π) ≥ 0 or m ≥ ⌈log 2 R(π)⌉. Therefore, the distance of a permutation π to the identity (where here the distance means the minimal number of riffle shuffles needed to build σ m ), is given by the explicit formula Based on these ideas, it is easy to prove the following result. Let D(m) be the distance to the identity of the random walk after m shuffles.
Remark. It is interesting to note that this random walk reaches the average distance of the graph abruptly at time log 2 n, while it reaches uniformity at time (3/2) log 2 n (see, e.g., Aldous [1] and Bayer-Diaconis [4]). This contrasts with the conjectured situation for random 3-regular graphs.
When t < 1, this result can be deduced from Fulman's recent paper [20], although our methods are much more elementary. However, Fulman obtains some much more precise results, which describe what happens near the transition point when t = 1, and convey some information about the fluctuations when t ≤ 1. This result and related open problems will be discussed in the next section. Theorem (Fulman [20]). Suppose α > 1/(2π).
To see why this indeed the same as his Proposition 4.5, simply note that his R k,n coincides with the law of σ −1 m for m = 2 k . Since where Des(σ) is the number of descents of σ, (8) follows immediately. Using (7), Fulman's result (8) has an immediate interpretation for the distance to the identity after m shuffles. Using in particular the Stein method, he also finds that the variance of R(σ m ) is approximately C α n for some explicit but complicated C α > 0, and that R(σ m ) is asymptotically normally distributed with this mean and variance. For smaller values of m, in particular for m = t log 2 n and t < 1 (i.e., before the phase transition point of Theorem 5), he finds that the number of rising sequences is approximately 2 m − Z, where Z is a Poisson random variable with mean λ := 2 m /n. This parallels in a striking way the Poisson and normal deviations observed by us in [6].
It is not clear at this point whether (8) also holds for α < 1/(2π), although it is tempting to let α → 0 and get that for small values of α the walk is "almost" linear (the fraction term with the exponential is much smaller than the other term).

Geometric interpretation of phase transitions.
The techniques used to prove the results in this paper, and other results such as Theorem 0 or Fulman's result, rely in general on ad hoc formulae for the distance of a point on the graph to a given starting point. For the moment there does not seem to be any general technique to approach these problems. However we note that a geometric approach has been proposed by [5]. The main result of [5] relates the existence of such phase transitions to some qualitative changes in the hyperbolic properties of the underlying graph of the random walk: the space looks hyperbolic to the random walk until a certain critical radius. Beyond this critical radius, space starts wrapping around itself and ceases to look hyperbolic. (While [5] is only concerned with the random transposition random walk, it is easy to rephrase this result for more general walks with phase transitions). This is for instance consistent with Theorem 1 for random 3-regular graphs, where we indeed expect hyperbolicity to break down at distance log 2 n. However this hyperbolicity criterion seems hard to use in practice. Can a general method be developed?

Cyclic adjacent transpositions.
Following a question raised to us by W. Ewens, we now turn our attention to a process closely related to the random adjacent transpositions analyzed in the present paper. Suppose that we modify the dynamics of X n t defined by (1) by also allowing the transposition τ = (1 n) in addition to τ = (1 2), (2 3), . . . , (n − 1 n). That is, we only exchange adjacent particles, but now adjacent is interpreted in a cyclical way. Informally, we have n particles equally spaced on the unit circle, and exchange adjacent particles at rate 1. For a given configuration of particles σ, let d(σ) be the number of moves it takes to put the particles back in order using only exchanges of adjacent particles, and let D n t = d(X n t ). We conjecture that in this setting, Theorems 2 and 4 still hold. For large times we conjecture the following result.
where |R t | denotes the Lebesgue measure of the range of a Brownian motion with unit speed on the circle of radius 1.
We view this conjecture as an analogue of Theorem 3, since the scalings are the same in both statements. Moreover, this conjecture comes from a heuristics similar to the one leading to Theorem 3. However, the difficulty here is that there is no exact formula analogous to (2) for the distance of a permutation using cyclic transpositions.

Random walk on a random 3-regular graph
Let G n be a random 3-regular graph as constructed in the introduction using the approach of Bollobás and de la Vega [9] (that is, G n is a random multigraph which contains no multiple edges or self-loops with probability bounded away from zero). Let X k be the discrete time random walk on G n , where for simplicity we drop both the superscript n and the hat to indicate discrete time. We assume that X 0 = 1 and write D n k for the graph distance from X k to X 0 . Our goal is to prove Theorem 1, that is, for fixed t > 0 D n ⌊t log 2 n⌋

Proof for the subcritical regime
Let v be a vertex at distance ℓ from the root. We say that v is a "good" vertex if it has two edges leading away from the root (at distance ℓ + 1) and one leading back to distance ℓ − 1.
Otherwise we say that v is a "bad" vertex. Let B(ℓ) be the set of all bad vertices at distance ℓ.
Lemma 1. Let 2 ≤ v ≤ n be a vertex distinct from the root. Given that v is at distance ℓ from the root, P(v ∈ B(ℓ)) ≤ 3 · 2 ℓ /n.
Proof. First consider the event that v has an edge leading to some other vertex at distance ℓ.
Since it is at distance ℓ, it must have at least one edge leading backwards, so there are only two other edges left. In particular (taking into account that the root has three edges going out), there are at most i := 3 · 2 ℓ−1 vertices at distance ℓ. In G n those i vertices at distance ℓ correspond to 2i unpaired mini-vertices, so the probability of a connection sideways to another vertex at distance ℓ is smaller than 2i/3n.
When v has two edges leading forward, the probability that one of its children is connected to another vertex from level ℓ is also smaller than 2i/3n since there are at most 2i edges leading to level ℓ + 1. Since v has at most 2 children, this gives a probability of at most 4i/3n. Combining this with the estimate above gives 2i/3n + 4i/3n = 2i/n. Since i = 3 · 2 ℓ−1 this terminates the proof of Lemma 1.
A simple heuristic now allows us to understand that with high probability the random walk will not encounter any bad vertex as long as we are in the subcritical regime. Before we encounter a bad vertex, the distance to the origin is a (2/3,1/3) biased random walk and hence the walk spends an average of 3 steps at any level. Hence, the expected number of bad vertices encountered until distance (1 − ε) log 2 n is smaller than To prove this rigorously, let A k denote the event that by time k the random walk has never stepped on a bad vertex.
On this event, for each 1 ≤ j ≤ 3(1 − ε) log 2 n, X j has probability 2/3 to move away from the root and 1/3 to move back towards the root, and the first part of Theorem 1 follows easily.
Proof. By Lemma 1 the probability that some vertex within distance L of 1 is bad is if L = (1/3) log 2 n.
Since for each vertex there are at most two edges leading out and one leading back, the distance from the starting point is bounded above by a (2/3,1/3) biased random walk. Standard large deviations arguments imply that there are constants C and α depending on ρ > 1/3 so that where the term o(1) accounts for (11). Taking the logarithm, we have for large n We want to take k = 3(1 − ε) log 2 n. By choosing ρ close enough to 1/3 so that 3ρ(1 − ε) < 1, we have 2 kρ /n = n −α with α > 0 which proves that log P(A ′ k ) → 0 as n → ∞, or equivalently, P(A ′ k ) → 1 as n → ∞. However, since A ′ k ⊂ A k , we deduce immediately that P(A k ) → 1 as n → ∞. This finishes the proof of Lemma 2.

Proof for the supercritical regime
Here we wish to prove that if k = t log 2 n, with t > 3(1 − ε), then d(X k ) ∼ log 2 n. As already noted, this is the diameter of G n so all we have to prove is that once it reaches this distance it stays there. To do this we let Intuitively, this strip consists of about n 1−ε trees, each with at most n ε−δ vertices. However, there are sideways connections between these trees so we have to be careful in making definitions. Let v 1 , . . . , v m be the m vertices at level (1 − ε) log 2 n. For j = 1, . . . , m if v ∈ L(1 − ε, 1 − δ), we say that v ∈ T j if v j is a closest vertex to v among v 1 , . . . , v m . Define an equivalence relation on {1, . . . , m} by saying that j ∼ j ′ if and only if T j ∩ T j ′ = ∅. We will call the equivalence classes for this relation cluster of trees.
To estimate the number of sideways connections (or rather, the cardinality of an equivalence class), we use the following lemma.
Lemma 3. The cardinality of the equivalence class of j (i.e., the number of subtrees that T j is connected to) is dominated by the total population of a branching process with offspring distribution Binomial(n ε−δ , 3n −δ ).
Proof. Each tree to which we connect requires a bad connection (i.e., one of the two possible errors in Lemma 1). Suppose we generate the connections sequentially. The upper bound in Lemma 1 holds regardless of what happened earlier in the process, so we get an upper-bound by declaring each vertex at level ℓ bad independently with probability 2i/n with i = 3 · 2 ℓ−1 , so this probability is at most n −δ . Since there are at most n ε−δ vertices in a given subtree, the lemma follows immediately.
Lemma 4. If δ > ε/2 then there exists some K = K(ε, δ) > 0 such that, P(there is a cluster of trees T j with more than K bad vertices) → 0.
Proof. The worst case occurs when each bad connection in a tree leads to a new one. Let Lemma 4 follows from a simple evaluation of the tail of the total progeny Z of a branching process with offspring distributed as X. To do this, we let φ N (θ) = E[exp(θ(X − 1))] be the moment generating function of X − 1. Then Let (S k , k ≥ 0) be a random walk that takes steps with this distribution and S 0 = 1. Then τ = inf{k : S k = 0} has the same distribution as Z. Let Then (R k , k ≥ 0) is a nonnegative martingale. Stopping at time τ we have Using φ N (θ) ≤ e −θ exp(c(e θ − 1)) now we have To optimize the bound we want to minimize c(e θ − 1) − θ. Differentiating this means that we want ce θ − 1 = 0 or θ = − log(c). Plugging this and recalling that τ and Z have the same distribution we have Substituting c = 3n −α with α = 2δ − ε, we find that P(Z ≥ y) ≤ 3n α exp(y(1 − α log(n))).
Since there are m ≤ n 1−ε trees to start with, the probability that one of them has more than y trees in its cluster is smaller than then the probability than one cluster contains more than y trees tends to 0. This implies that with probability 1 asymptotically, no cluster of trees has more than K bad vertices, since the branching process upper-bound is obtained by counting every bad vertex as a sideways connection.
With Lemma 4 established the rest is routine. Choose K as in Lemma 4. On the event that no cluster of trees contains more than K bad vertices, there is a region of this cluster of length at least ≥ a log 2 n where a = (ǫ − δ)/(K + 1) with no bad vertices.
When in this region, X n is a biased (2/3,1/3) random walk. It is a well-known fact that if (S n , n ≥ 0) is a (p, q)-biased random walk with p > 1/2, then P 0 (T −1 < ∞) = (1 − p)/p. Hence, the probability that, starting from the top of this region, the random walk will reach the bottom is equal to (1/2) a log 2 n = n −a . Therefore, the probability of ever downcrossing this strip in n a/2 attempts tends to 0. Now, if t ≥ 3 is fixed, by time ⌊t log 2 n⌋, there are at most ⌊t log 2 n⌋ attempts to cross it downward, and so we conclude that with high probability, the random walk cannot cross the strip L(1−ε, 1−δ) downward. The critical and supercritical part of the theorem follow.

Random adjacent transpositions
Let X t , which we write for now on without the superscript n, to be the continuous time walk on permutations of {0, 1, 2, . . . , n} in which at rate 1 we pick a random 0 ≤ i ≤ n − 1 and exchange the values of X t (i) and X t (i + 1). As indicated in (2) the distance from a permutation σ to the identity is d adj (σ) = #{0 ≤ i < j ≤ n : σ(i) > σ(j)}, the number of inversions of σ.

Small times
The reflecting boundaries at 0 and n are annoying complications, so the first thing we will do is get rid of them. To do this and to prepare for the variance estimate we will show that if i < j are far apart then the probability X t (i) > X t (j) is small enough to be ignored. Let P [a,b] be the probabilities for the stirring process with reflection at a and b, with no superscript meaning no reflection.
Proof. A simple coupling shows Using symmetry and then the reflection principle, the last quantity is which completes the proof.
When x = 3 log n the right-hand side is C t n −3 , so using Lemma 5, for fixed t it suffices to consider "close pairs" with 0 < j − i < 6 log n. The number of close pairs with i ≤ 3 log n or j > n − 3 log n is ≤ 36 log 2 n, so we can ignore these as well, and the large deviations result implies that it is enough to consider random stirring on Z.
We are now ready to prove the first conclusion in Theorem 2: if t > 0 then as n → ∞ Proof of (14). It is clear from the Markov property that if X t (i) and X t (j) are moved by stirring on Z then With the large deviations bound in (13) giving us domination we can pass to the limit to conclude To prove convergence in probability let ξ i,j = 1 (Xt(i)>Xt(j)) − P(X t (i) > X t (j)).
By remarks above it suffices to consider the sum over 1 ≤ i < j ≤ n with 0 < j − i < 6 log n, i ≥ 3 log n and j ≤ n − 3 log n which we denote by Σ * , and if i ′ > j + 6 log n then since the random variables have |ξ| ≤ 1 and will be independent unless some random walk moves by more than 3 log n in the wrong direction. From this it follows that E (Σ * ξ i,j ) 2 ≤ n · (6 log n) 3 + 4C t n −3 (n · 6 log n) 2 and the result follows from Chebyshev's inequality.
The remaining detail is to show that f is smooth and that as t → ∞, where B · is a standard Brownian Motion. The fact that f is infinitely differentiable follows easily from repeated use of Lebesgue's theorem and the fact that both p(u) and dP(T x ∈ du)/du are infinitely differentiable smooth functions. This is itself easily checked: for instance, if q j is the probability that a simple random walk in discrete time started at 0 hits x in j steps, then T x = ∞ j=x q j Gamma(j, 4), so T x has a smooth density. A similar argument also applies for the function p(u).
Proof. Each time there is jump when the particles Y and Y ′ are adjacent, they have a probability 1/3 of being exchanged the next step. So, conditionally on the number of such jumps N , the number of actual swaps between Y and Y ′ is Binomial (N, 1/3). Now, Y > Y ′ if and only if the number of times they are swapped is odd. Hence the lemma follows from the two observations : (i) As t → ∞, the number of jumps while they are adjacent to each other → ∞, and (ii) as N → ∞, P[Binomial (N, p) is odd] → 1/2 for any given 0 < p < 1. For (i), observe that the discrete-time chain derived from {|Y t −Y ′ t |−1, t ≥ 0} is a reflecting random walk on {0, 1, . . .}, and therefore visits 0 infinitely many times. (ii) is an easy fact for Bernoulli random variables.
Proof. The random walk can only hit a new point when it jumps so 1 {T x ∈(t−log t,t)} ≤ t −1/2 E(#jumps of the random walk in(t − log t, t)) ≤ t −1/2 · (4 log t) → 0 since jumps occur at rate 4.
It is now straightforward to complete the proof. Let ε > 0. Fix T large enough so that |p(t) − 1/2| ≤ ε as soon as t ≥ T . Then by Lemma 7, for t ≥ T ′ := e T , letting W t be a simple random walk on Z in continuous time jumping at rate 1, by Donsker's theorem. The other direction lim inf t→∞ t −1/2 f (t) ≥ (1/2 − ε)E max s≤1 B 4s can be proved in the same way.

Large times
Our next goal is to prove that if t > 0 then in probability and whereB 1 andB 2 are two reflecting Brownian motions run at speed 2 started uniformly on 0 ≤B 1 (0) <B 2 (0) ≤ 1 and evolving independently.
Proof. We first show that the expected value converges. The first step is to observe that the rescaled random walks X n 3 t (i)/n, t ≥ 0 converge to reflecting Brownian Motion on [0, 1]. Indeed, Durrett and Neuhauser [17, (2.8)] showed that for fixed i < j, the rescaled pair of random walks converge to two independent Brownian motions. They did this on Z but the proof extends in a straightforward way to the current setting. Their proof shows that if i/n → x and j/n → y we have This implies that the convergence occurs uniformly on the compact set so To get the convergence in probability, we use second moment estimates. Let A i,j = {X n 3 t (i) > X n 3 t (j)}.
The first step is to observe that there are only O(n 3 ) terms in which two of the indices are equal so these can be ignored. When the four indices are distinct we can again apply Durrett and Neuhauser's [17] results to the 4-tuple of random walks (X(i), X(j), X(k), X(l)), to conclude that if i/n → x, j/n → y, k/n → x ′ and l/n → y ′ From this it follows that In other words, the variance of n −2 D n n 3 t is asymptotically 0, and applying Chebyshev's inequality, we get the convergence in probability to the limit of the means.

Intermediate regime
The proof of Theorem 4 is a hybrid of the two previous proofs. We first truncate to show that it suffices to consider i < j close together and far from the ends, then we compute second moments. We begin with a large deviations result: Proof. First assume x ≤ 4et. From (13) we have P(X nt (0) > x) ≤ exp(−θx + t[e θ + e −θ − 2]). When 0 ≤ θ ≤ 1 Taking θ = x/4et which is ≤ 1 by assumption When x > 4et, note that P(X nt (0) > x) is smaller than the probability that a Poisson random variable with mean 2t is greater than x. Thus for any θ > 0 this is by Markov's inequality smaller than exp(−θx + 2t(e θ − 1)). This is optimal when e θ = x/2t, in which case we find that since x ≥ 4et. Equations (17) and (18) give us two bounds valid in different regions, so by summing them we get a bound that is everywhere valid, and this concludes the proof.
Proof of Theorem 4. By assumption we can pick K n → ∞ so that K 2 n √ s/n → 0. (We can also assume, for convenience, K n √ s ∈ N). By Lemma 5, Applying Lemma 8 it follows that Letting I i,j be the indicator of {X ns (i) > X ns (j)} it follows that i.e., we can restrict our attention to close pairs. Once we do this, we can eliminate ones near the ends since by assumption. In a similar way we can eliminate j > n − K n √ s.
It follows that it is enough to consider random stirring on Z. The result of Durrett and Neuhauser [17] implies that if s → ∞, i ≥ K n √ s, j ≤ n − K n √ s and (j − i)/ √ s → x then where the right-hand side is 0 if x = ∞. Writing Σ * again for the i, j with i ≥ K n √ s, j ≤ n − K n √ s and 0 < j − i < K n √ s, and using the domination that comes from Lemma 8 it follows The next step is to compute the second moment, which can be expressed, as in the proof of Theorem 3, as a sum of probabilities over four possible starting points, i < j and k < l. The number of terms in this quadruple sum such that one index in i < j is equal to one index of k < l (say i = k), and such that both pairs are close (i.e., j − i ≤ K n √ s and k − l ≤ K n √ s), is at most n(K n √ s) 2 . Dividing by (n √ s) 2 , this tends to 0, so we can ignore this part of the summation. On the other hand, the result of Durrett and Neuhauser [17] implies that terms in which all four indices are different are asymptotically uncorrelated. A dominated convergence argument thus implies: Indeed, using Cauchy-Schwarz's inequality, we get: E(I i,j I k,l ) ≤ P [0,n] (X ns (i) > X ns (j) 1/2 P [0,n] (X ns (k) > X ns (l) 1/2 .
We may apply Lemma 5, and we note that in Lemma 8 we can also get by summing the square-roots of the two terms in (17) and (18) since only one of them applies in a given region. It is then easy to see that the assumptions of the dominated convergence theorem are satisfied and thus As in Theorem 3, this implies (19) and using Chebychev's inequality, this finishes the proof of Theorem 4.

Riffle Shuffle
To prove Theorem 5, we make extensive use of the well-known trick which consists of studying the inverse random walk (σ ′ m , m ≥ 1) rather than the random walk itself. This is a random walk on S n which has the following dynamics. For each m ≥ 1, σ ′ m is obtained from σ ′ m−1 by deciding independently for each card if it goes in the upper or lower packet (each with probability 1/2). The upper packet is then put on top of the lower packet. Bayer and Diaconis call such a shuffle an inverse 2-shuffle, because there are two piles. More generally, consider the inverse a-shuffle, where a is an integer greater or equal to 2. This process is defined by the following dynamics: at each time step, every card is independently placed into one of a packets with equal probability. At the end, the a packets (some of them may be empty) are stacked one on top of the other. We shall use the following well-known lemma due to Bayer and Diaconis (see [4, Lemma 1] for a proof). Recall the definition of the number of rising sequences R(π) of a permutation π in section 5, and formula (7). Since R(σ) = Des(σ −1 ) + 1, where is the number of descents of σ, it suffices to study the number of descents after performing an inverse 2 m shuffle. We will use the terminology that σ has a descent at i if σ(i + 1) < σ(i).
Let m = ⌊log 2 n − log 2 (C log n)⌋, for some C > 0 whose value will be determined later. In an inverse 2 m shuffle, each pile contains a Binomial (n, p) number of cards with p = 1/2 m . The next elementary lemma shows that with high probability each pile has more than half what we expect.
Lemma 10. Let A be the event that each pile in an inverse 2 m shuffle contains at least np/2 cards where p = 1/2 m . Then P(A) = 1 − o(n −1 ).
Using this result with p = 1/2 m and m = log 2 (n/C log n) where C is large, then P(S ≤ np/2) ≤ n −2 .
Since there are 2 m = o(n) piles, a simple union bound shows that with probability greater than 1 − o(n −1 ), all 2 m piles are ≥ np/2.
The next step is to show that conditionally on the event A, with high probability each pile creates a descent in the permutation that results by putting the piles on top of one another. A moment of thought shows that the last card of pack i is not a descent for the resulting permutation only if the entire pack i is filled before the first card of pack i + 1 is dropped, an event that we will call B i . Whenever a card is dropped in one of the piles i or i + 1, the probability it will go to pile i is just 1/2, so if the eventual size of pack i is a and that of pack i + 1 is b, P(B i ) = 1/2 a+b ≤ 2 −a . But conditionally on A, we know a ≥ np/2. We conclude that P(B i |A) ≤ 2 −np/2 = 2 −C log n/2 ≤ n −2 if C is large enough. Hence with probability 1 − o(n −1 ), there are at least 2 m − 1 descents after a 2 m -inverse shuffle. This implies that R(σ m ) = 2 m and that D(m) = m with probability 1 − o(n −1 ). To finish the first part of Theorem 5 (the part t < 1) it suffices to note that if the distance is m at time m = log 2 (n/C log n), then it is also true that D(m ′ ) = m ′ for smaller values of m ′ , since the distance can increase by at most 1 at each time step.
To finish the proof, it remains to show that if m = t log 2 n and t ≥ 1, D(m) ∼ log 2 n. We start by the following lemma.
Lemma 11. With high probability there are at least n/4 non-empty piles.
Proof. When a card is dropped, and k piles have already been started, the probability that the card is dropped in an empty pile is 1 − k/2 m . If we focus on the first n/2 cards, k ≤ n/2 necessarily, and since 2 m ≥ n t , it follows that this probability is greater than 1−(1/2)n 1−t ≥ 1/2. Since this is independent for different cards, the total number of non-empty piles is greater than a Bernoulli random variable with parameters n and 1/2. This is greater than n/4 with probability exponentially close to 1 by standard large deviations.
Ignoring the empty piles, we will argue in a way similar as above that these n/4 piles give rise to at least cn descents with high probability (for some c > 0) when they are stacked one on top of the other. To see this, note that each non-empty pile gives a new descent when it is stacked with the next non-empty pile with positive probability. Indeed, with positive probability it is the pile on the right which gets filled first and this automatically gives rise to a descent. For disjoint pairs of piles, this event happens independently and so by the law of large numbers there are at least cn descents with high probability. This implies R(σ m ) ≥ cn with high probability. By (7), D(m) = ⌈log 2 R(σ m )⌉ ≥ log 2 n − O(1) with high probability. On the other hand the Bayer-Diaconis formula (6) tells us that the diameter of the graph is ⌈log 2 n⌉ and hence we conclude (log 2 n) −1 D(⌊t log 2 n⌋) → p 1 as claimed for t ≥ 1.