{'fraction_non_alphanumeric': 0.06408179227889826, 'fraction_numerical': 0.015866808201575506, 'mean_word_length': 3.6181630546955623, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Ehrenfest urn model with interaction

We studied the Ehrenfest urn model in which particles in the same urn interact with each other. Depending on the nature of interaction, the system undergoes a first-order or second-order phase transition. The relaxation time to the equilibrium state, the Poincare cycles of the equilibrium state and the most far-from-equilibrium state, and the duration time of the states during first-order phase transition are calculated. It was shown that the scaling behavior of the Poincare cycles could be served as an indication to the nature of phase transition, and the ratio of duration time of the states could be a strong evidence of the metastability during first-order phase transition.


I. INTRODUCTION
Historically, the Boltzmann's H theorem based on the assumption of molecular chaos singles out a direction of time, which led to two pardoxes [1]. The first one, so-called reversal paradox, states that the H theorem is inconsistent with the time reversal invariance. The Poincare theorem [2] requires that the system should return to its initial state (up to an arbitrarily small neighborhood) after sufficiently long time. This fact implies reversibility of the dynamical system, leading to the socalled recurrence paradox. Later on, the Ehrenfest urn model [3] was proposed to resolve the paradoxes and clarify the relationship between reversible dynamics and irreversible thermodynamics.
The Ehrenfest model deals with two urns with total N particles. Each particle is randomly chosen with equal probability in such a way that it is taken from one urn to another urn. It is found that the relaxation time for the system to reach its equilibrium is proportional to N , and the Poincare cycle of the most far-from-equilibrium state is proportional to 2 N [4].
Since then, the Ehrenfest model was generalized such that the jumping rates between two urns are unbalanced [5,6], the system of two urns becomes multiurn [7][8][9], and multiurn are connected in a complex network [10]. Fluctuation distribution of the model was also studied [11][12][13].
The Ehrenfest model was also applied to understand the granular system by inducing different effective temperatures with respect to gravitational field in different urns, which turns out to exhibit the spatial separation (symmetry-breaking) phase transition [14][15][16]. This model was also solved analytically [17].
By considering the continuum limit of time step in the evolution of the probability of the state, the linear Fokker-Planck equation is obtained [4,18]. Modification of the Ehrenfest model by incorporating nonlinear contribution to the Fokker-Planck equation recently calls for attention [19][20][21], which is motivated by the processes associated with anomalous-diffusion phenomena [22][23][24].
The generalized H theorem for the nonlinear Fokker-Planck equation was studied by many authors in recent years [25][26][27][28].
Although many attempts were made to modify the Ehrenfest model, none of them has been associated with explicit particle interaction, to our knowledge. The model that we modified exhibits the (first-order and secondorder) phase transition depending on the nature of interaction. We also calculate the relaxation time to the equilibrium state, the Poincare cycles of both the equilibrium and the most far-from-equilibrium states, and the duration time of the states during the first-order phase transition. Finally, we point out that the scaling behavior of the Poincare cycle could be served as an indication of the nature of the phase transition, and the ratio of duration time of the states could be a strong evidence of the metastability during first-order phase transition.

II. EHRENFEST MODEL WITH INTERACTION
We present our model as follows. There are N particles distributed into two urns. The number of particle in the left and right urns are n and N − n, respectively. Since the total particle number N is fixed, we label the state of the system by its particle number in the left urn, denoted by |n .
Unlike the original Ehrenfest model, we introduce particle interaction in the same urn. Two particles of different urns do not interact. The total energy E = J 2 (n(n − 1) + (N − n)(N − n − 1)) with energy coupling J. The interaction is attractive (replusive) if J is negative (positive). When a particle jumps from the left to the right urn, ∆E = −J(2n − N − 1). To satisfy the principle of detailed balance, we should have the restriction on the transition probability such that where T n±1,n is the transition probability from the state |n to |n ± 1 , β is the inverse of effective temperature, and we introduce the coupling constant g ≡ N Jβ such that ∆E is extensive (proportional to N given fixed g).
There is a degree of freedom to choose the transition probability; however, we adopt Note that T n−1,n = T n,n−1 = 1 2 if the interaction is turned off. Different proportionality implies different time scale chosen. Besides the particle interaction, we further introduce the jumping rate from one urn to another urn, which is independent of the particle interaction. Suppose the probability of jumping rate from the left (right) to the right (left) urn is p(q). For convenience, we restrict p + q = 1. Again this restriction only changes the time scale.
After s steps from the initial state |n 0 , the probability of the state |n is denoted by n|p(s)|n 0 , where p(s) is the corresponding operator. As illustrated in Fig. 1, one have the recurrence relation from the (s − 1)-th to s-th step such that n|p(s)|n 0 = W n,n−1 n − 1|p(s − 1)|n 0 + W n,n+1 n + 1|p(s − 1)|n 0 + W n,n n|p(s − 1)|n 0 where W n−1,n = n N pT n−1,n , W n,n−1 = N −n+1 N qT n,n−1 , and W n,n = 1 − W n−1,n − W n+1,n . It is convenient to rewrite the recurrence relation in a matrix form. Let the state vector The normalization condition (probability conservation) of the state vector is where A and Λ are matrices of dimension (N +1)×(N +1). Their components are A nm = φ n (m) and Λ nm = λ m δ nm .
The eigensystem becomes The indices m to λ and φ n is omitted without causing any confusion. We found no exact solution to the eigenproblem except for some special cases, e.g. the cases in which g = 0 and g → −∞ (See Appendix A and B for details). If λ N = 1 (we label its index N ), in which the eigenstate could be verified by directly substitution into Eq. (8).

III. MEAN PARTICLE NUMBER
The mean particle number after s steps, Suppose there is an unique state of unity eigenvalue, says, λ N = 1, and all the remaining eigenvalues are less than unity, as s → ∞, the mean value n is defined as By taking the limit s → ∞ in Eq. (6), we get N n=0 A nN A −1 N m = 1 for any m. Hence which is independent of m. Substitute Eq. (12) into Eq. , In general, there is no closed form for Eq. (13) if N is finite. If N is large enough, we could derive the asymptotic result. Notice that, by using the Stirling formula [32], one can rewrite Eq. (9) as φ n (N ) = where x = n N , the proportion of particle number in the left urn, and As N is large enough, the integral is asymptotically where {x sp } is the set of the saddle points satisfying f ′ (x sp ) = 0 and f ′′ (x sp ) < 0. x sp represents the proportion of particle number in the left urn at equilibrium state or metastable state. The condition that f ′ (x sp ) = 0 is expressed as . If g is large enough, says, g > g sp , there is only one saddle point x sp . When g < g sp , two saddle points appear, namely x sp,− < x sp,+ . f (x sp,+ ) > f (x sp,− ) as p < 1 2 and vice versa. The plot of the saddle points as a function of g for different p are shown in Fig. 2. g sp as a function of p is plotted in the inset.
The numerator in Eq. (13) in large N limit can be evaluated by a similar way. In large N limit, n = n sp if g > g sp . When g < g sp , we have When p = 1 2 , the system undergoes a second-order phase transition by varying the coupling constant g. The order parameter, n , changes continuously across the transition. The critical point g c can be determined by solving f ′′ (x sp )| g→g + c = 0, which gives g c = −2. If g < g c , there's a first-order phase transition as p varies. The critical point p c is given by As seen from Eq. (18) and Fig. 3, the order parameter, n , changes discontinuously at p = p c . The saddle point at x sp,− (x sp,+ ) when p < p c (p > p c ) represents the metastable state. Due to the existence of the metastable state, the system shows hysteresis. In the section VI, we provide another means to indicate the existence of metastability.

IV. RELAXATION TO EQUILIBRIUM
When the system is not at its equilibrium, it will relax. It is interesting to know how the relaxation time behaves. Expanding Eq. (10) with the help of Eq. (11) gives where the eigenvalues are arranged in ascending order, If s is large enough, the last contribution term before reaching the equilibrium is the λ N −1 term, which also defines the relaxation time If g = 0, for large N , τ R = N . If g = 0, the eigenvalues can be found by perturbation (See Appendix D for details).
For g > g sp , let M 0 be the transition matrix at g = 0. The perturbed transition matrix M 1 = M − M 0 , and then apply Eq. (A.79), after some algebra, we have the first-order perturbation correction to the m-th eigenvalue For m = N , notice that A −1 N n = 1 by using Eqs. (A.51) and (A.56), we get λ where we only keep the leading order for large N in the asymptotic expansion. From the definition of the relaxation time in Eq. (20), In particular, when p = 1 2 , Notice that τ R → 0 as g → +∞. The more repulsive interaction, the shorter relaxation time to the equilibrium. By keeping only the first two terms in Eq. (19), and using the definition of τ R from Eq. (20), we have n s = n + (n 0 − n )e −s/τR (25) as s is large enough. n 0 is the initial value. The above formula is compared with the numerical result, as shown in Fig. 4. Good agreement at large s is found. The first-order perturbation correction to the next largest eigenvalue is if only the leading order for large N is kept. The relaxation time is then g is largely negative if p deviates from 1 2 a lot, as shown in the inset of Fig. 2. In this case, τ R ≃ N p , which is the limit as g → −∞.
Similarly, if p > 1 2 , the relaxation time is and τ R ≃ N q when p deviates from 1 2 a lot. With the help of the relaxation time, we have |n − n 0 | s + n 0 = n + (n 0 − n )e −s/τR (29) as s is large enough. n 0 is the initial value. Here we use |n − n 0 | s + n 0 instead of n s in order to avoid the interference from the metastable state. The above formula is compared with the numerical result, as shown in Fig. 5. Again both analytical and numerical results match well at large s.

V. POINCARE CYCLE
In this section, we are going to discuss the scaling behavior of the Poincare cycle with respect to the particle number N and the tuning parameters (g or p) across the (first-order and second-order) phase transition.
The Poincare cycle of the state |n , denoted by τ P (n), is defined as the mean time from the state |n to its original state at its first time, τ (n → n), which is (see Appendix C for the proof) If p = 1 2 , by Eqs. (9) and (16), and also notice that f ′′ (x sp ) = −2(g − g c ) with g c = −2, it is straightforward to have the Poincare cycle of the equilibrium If g < g c , two saddle points n sp,± emerge. When g < ∼ g c , n sp,+ > ∼ N 2 and n sp,− < ∼ N 2 . f (x sp,+ ) = f (x sp,− ). One can solve for x sp,± ≃ 1 2 ± 3 8 (g c − g) 1 2 . Notice that f ′′ (x sp,± ) = −4(g c − g), the Poincare cycle of the equilibrium When g ≪ g c , n sp,+ < ∼ N and n sp,− > ∼ 0, then x sp,+ ≃ 1 − e g , and x sp,− ≃ e g . f ′′ (x sp,± ) ≃ −e −g , then The Poincare cycle of the equilibrium state τ eq P has always √ N dependence. It becomes divergent at the transition point g = g c . From Eq. (16), it is seen that the divergence comes from the vanishing |f ′′ (x sp )| g→gc in the denominator, which implies that it is universal in secondorder phase transition. However, note that Eq. (16) is obtained in large N limit. For large but finite N , one should see the divergent-like scaling behavior instead of real divergence.
Next we investigate the scaling behavior of the Poincare cycle of the most far-from-equilibrium state τ feq P , in which it is defined as the longest Poincare cycle.
When p = 1 2 , and g > g c , then n sp = N 2 , the most far-from-equilibrium state is at n = N (or n = 0), then The Poincare cycle of the most far-from-equilibrium τ feq P has the exponential form e αN . It also becomes "divergent" (see the argument above) at g = g c , but the scaling exponent α is finite and continuous across the transition point.
In the following, we are going to investigate the behavior of the Poincare cycle across the first-order phase transition. Suppose g ≪ g sp , there are two saddle points. When p < p c = 1 2 , x sp,+ ≃ 1 − (1 + ln p q )e g and x sp,− ≃ (1−ln p q )e g , the Poincare cycle of the equilibrium state τ eq P = τ P (n sp, When p > p c , x sp,+ ≃ 1 − (1 + ln q p )e g , x sp,− ≃ (1 − ln q p )e g , then It is interesting to notice that τ eq P ≃ √ The Poincare cycle of the equilibrium state is finite and continuous during first-order transition.
The most far-from-equilibrium state is at n = N ( 1 2 − ln( p q )e g ), then When p is around the transition point p c , in large N limit, τ feq P = π 2 N 1 2 exp[N ( |g| 4 −ln 2)]. At exactly p = p c , τ feq P is double its value. The Poincare cycle of the most far-from-equilibrium has still the exponential form e αN dependence, with a continuous exponent α across the first-order phase transition.
In summary, the Poincare cycles τ eq P and τ feq P have the √ N and e αN dependence, respectively. During second-order phase transition, both τ eq P and τ feq P behave divergent-like at the transition point. At first-order phase transition, the Poincare cycles are finite and continuous. Such a behavior of the Poincare cycle could be served as an indication of the nature of the phase transition VI. DURATION TIME When g ≪ g sp , the system will stay at the states |0 and |N . Suppose the system transits from |N to |0 , it should meet | N 2 during the evolution because n changes continuously (Here the continuity of n means n changes its value at most ±1 at each step).
Define τ D (n, 1) as the mean time for the system to evolve from | N 2 to |n at its first time, and then back | N 2 at its first time. When n = N , where the notation (m|p(s)|n) represents the probability that the state |m becomes |n at its first time after s steps. With the help of Eqs. (A.73-A.75), Eq. (40) becomes Since τ P ( N 2 ) ≫ τ P (N ) for g ≪ g sp , τ D (N, 1) = τ P ( N 2 ). By similar argument, τ D (0, 1) = τ P ( N 2 ). The above transition ( | N 2 → |n → | N 2 ) may occur k times consecutively. Define τ D (n, k) as its mean time, then Hence τ D (N, k) = τ D (0, k) = kτ P ( N 2 ). The duration time at state |N , τ D (N ), defined as the total time at which the system stays at |N before transits to |0 , The asymptotic form at large N limit becomes Similarly, the duration time at state |0 is and its asymptotic form There is a first-order phase transition as p varies. As p < p c , τ D (N ) > τ D (0) > 0. It means the state |N is preferable but |0 still survives. Upon increasing p, the ratio of the duration time of two states, τ D (N )/τ D (0), decreases. At p = p c , τ D (N ) = τ D (0). Further increasing p > p c , τ D (0) > τ D (N ) > 0. Such a behavior indicates a strong evidence of metastability during first-order phase transition.

VII. DISCUSSION
The order-of-magnitude determination of the Poincare cycle of the most far-from-equilibrium state was originally used to resolve the recurrence paradox. In macroscopic world, it is far beyond the time scale we can observe. If N is not large enough, in principle, the measurement of the Poincare cycle should be experimentally accessible. For example, in colloidal system, one can easily prepare the system of small particle number N . The interaction between the colloidal particles (g in our model) is also well controlled [29]. The probability of directed transport (p in our model) can be tuned by applying the electric field along the direction from the left to the right urn, and the particles are slightly charged. The standard way to solve the eigenproblem is the method of generating functions [30]. For g = 0, it was already known [5,6,31]. In the following, we briefly outline the solution.
For g = 0, Eq. (8) is reduced to n=−∞ φ n z n , if we extend φ n ≡ 0 for n < 0 and n > N , then The solution is up to an arbitrary proportional constant. Since f (z) is a polynomial in z by definition, N (2λ − 1) and 2N (1 − λ) have to be non-negative integers. Hence we get where m = 0, 1, 2, . . . , N are the numbers to label the eigenvalues. The corresponding eigenvectors of the component φ n (m) could be obtained by comparing the z n coefficient of f (z) in Eq. (A.49) with its definition, we have In particular, for λ N = 1, its corresponding eigenvector Multiply z l , sum over l, and make use of Eq.(A.49-A.50), we get which gives where Θ(x) is the step function. When n = N 2 , it be- . Hence λ N 2 = 1 2 , and the corresponding eigenvector is φ( N 2 ) = (0, . . . , 1, . . . , 0) T with the only non-vanishing component φ N 2 ( N 2 ) = 1 (Here we label this eigenstate by N 2 ). The matrix M is in block diagonal form. We first search for the eigenstates such that φ n = 0 for n ≥ N 2 , and further assume that φ n ≡ 0 for n < 0. Let f (z) ≡ N n=0 φ n z n = ∞ n=−∞ φ n z n , then The solution is Here we use the fact that A −1 N k is independent of k, and we label λ N = 1.
The mean time from the state |m to the state |n at its first time is defined as Note that the mean time is independent of the initial state |m . The Poincare cycle τ P (n), defined as τ (n → n), also shares the same result,