# Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models

Cyril Banderier, Markus Kuba, Stephan Wagner, Michael Wallner

► To cite this version:

Cyril Banderier, Markus Kuba, Stephan Wagner, Michael Wallner. Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models. Leibniz International Proceedings in Informationics, 2024, 35th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (AofA 2024), 302, pp.7:1-7:18. 10.4230/LIPIcs.AofA.2024.7. hal-04654658

HAL Id: hal-04654658

https://hal.science/hal-04654658v1

Submitted on 19 Jul 2024

**HAL** is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire **HAL**, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Composition Schemes: *q*-Enumerations and Phase Transitions in Gibbs Models

Cyril Banderier ⚙️ ID

Laboratoire d'Informatique de Paris Nord, Université Sorbonne Paris Nord, Villetaneuse, France

Markus Kuba ⚙️ ID

Department Applied Mathematics & Physics, University of Applied Sciences - Technikum Wien, Austria

Stephan Wagner ⚙️ ID

Institute of Discrete Mathematics, TU Graz, Austria
Department of Mathematics, Uppsala Universitet, Sweden

Michael Wallner ⚙️ ID

Institut für Diskrete Mathematik und Geometrie, TU Wien, Austria

## Abstract

Composition schemes are ubiquitous in combinatorics, statistical mechanics and probability theory. We give a unifying explanation to various phenomena observed in the combinatorial and statistical physics literature in the context of *q*-enumeration (this is a model where objects with a parameter of value *k* have a Gibbs measure/Boltzmann weight *q*^*k*). For structures enumerated by a composition scheme, we prove a phase transition for any parameter having such a Gibbs measure: for a critical value *q* = *q*<sub>c</sub>, the limit law of the parameter is a two-parameter Mittag-Leffler distribution, while it is Gaussian in the supercritical regime (*q* > *q*<sub>c</sub>), and it is a Boltzmann distribution in the subcritical regime (*0* < *q* < *q*<sub>c</sub>). We apply our results to fundamental statistics of lattice paths and quarter-plane walks. We also explain previously observed limit laws for pattern-restricted permutations, and a phenomenon uncovered by Krattenthaler for the wall contacts in watermelons.

**2012 ACM Subject Classification** Mathematics of computing → Generating functions; Mathematics of computing → Enumeration; Mathematics of computing → Distribution functions

**Keywords and phrases** Composition schemes, *q*-enumeration, generating functions, Gibbs distribution, phase transitions, limit laws, Mittag-Leffler distribution, chi distribution, Boltzmann distribution

**Digital Object Identifier** 10.4230/LIPIcs.AofA.2024.7

**Related Version** arXiv version: https://arxiv.org/abs/2311.17226

**Funding** *Cyril Banderier:* supported by the French-Austrian PHC Amadeus project "Asymptotic behaviour of combinatorial structures".

*Stephan Wagner:* supported by the Swedish research council (VR), grant 2022-04030.

*Michael Wallner:* supported by the Austrian Science Fund (FWF): P 34142 and OeAD WTZ project FR 01/2023.

**Acknowledgements** The second author warmly thanks Thomas Feierl for many discussions about watermelons and Paul Schreivogl for discussions on partition functions. We also thank Christian Krattenthaler for drawing our attention to the open problem of the phase transition of contacts in watermelons, and the two referees for their feedback. Last but not least, we are pleased to dedicate this excursion into the realm of composition schemes and limit laws to one of the greatest experts of this realm, namely Michael Drmota, at the occasion of his 60th birthday!

<figure><img src="image_2.png" /></figure>

© Cyril Banderier, Markus Kuba, Stephan Wagner, and Michael Wallner;

licensed under Creative Commons License CC-BY 4.0

35th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (AofA 2024).

Editors: Cécile Mailler and Sebastian Wild; Article No. 7; pp. 7:1–7:18

<figure><img src="image_3.png" /></figure>

LIPICS

Leibniz International Proceedings in Informatics

Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany
# 1 Introduction

## 1.1 q-enumeration and Gibbs distributions

Let $\mathcal{T}$ be a family of combinatorial objects, let $|\cdot|$ denote the size of objects, and let $\mathcal{X}: \mathcal{T} \to \mathbb{N}$ be a statistic defined on $\mathcal{T}$. The statistic $\mathcal{X}$ on objects of $\mathcal{T}$ of size $n$ can be encoded by the sum

$$f_n(q) = \sum_{T \in \mathcal{T} : |T| = n} q^{\mathcal{X}(T)}. \qquad (1)$$

This sum reduces for $q = 1$ to the total number $f_n(1) = f_n$ of objects of size $n$. In combinatorics, for any given $q \in \mathbb{R}$, it is called the *q-enumeration* of $\mathcal{T}$ of size $n$ with respect to $\mathcal{X}$ (see, e.g., [1, 31]). In the language of statistical mechanics, $f_n(q)$ is a partition function with Boltzmann weight $q$. The bivariate generating function $F(z, q)$ is then defined as

$$F(z, q) = \sum_{T \in \mathcal{T}} z^{|T|} q^{\mathcal{X}(T)} = \sum_{n \ge 0} f_n(q) z^n = \sum_{n \ge 0} \sum_{k \ge 0} f_{n,k} z^n q^k. \qquad (2)$$

Here $f_{n,k}$ denotes the number of objects of $\mathcal{T}$ of size $n$ for which $\mathcal{X}$ equals $k$. It is usual to associate with the statistic $\mathcal{X}$ the random variables $X_n$, $n \ge 1$, defined as

$$\mathbb{P}(X_n = k) = \frac{f_{n,k}}{f_n} = \frac{[q^k]f_n(q)}{f_n(1)} = \frac{[z^n q^k]F(z,q)}{[z^n]F(z,1)}, \qquad (3)$$

such that each object from $\mathcal{T}$ of size $n$ is equally likely. The associated probability generating function is given by $\mathbb{E}(q^{X_n}) = \frac{[z^n]F(z,q)}{[z^n]F(z,1)}$. In Equation (3), the reader is probably used to consider $q$ as a formal variable, but in this work, like in statistical mechanics, we shall consider $q$ as an adjustable parameter (weight $\in \mathbb{R}_+$) of the underlying combinatorial and physical structures. This is also the spirit of the Boltzmann sampling method [18], where $q$ is tuned to minimize the number of rejection steps in the sampling algorithm.

More precisely, in this article, we put a Gibbs measure on the statistic $\mathcal{X}$; that is, one has the following probabilistic model.

**► Definition 1 (Gibbs distribution).** Let a family $\mathcal{T}$ of combinatorial objects and a statistic $\mathcal{X}: \mathcal{T} \to \mathbb{N}$ be given. For real $q > 0$, the Gibbs distribution of this statistic is the law of the random variable $X_n(q)$ with probability mass function

$$\mathbb{P}(X_n(q) = k) = \frac{f_{n,k} q^k}{f_n(q)}, \quad k \ge 0.$$

In terms of the probability generating function $p(v) = \mathbb{E}(v^{X_n(1)}), we have \mathbb{E}(v^{X_n(q)}) = \frac{p(vq)}{p(q)}$.

A well-known example in probability theory is the Mallows distribution [36] on permutations with respect to the inversion statistic.

In many applications, one is interested in the limit distribution of $X_n(q)$, which depends on the value of $q > 0$; see, e.g., [9, 11, 12, 14, 33, 34, 37, 40]. Let us pinpoint the result of Krattenthaler [33], who uncovered a phase transition in the normalized mean number of wall contacts at $q = 2$ in watermelons. Using methods from analytic combinatorics, we will show that similar phase transitions naturally occur in a great many instances, not only with respect to the expectation but also for the *limit laws*. We will use the framework of composition schemes, which often provide a direct and unifying way to explain why phase transitions occur [5, 6, 25]. In Section 2, we establish in which way the phase transitions in the Gibbs model depend on the value of $q$. Particular instances of similar phenomena have been observed in [13, 43]. We give further examples in Sections 3 and 4.
## 1.2 Composition schemes and Gibbs distributions

Functional composition schemes such as $F(z) = G(H(z))$ are of great importance in combinatorics [5, 6, 25] and probability theory [39]. The main focus is to analyse probabilistic properties of compositions like

$$F(z, u) = G(uH(z)) \qquad (4)$$

as a multitude of parameters $\mathcal{X}$ can be modelled in this way. Here $u$ marks the so-called size of the core, i.e., the involved $G$-component; see [5, 6, 25]. The distribution of the corresponding random variable $X_n$ is then readily defined by

$$\mathbb{P}(X_n = k) = \frac{[z^n u^k] F(z, u)}{[z^n] F(z, 1)}.$$

Structurally, such schemes are at the heart of many fascinating phase transition phenomena (analytically corresponding, e.g., to coalescing saddle points or to confluence of singularities), related to the Gibbs measure in statistical physics and probability theory [39].

First, we relate composition schemes to $q$-enumeration.

**► Lemma 2 (Composition schemes and Gibbs distributions).** Let a combinatorial statistic $\mathcal{X}$ with bivariate generating function $F(z, u)$ be given. Then, for real $q > 0$ the Gibbs distribution of $\mathcal{X}$ has a probability mass function given in terms of $F$ by

$$\mathbb{P}(X_n(q) = k) = \frac{[z^n u^k] F(z, qu)}{[z^n] F(z, q)}.$$

<figure><img src="image_4.png" /><figcaption>**Figure 1** Under the Gibbs model, we get different limit distributions for the random variable $X_n(q)$ associated with statistics counted by a composition scheme: from left to right, Boltzmann (e.g., the negative binomial), Mittag-Leffler (e.g., Rayleigh), chi (e.g., half-normal), Gaussian. We establish their universality in the next sections.</figcaption></figure>

In many (combinatorial) applications of composition schemes, the following assumptions hold [6]: all involved generating functions $G(z)$, $H(z)$, and $F(z)$ have nonnegative coefficients and aperiodic support, are analytic in a $\Delta$-domain with a finite radius of convergence $\rho_F$ and possess singular expansions of the form

$$F(z) = P\left(1 - \frac{z}{\rho_F}\right) + c_F \cdot \left(1 - \frac{z}{\rho_F}\right)^{\lambda_F} (1 + o(1)), \qquad (5)$$

where $\lambda_F \in \mathbb{R}\{0, 1, 2, \dots\}$ is called the singular exponent (at $z = \rho_F$), and where $P(x) \in \mathbb{C}[x]$ is a polynomial (of degree $\ge 1$ for $\lambda_F > 1$, of degree 0 for $0 < \lambda_F < 1$, and $P = 0$ for $\lambda_F < 0$). Then, singularity analysis [25] can often be used to compute the asymptotics of the coefficients. Note that the sign of the constant $c_F$ depends on the Puiseux exponent $\lambda_F$; see [6, Equation (8)].
7:4 Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models

For the reader's convenience, we recall the classical terminology for composition schemes in the following definition.

**Definition 3 (Classification of composition schemes).** Let $\tau_H = H(\rho_H)$. A composition scheme $F(z) = G(H(z))$ is called subcritical if it satisfies $\tau_H < \rho_G$, critical if it satisfies $\tau_H = \rho_G$, and supercritical if it satisfies $\tau_H > \rho_G$.

We note that each individual class of critical schemes leads to very diverse combinatorial and probabilistic phenomena [3, 5, 6, 25, 39].

One typical example of a combinatorial construction of shape $F(z, u) = G(uH(z))$ is given by the sequence construction.

**Example 4 (Sequence of objects).** Given a combinatorial structure $\mathcal{H}$, let $\mathcal{F} = \text{SEQ}(\mathcal{H})$. Using the variable $u$ to encode the core size (i.e., the number of $\mathcal{H}$ components), one has $F(z, u) = 1/(1-uH(z))$. This is a composition scheme with $G(z) = 1/(1-z)$, with $\rho_G = 1$ and $\lambda_G = -1$.

We observe that the parameter $q$ can thus directly influence the nature of the underlying singular structure when the total mass (obtained by $u = 1$) changes from $[z^n]F(z, 1)$ to $[z^n]F(z, q)$. Let us make this more precise for the following class of functions that includes the sequence construction.

**Lemma 5 (Nature and asymptotics of q-enumerated composition schemes).** Let a composition scheme $F(z, u) = G(uH(z))$ with singular exponents $\lambda_G < 0$ and $0 < \lambda_H < 1$ be given. Let $q_c := \frac{\rho_G}{\tau_H} = \frac{\rho_G}{H(\rho_H)} > 0$. The nature of the scheme then splits into three different regimes:

- for $0 < q < q_c$, the scheme is subcritical;

- for $q = q_c$, the scheme is critical;

- for $q > q_c$, the scheme is supercritical.

Accordingly, if one imposes a Gibbs measure on the number of $\mathcal{H}$-components, this impacts the asymptotics of their q-enumeration $f_n(q)$ as follows:

$$f_n(q) \sim \begin{cases} \frac{c_H q G'(q \tau_H)}{\Gamma(-\lambda_H)} \rho_H^{-n} n^{-\lambda_H - 1}, & \text{for } 0 < q < q_c, \\ c_G \left(-\frac{c_H}{\tau_H}\right)^{\lambda_G} \frac{1}{\Gamma(-\lambda_H \lambda_G)} \rho_H^{-n} n^{-\lambda_H \lambda_G - 1}, & \text{for } q = q_c, \\ c_G \left(\frac{q \rho H'(\rho)}{\rho_G}\right)^{\lambda_G} \frac{1}{\Gamma(-\lambda_G)} \rho^{-n} n^{-\lambda_G - 1}, & \text{for } q > q_c, \end{cases}$$

where, in the last case, $\rho$ is the unique solution of $qH(\rho) = \rho_G$ in the interval $(0, \rho_H)$.

**Proof of Lemma 5.** First, we turn to the nature of the scheme $F_q(z) = G(qH(z))$. Since $F_q(z)$ has nonnegative coefficients, Pringsheim's Theorem [25] implies that there is a singularity on the real axis. Further, $H(z)$ is monotonically increasing on the real axis from 0 to $\rho_H$, where it attains the value $\tau_H = H(\rho_H) < \infty$. Thus, the nature of $F_q(z)$ depends on the relation between the singularity $\rho_G$ of $G(z)$ and $q\tau_H$ as claimed. Next, we look at the singular expansions. We start with those of $G(z)$ and $H(z)$. By the assumptions on $\lambda_G$ and $\lambda_H$ we have

$$G(z) \sim c_G \left(1 - \frac{z}{\rho_G}\right)^{\lambda_G} \quad \text{and} \quad H(z) \sim \tau_H + c_H \left(1 - \frac{z}{\rho_H}\right)^{\lambda_H}. \qquad (6)$$
In the subcritical regime $0 < q < \frac{\rho_G}{\tau_H}$, the outer function $G(z)$ is analytic at $q\tau_H$ and we combine its expansion with the singular expansion of $H(z)$ around $z = \rho_H$ to obtain

$$ 
\begin{aligned}
F_q(z) &= G(q\tau_H) + G'(q\tau_H)(qH(z) - q\tau_H)(1 + o(1)) \\
&\sim G(q\tau_H) + c_H q G'(q\tau_H) \left(1 - \frac{z}{\rho_H}\right)^{\lambda_H}.
\end{aligned}
$$

Basic singularity analysis [25] provides the stated expansion.

For the critical regime $q = \frac{\rho_G}{\tau_H}$ we obtain

$$ F_q(z) \sim c_G \left( 1 - q \frac{\tau_H}{\rho_G} - q \frac{c_H}{\rho_G} \left( 1 - \frac{z}{\rho_H} \right)^{\lambda_H} \right)^{\lambda_G} = c_G \left( - \frac{c_H}{\tau_H} \right)^{\lambda_G} \left( 1 - \frac{z}{\rho_H} \right)^{\lambda_H \lambda_G}, $$

which leads to the desired result.

Finally, in the supercritical regime $q > \frac{\rho_G}{\tau_H}$, there exists a unique $0 < \rho < \rho_H$ such that $qH(\rho) = \rho_G$. As $\rho < \rho_G$, we may expand $H(z)$ around $\rho$. This leads to

$$ qH(z) = qH(\rho) + qH'(\rho)(z - \rho) + \mathcal{O}((z - \rho)^2). $$

Note that by the positivity of the coefficients of $H$ one has $H'(\rho) \neq 0$. Thus, we have

$$ F_q(z) \sim c_G \left( \frac{q \rho H'(\rho)}{\rho_G} \right)^{\lambda_G} \left( 1 - \frac{z}{\rho} \right)^{\lambda_G}, $$

and the asymptotic formula for $f_n(q)$ follows by singularity analysis.

## 2 Main theorem: Gibbs models and phase transitions with respect to q

The following result is our main theorem. It describes the dependency of the limit law on the parameter $q$. In this extended abstract, we present only the case of sequence-like schemes.

**► Theorem 6 (Gibbs distribution and phase transitions of sequence-like schemes).** Let a composition scheme $F(z, u) = G(uH(z))$, with singular exponents $\lambda_G < 0$ and $0 < \lambda_H < 1$, be given. Then, the Gibbs distribution of $X_n = X_n(q)$ associated with $F(z, qv)$ has the following limit laws and phase transition diagram that depend on $q_c = \frac{\rho_G}{\tau_H}$:

<table><thead><tr><th>Parameter q</th><th>0 &lt; q &lt; q<sub>c</sub></th><th>q = q<sub>c</sub></th><th>q &gt; q<sub>c</sub></th></tr></thead><tbody><tr><td>Regime</td><td>subcritical</td><td>critical</td><td>supercritical</td></tr><tr><td>Singularity</td><td>ρ<sub>H</sub></td><td>ρ<sub>H</sub></td><td>ρ &lt; ρ<sub>H</sub></td></tr><tr><td>Singular exponent</td><td>Z<sup>λ<sub>H</sub></sup></td><td>Z<sup>λ<sub>G</sub>λ<sub>H</sub></sup></td><td>Z<sup>λ<sub>G</sub></sup></td></tr><tr><td rowspan="2">Limit law</td><td>discrete</td><td>continuous</td><td>continuous</td></tr><tr><td>(Boltzmann)</td><td>(Mittag-Leffler)</td><td>(Gaussian)</td></tr></tbody></table>

- In the subcritical regime $0 < q < q_c$, the random variable $X_n - 1$ converges to a discrete distribution, a Boltzmann distribution $B_{G'}(q\tau_H)$ with explicit probability generating function given by:

$$ \mathbb{P}(X_n - 1 = k) \rightarrow [v^k] \frac{G'(vq\tau_H)}{G'(q\tau_H)}. $$

In particular, if $G(z) = \frac{1}{(1-z)^m}$, the limit law of $X_n - 1$ is a negative binomial distribution $\text{NegBin}(m+1, 1-q\tau_H)$, where $X \sim \text{NegBin}(r, p)$ is defined by $\mathbb{P}(X = k) = \binom{k+r-1}{k} p^r (1-p)^k$ for $k \ge 0$.
■ In the critical regime $q = q_c$, the random variable $X_n/n^{\lambda_H}$ converges in distribution:

$$ \frac{-c_H X_n}{\tau_H n^{\lambda_H}} \xrightarrow{\mathcal{L}} X, $$

where the random variable $X$ follows the two-parameter Mittag-Leffler distribution $\text{ML}(\alpha, \beta)$ (with $\alpha := \lambda_H$ and $\beta := -\lambda_G\lambda_H$) that is associated with the density $f_X(x) = \frac{\Gamma(\beta+1)}{\alpha\Gamma(\frac{\alpha}{2}+1)} \sum_{n=1}^{\infty} \frac{(-1)^n}{n!\Gamma(-n\alpha)} x^{n+\beta/\alpha-1}$ determined by its moments $\mathbb{E}(X^r) = \frac{\Gamma(\beta)\Gamma(r+\beta/\alpha)}{\Gamma(\beta/\alpha)\Gamma(\alpha r+\beta)}$.

In particular, for $\lambda_G = -1$ and $\lambda_H = \frac{1}{2}$, $X$ follows the Rayleigh distribution $\mathcal{R}(\sqrt{2})$, where $X \sim \mathcal{R}(\sigma)$ is defined by the density $\frac{x}{\sigma^2}e^{-x^2/(2\sigma^2)}$ for $x \ge 0$.

■ In the supercritical regime $q > q_c$, the centred and normalized random variable $(X_n - \mu_n)/\sigma_n$ converges in distribution to a standard normal distribution $N(0, 1)$, where mean $\mu_n$ and variance $\sigma_n^2$ are both of order $n$: we have, with $\rho = \rho(q)$ given by $qH(\rho) = \rho_G$,

$$ \mu_n \sim \frac{\rho_G}{q\rho H'(\rho)} \cdot n, \quad \sigma_n^2 \sim \left( \frac{\rho_G^2}{q^2\rho^2 H'(\rho)^2} - \frac{\rho_G}{q\rho H'(\rho)} + \frac{\rho_G^2 H''(\rho)}{q^2\rho H'(\rho)^3} \right) \cdot n. $$

In particular, the expected value of $X_n$ is for $n \to \infty$ asymptotically equivalent to

$$ \mathbb{E}(X_n) \sim \begin{cases} 1 + \frac{q\tau_H G''(q\tau_H)}{G'(q\tau_H)}, & \text{for } 0 < q < q_c, \\ \frac{\lambda_G \tau_H \Gamma(-\lambda_G \lambda_H)}{c_H \Gamma((1-\lambda_G)\lambda_H)} \cdot n^{\lambda_H}, & \text{for } q = q_c, \\ \frac{\rho_G}{q\rho H'(\rho)} \cdot n, & \text{for } q > q_c. \end{cases} $$

**Proof of Theorem 6 (Sketch).** For $q < q_c$ we are in the subcritical regime and follow the proof of Lemma 5. We build on the results of [6, 25]. We expand $F(z, qv)$ for $0 < v < 1$ to obtain $F(z, qv) \sim G(qv\tau_H) + c_H qv G'(qv\tau_H) (1 - \frac{z}{\rho_H})^{\lambda_H}$. This implies that the probability generating function satisfies

$$ \lim_{n \to \infty} \mathbb{E}(v^{X_n(q)}) = \lim_{n \to \infty} \frac{[z^n]F(z, qv)}{f_n(q)} = \frac{vG'(qv\tau_H)}{G'(q\tau_H)}, $$

leading to a Boltzmann distribution $B_G'(qv_H)$. In particular, for $G(z) = 1/(1-z)$ we have $G'(z) = 1/(1-z)^2$, leading to a negative binomial distribution.

For $q = q_c$ we are at the critical value and we thus apply [6, Theorem 4.1] with $\lambda_G < 0$ and $0 < \lambda_H < 1$. This yields the stated limit law, as discussed in [6, Remark 4.2].

In the supercritical regime for $q > q_c$, our claim results from the approach of Bender [25, Propositions IX.6 and IX.7]. The singularity $\rho = \rho(qv)$ becomes an analytic function of $v$ while the nature of the singularity remains unchanged for $v$ in a sufficiently small neighbourhood of 1. In particular, the expected value, the variance, and the normal limit law follow by an application of Hwang's quasi-power theorem [25, 32]. ▲

It is worth pointing out that the constant in the asymptotics of $\sigma_n^2$ in the supercritical case is always strictly positive. Thus degenerate limit laws are not possible. This is shown in the following. The proof follows the lines of [35, Proposition 23].

► **Proposition 7 (Positivity of the variance constant).** In the supercritical regime $q > q_c$ of Theorem 6, we have

$$ \frac{\rho_G^2}{q^2 \rho^2 H'(\rho)^2} - \frac{\rho_G}{q \rho H'(\rho)} + \frac{\rho_G^2 H''(\rho)}{q^2 \rho H'(\rho)^3} > 0, $$

thus $\frac{\sigma_n^2}{n}$ converges to a constant that is strictly positive.
<figure><img src="image_5.png" /><figcaption>Figure 2 The distribution (with the histogram interpolated to a curve) of returns to 0 in Motzkin excursions (as analysed in Section 3), for walks of length $n = 100$, under the Gibbs measure of weight $q$. While the distribution for a finite $n$ evolves continuously when one increases $q$, it exhibits a phase transition when one increases $n$ (at $q_c = 3/2$ for this example). As stated in Theorem 6, it converges to a negative binomial distribution for $q < q_c$, to a Rayleigh distribution for $q = q_c$, and to a Gaussian distribution for $q > q_c$.</figcaption></figure>

**Proof.** For $v$ in a suitably small neighbourhood of 1, the singularity $\rho = \rho(qv)$ of $F(z, qv)$ becomes an analytic function of $v$ as mentioned in the proof of Theorem 6. It is implicitly determined by $qvH(\rho(qv)) = \rho_G$. Singularity analysis gives us the asymptotic formula

$$f_n(qv) = [z^n]F(z, qv) \sim c_G \left( \frac{qv\rho(qv)H'(\rho(qv))}{\rho_G} \right)^{\lambda_G} \frac{1}{\Gamma(-\lambda_G)} \rho(qv)^{-n} n^{-\lambda_G-1};$$

see Lemma 5. For the moment generating function of the variable $X_n(q)$, this means that

$$\mathbb{E}(e^{tX_n(q)}) = \frac{f_n(qe^t)}{f_n(q)} \sim \exp(a(t)n + b(t)), \qquad (7)$$

uniformly for $t$ in a suitable neighbourhood of 0, where

$$a(t) = \log \rho(q) - \log \rho(qe^t), \quad b(t) = \lambda_G \left( t + \log \frac{\rho(qe^t)H'(\rho(qe^t))}{\rho(q)H'(\rho(q))} \right).$$

Note that $a(0) = b(0) = 0$ and $a'(0) = -\frac{q\rho'(q)}{\rho(q)} = \frac{\rho_G}{q\rho(q)H'(\rho(q))}$ (the latter identity follows by implicit differentiation from $qH(\rho(q)) = \rho_G$). Now let $k$ be the smallest positive integer greater than or equal to 2 such that $a^{(k)}(0) \neq 0$, provided that such an integer exists. Substitute $t = sn^{-1/k}$ in (7) and apply the Taylor expansion of $a(t)$ and $b(t)$ around 0 to obtain

$$\mathbb{E}\left(\exp\left(\frac{s(X_n(q) - a'(0)n)}{n^{1/k}}\right)\right) = \exp\left(\frac{a^{(k)}(0)}{k!}s^k + o(1)\right).$$

By Lévy's continuity theorem, this would mean that $\frac{X_n(q)-a'(0)n}{n^{1/k}}$ converges in distribution to a random variable $X$ with moment generating function

$$M(s) = \mathbb{E}(e^{sX}) = \exp\left(\frac{a^{(k)}(0)}{k!}s^k\right).$$

However, such a random variable can only exist for $k = 2$: otherwise, it would have second moment 0, thus be almost surely equal to 0 and have moment generating function $M(s) = 1$.
7:8 Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models

If $k = 2$, then

$$
\begin{align*}
0 \neq a''(0) &= -\frac{q^2 \rho''(q)}{\rho(q)} + \frac{q^2 \rho'(q)^2}{\rho(q)^2} - \frac{q \rho'(q)}{\rho(q)} \\
&= \frac{\rho_G^2}{q^2 \rho(q)^2 H'(\rho(q))^2} - \frac{\rho_G}{q \rho(q) H'(\rho(q))} + \frac{\rho_G^2 H''(\rho(q))}{q^2 \rho(q) H'(\rho(q))^3},
\end{align*}
$$

and we are done (here, implicit differentiation of $qH(\rho(q)) = \rho_G$ is used again in the second step). It only remains to exclude the possibility that there is no $k \ge 2$ such that $a^{(k)}(0) \ne 0$. Then $a(t)$ must be a linear function: $a(t) = \kappa t$ for some constant $\kappa$, thus $\rho(qe^t) = \rho(q)e^{-\kappa t}$. This would have to hold for $t$ in a neighbourhood of 0. But in view of the implicit equation $qe^tH(\rho(qe^t)) = \rho_G$, this would imply that the function $H$ is given by $H(z) = \frac{\rho_G}{q}(z/\rho(q))^{1/k}$, contradicting our assumptions.

$\quad$

3 Applications: phase transitions from negative binomial to Rayleigh to Gaussian

We start our list of applications with the case of fixed-point-biased permutations avoiding a pattern of length three, whose asymptotic behaviour was recently considered in [13]. Then we consider several instructive examples from the theory of lattice paths, namely the returns to zero in Dyck bridges and Dyck excursions, as well as in Motzkin bridges and Motzkin excursions. Thereby, we add to the existing classical results (that is, for the uniform distribution) the phase transitions stemming from q-enumeration (that is, for the Gibbs distribution on the parameter). We also consider the number of boundary interactions in some quarter-plane walk models, and the number of contacts between two paths in some watermelon models.

3.1 Fixed-point-biased permutations avoiding a pattern of length three

Let $S_n(p)$ be the set of permutations of $1, 2, \dots, n$ that avoid a given pattern $p$ (where,
as usual, the elements of the pattern $p$ need not be contiguous in the permutation; see
Figure 3). The generating function counting the statistic $\text{fp}(\sigma)$ (number of fixed points) of
such permutations for the pattern 321 was obtained by Vella [41, Theorem 2.13] and for the
other two patterns 132 and 213 by Elizalde [19, Theorem 3.5]. It is in all three cases equal to

$$
F(z, u) = 1 + \sum_{n=1}^{\infty} \sum_{\sigma \in S_n(p)} u^{\text{fp}(\sigma)} z^n = \frac{2}{1 + 2(1-u)z + \sqrt{1-4z}}.
$$

<figure><img src="image_6.png" /><figcaption>■ **Figure 3** An example of a 321-avoiding permutation of length 12 with 3 fixed points marked by red dots. (A permutation $\pi = (\pi_1, \dots, \pi_n)$ avoids the pattern $p = 321$ if there is no triplet $1 \le i < j < k \le n$ such that $\pi_k < \pi_j < \pi_i$.)</figcaption></figure>
Later, Chelikavada and Panzo [13] used this generating function to establish a phase transition which we rederive now.

**▶ Theorem 8 (Phase transition for fixed-point-biased permutations).** The limit Gibbs distribution of the fixed-point statistic in permutations avoiding any given pattern $p \in \{132, 321, 213\}$ has a phase transition with critical value $q_c = 3$:

<table><thead><tr><th>Parameter q</th><th>0 &lt; q &lt; 3</th><th>q = 3</th><th>q &gt; 3</th></tr></thead><tbody><tr><td>Limit law of X<sub>n</sub>(q)</td><td>Negative binomial<br>NegBin(2, 1 - q/3)</td><td>Rayleigh<br>R(√2)</td><td>Gaussian<br>N(0, 1)</td></tr></tbody></table>

**Proof.** In order to deduce the phase transitions from Theorem 6, we write $F(z, u)$ as a sequence of components $H(z)$ marked with $u$

$$F(z, u) = \frac{H(z)}{z} \cdot \frac{1}{1 - uH(z)} = \frac{1}{uz} \cdot \frac{1}{1 - uH(z)} - \frac{1}{uz}, \quad \text{where} \quad H(z) = \frac{2z}{1 + 2z + \sqrt{1 - 4z}}.$$

Here, $F(z, u)$ is not in the shape of the composition scheme (4), but very close. For the limit law, these perturbing factors are irrelevant, since by Lemma 2 one has for $n, k \ge 0$

$$\mathbb{P}(X_n(q) = k) = \frac{[z^n u^k] F(z, qu)}{[z^n] F(z, qu)} = \frac{[z^{n+1} u^{k+1}] G(uqH(z))}{[z^{n+1}] G(uqH(z))}, \quad \text{where} \quad G(z) = \frac{1}{1-z}.$$

Thus, one has $\rho_G = 1$, $\rho_H = \frac{1}{4}$ and $\tau_H = H(\rho_H) = \frac{1}{3}$. Theorem 6 then implies the phase transition at $q_c = \rho_G/\tau_H = 3$ with a Boltzmann distribution (simplifying here to a NegBin), a Mittag-Leffler distribution (simplifying here to a Rayleigh distribution since $\lambda_H = \frac{1}{2}$), and a Gaussian distribution. ◀

## 3.2 Returns to zero in Dyck and Motzkin paths

We consider two classical directed models: Dyck and Motzkin paths. Dyck paths consist of the steps up (1, 1) and down (1, -1), while Motzkin paths allow additionally some horizontal steps (1, 0). They are called *bridges* if they start at (0, 0) and end at (2n, 0), and *excursions* if it is additionally required that they never cross the x-axis.

The random variable $X_n$, counting the number of returns to the x-axis in a random excursion and bridge of size $2n$, is a well-studied object [4, 25], leading for excursions to a negative binomial limit law for $X_n$ and leading for bridges to a Rayleigh limit law for $X_n/\sqrt{n}$. Note that the root degree in plane trees behaves the same due to a classical bijection between plane trees and Dyck excursions. What happens when we give a Gibbs weight to the number of returns? The following theorem answers this question.

**▶ Theorem 9 (q-enumerations: limit laws for returns to zero).** Under the Gibbs model, the number $X_n = X_n(q)$ of returns to zero in Dyck excursions and bridges of length $2n$, in Motzkin excursions and in bridges of length $n$, has, for $n \to +\infty$, a phase transition at $q_c$ and follows, after rescaling, either a negative binomial, Rayleigh, or Gaussian distribution.

<table><thead><tr><th>Parameter q</th><th>Limit law</th></tr></thead><tbody><tr><td>0 &lt; q &lt; q<sub>c</sub></td><td>X<sub>n</sub> - 1 &rarr; NegBin(2, 1 - qτ<sub>H</sub>)</td></tr><tr><td>q = q<sub>c</sub></td><td>-c<sub>H</sub> X<sub>n</sub>/√n &rarr; Rayleigh(√2)</td></tr><tr><td>q &gt; q<sub>c</sub></td><td>X<sub>n</sub> - μ·n/σ·√n &rarr; N(0, 1)</td></tr></tbody></table>

$$q_c = \begin{cases} 2 & \text{for Dyck excursions,} \\ 1 & \text{for Dyck bridges,} \\ \frac{3}{2} & \text{for Motzkin excursions,} \\ 1 & \text{for Motzkin bridges.} \end{cases}$$

Here, $\tau_H$ is $\frac{1}{2}$, $1$, $\frac{2}{3}$, $1$, and $c_H$ is $-\frac{1}{2}$, $-1$, $-\frac{1}{\sqrt{3}}$, $-\frac{2}{\sqrt{3}}$ for Dyck excursions, Dyck bridges, Motzkin excursions and Motzkin bridges, respectively.
7:10 Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models

**Proof.** Cutting each time the path returns to the x-axis [25, p. 636], one directly sees that the generating functions $D(z)$ and $B_D(z)$ of Dyck excursions and bridges, respectively, satisfy the relations

$$D(z) = \frac{1}{1 - z^2 D(z)} = \frac{1 - \sqrt{1 - 4z^2}}{2z^2} \quad \text{and} \quad B_D(z) = \frac{1}{1 - 2z^2 D(z)} = \frac{1}{\sqrt{1 - 4z^2}}.$$

The generating functions $D(z, u)$ and $B_D(z, u)$ of Dyck excursions and bridges marking the number of returns are

$$D(z, u) = \frac{1}{1 - z^2 u D(z)} \quad \text{and} \quad B_D(z, u) = \frac{1}{1 - 2z^2 u D(z)}. \qquad (8)$$

In both cases we recognize a composition scheme (4) with $G(z) = \frac{1}{1-z}$ and $H(z) = z^2 D(z)$ for excursions and $H(z) = 2z^2 D(z)$ for bridges. Therefore, we can readily apply Theorem 6. Motzkin excursions have the generating function

$$M(z) = \frac{1 - z - \sqrt{(1 + z)(1 - 3z)}}{2z^2},$$

with dominant singularity $\rho = \frac{1}{3}$ [25]. With the same ideas as for Dyck paths, we directly get the bivariate generating functions $M(z, u)$ and $B_M(z, u)$ of excursions and bridges, respectively, as

$$M(z, u) = \frac{1}{1 - zu(1 + zM(z))} \quad \text{and} \quad B_M(z, u) = \frac{1}{1 - zu(1 + 2zM(z))}. \qquad (9)$$

Again, we recognize the composition scheme (4) with $G(z) = \frac{1}{1-z}$ and $H(z) = z(1 + zM(z))$ for excursions and $H(z) = z(1 + 2zM(z))$ for bridges. This leads again to similar phase transitions. ◀

**Remark 10 (Weighted paths).** Let $p_{-1}, p_0, p_1 \ge 0$ be the weights of the steps $(1, -1), (1, 0), (1, 1)$, respectively. The weight of a path is the product of its weights. Weighted Dyck excursions and bridges behave exactly as unweighted ones, as each path of length $2n$ has a weight $(p_{-1}p_1)^n$. However, weighted Motzkin excursions and bridges behave differently. With the same techniques it is easy to show that for weighted Motzkin excursions, the phase transition occurs at

$$q_c = \frac{p_0 + 2\sqrt{p_{-1}p_1}}{p_0 + \sqrt{p_{-1}p_1}} = 1 + \frac{1}{1 + \frac{p_0}{\sqrt{p_{-1}p_1}}} \in (1, 2].$$

Finally, for weighted Motzkin bridges the phase transition again always occurs at $q_c = 1$, because $\tau_H = 1$ is independent of the weights.

## 3.3 Boundary contacts for quarter-plane walks

A direct byproduct of our results are phase transitions for Hadamard models of quarter-plane walks. Beaton, Owczarek, and Rechnitzer [7] initiated the study of quarter-plane walks with wall interactions. We are interested in walks restricted to the quarter plane, starting and ending at the origin, and their interaction with the walls (that is, their number of contacts with x- or y-axis).
It turns out that in many models the generating functions are rather complicated [7], but for three families of walks called *Hadamard models*, the analysis of contacts can be done in a fairly simple way. Such models are enumerated by a *Hadamard product* of generating functions

$$A(z) \odot B(z) := \sum_{n \ge 0} a_n b_n z^n, \quad \text{where } A(z) = \sum_{n \ge 0} a_n z^n \quad \text{and} \quad B(z) = \sum_{n \ge 0} b_n z^n.$$

They correspond to the diagonal, diabolo, and king walk models with stepsets

<figure><img src="image_7.png" /></figure>

respectively (for the last two models, one has in fact a slight variant of the usual diabolo or king models: here we allow additionally the step (0,0), as indicated by the centre dot in the stepset representation). Walks of length $2n$ in the quarter plane that start and end at (0,0) decompose into two independent directed excursions of length $n$. Therefore, these models are in bijection with pairs of Dyck and Motzkin excursions. This is summarized in the following table, where $D(z, u)$ and $M(z, u)$ are the generating functions from (8) and (9), respectively.

<table><thead><tr><th>Model</th><th>Steps</th><th>Generating function Q(z, u<sub>1</sub>, u<sub>2</sub>)</th><th>Sequence Q<sub>2n</sub></th><th>OEIS</th></tr></thead><tbody><tr><td>Diagonal</td><td>☒</td><td>D(z, u<sub>1</sub>) ⊙ D(z, u<sub>2</sub>)</td><td>C<sub>n</sub> ⋅ C<sub>n</sub></td><td>A001246</td></tr><tr><td>Diabolo</td><td>☒</td><td>D(z, u<sub>1</sub>) ⊙ M(z, u<sub>2</sub>)</td><td>C<sub>n</sub> ⋅ M<sub>n</sub></td><td>A151362</td></tr><tr><td>King</td><td>※</td><td>M(z, u<sub>1</sub>) ⊙ M(z, u<sub>2</sub>)</td><td>M<sub>n</sub> ⋅ M<sub>n</sub></td><td>A133053</td></tr></tbody></table>

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /></figure>

<figure><img src="image_10.png" /></figure>

The limit laws for the number of wall interactions with the $x$-axis or $y$-axis depend on the particular values of the $q$-enumerations; compare with the results in Theorem 9. More precisely, we get the following proposition. By symmetry it also translates to $y$-axis contacts in the missing cases.

**Theorem 11 (Boundary interactions for some quarter-plane walks).** The number of $x$-axis contacts of diagonal walks and the number of $y$-axis contacts of diabolo walks follows the law of the $q$-enumeration of Dyck returns to 0. The number of $x$-axis contacts of diagonal, diabolo, and king walks follows the law of the $q$-enumeration of Motzkin returns to 0. Accordingly, the phase transitions are the same as in Theorem 9.

**Proof (sketch).** In the diagonal model, the generating function of the $x$-axis contacts is equal to $D(z, qu) \odot D(z)$. Therefore, by Lemma 2 we have

$$\mathbb{P}(X_n(q) = k) = \frac{[z^n u^k] D(z, qu) \odot D(z)}{[z^n] D(z, q) \odot D(z)} = \frac{[z^n u^k] D(z, qu)}{[z^n] D(z, q)}.$$

Thus, the result follows directly from Theorem 9. The other models follow in the same fashion. ◀

<figure><img src="image_11.png" /></figure>

**Remark 12 ($x$-axis plus $y$-axis contacts).** The law of the number of $x$-axis plus $y$-axis contacts is more involved, as it requires the study of the analytic behaviour of Hadamard products of the shape $(1-z)^a \odot (1-z)^b$. These products were studied by Fill, Flajolet, and Kapur, who gave the corresponding Puiseux expansions; see [23, Proposition 8]. Note that, as pinpointed in [23], the case $a+b$ integer requires the use of additional hypergeometric identities.
## 3.4 Friendly two-watermelons without wall: contacts and returns

We consider a pair of directed walkers with Dyck steps $(1, -1)$ and $(1, 1)$. The walkers start and end at the same point, may meet and share edges but not cross. Such walker configurations $W$ are also called friendly two-watermelons (see the related work of Roitner [38] and Krattenthaler, Guttmann, and Viennot [34]). We are interested in walks of length $n$ and the number of contacts $C$ of the two walkers. A contact in a two-watermelon is a point (not counting the starting point) where both paths occupy the same lattice point. (See Figure 4.)

**Theorem 13** (Phase transition for contacts in friendly two-watermelons). With the renormalizations of Theorem 6, the limit Gibbs distribution of the number of contacts in friendly two-watermelons has a phase transition with critical value $q_c = 4/3$:

<table><thead><tr><th>Parameter q</th><th>0 &lt; q &lt; <sup>4</sup>&frasl;<sub>3</sub></th><th>q = <sup>4</sup>&frasl;<sub>3</sub></th><th>q &gt; <sup>4</sup>&frasl;<sub>3</sub></th></tr></thead><tbody><tr><td>Limit law of X<sub>n</sub>(q)</td><td>Negative binomial<br>NegBin(2, 1 - <sup>3</sup>&frasl;<sub>4</sub>q)</td><td>Rayleigh<br>R(&radic;2)</td><td>Gaussian<br>N(0, 1)</td></tr></tbody></table>

**Proof.** Let $F(z, u)$ denote the bivariate generating function of friendly two-watermelons with respect to the number of contacts:

$$F(z, u) = \sum_{w \in W} z^{|w|} u^{C(w)}.$$

This generating function was determined by Roitner [38], using a reduction to weighted Motzkin paths. It is given by

$$F(z, u) = \frac{1}{1 - u(z^2 W(z) + 2z)}, \quad W(z) = \frac{1 - 2z - \sqrt{1 - 4z}}{2z^2}. \qquad (10)$$

Under the uniform distribution model, Roitner also obtained a discrete limit law for the parameter (number of contacts). We note in passing that closely related problems in families of osculating walkers have been considered before by Bousquet-Mélou [10]. Under the Gibbs distribution model, we recognize a composition scheme with $G(z) = 1/(1-z)$, $\rho_G = 1$, and $H(z) = z(zW(z) + 2)$ so that $\tau_H = \frac{3}{4}$. Therefore, Theorem 6 applies: we get the 3 phases, with the critical value $q_c = \frac{\rho_G}{\tau_H} = \frac{4}{3}$. ◀

<figure><img src="image_12.png" /><figcaption>■ **Figure 4** An example of a friendly two-watermelon without wall of length 24 with 8 contacts marked by red dots. Under the Gibbs model where such an object is given the weight $q^8$, the distribution of the number of contacts then depends on the value of $q$, according to the phase transition given in Theorem 13.</figcaption></figure>
# 4 Extensions to other constructions: new phase transitions from negative binomial to chi to Gaussian

It is appealing to extend Theorem 6 to even more general composition schemes such as

$$F(z, u) = M(z) \cdot G(uH(z)) \quad (11)$$

where an additional factor $M(z)$ appears. This extended scheme is of interest as it captures many classical combinatorial structures: some families of trees or lattice paths (meanders), Pólya urns, and other probabilistic processes like the Chinese restaurant model. In its critical phase, this scheme was recently analysed in [6] under the uniform distribution model for the associated combinatorial structures. This extends the work of pioneers like Bender, Flajolet, Soria, Drmota, Hwang, Gourdon [8, 16, 17, 26, 28, 32], later synthesized in [25].

In the long version of this article, we analyse this extended scheme under the Gibbs measure model, and we show that the phase transition for Gibbs distributions leads, in some cases, to the 3-parameter Mittag-Leffler distribution introduced in [6]. Further examples of combinatorial problems involving an extended scheme are the root degree in two-connected outerplanar graphs (see Drmota, Giménez, and Noy [15, Theorem 3.2]), the returns to zero in coloured walks, and the number of wall interactions in watermelons. We now analyse the phase transitions for these last two models.

## 4.1 Number of wall contacts in watermelons

An $m$-watermelon of length $2n$ consists of $m$ walkers moving from $(0, 2i - 2)$ to $(2n, 2i - 2)$, $1 \le i \le m$, where every walker may either take an up step $(1, 1)$ or a down step $(1, -1)$, but walkers are not allowed to occupy the same position (they are thus called *vicious*). One says that the watermelon has a wall if the $x$-axis serves as a barrier which the lowest walker may touch but not cross. (See Figure 5.) Watermelons were introduced by Fisher [24] for modelling wetting and melting. We refer the reader to the work of Krattenthaler, Guttmann, and Viennot [33, 34] or Feierl [20–22] for more results on watermelons and related problems.

<figure><img src="image_13.png" /><figcaption>Figure 5 A 3-watermelon (with a wall) of length 24 with 7 $x$-axis contacts marked by red dots. Under the Gibbs model where such an object is given the weight $q^7$, the distribution of the number of contacts then depends on the value of $q$, according to the phase transition given in Theorem 14.</figcaption></figure>

We are interested in the number of $x$-axis contacts of the lowest walker. For $m = 1$ this reduces to Theorem 9 on Dyck excursions. For $m \ge 1$, we get the following theorem.

**Theorem 14 (Phase transition for wall contacts).** The limit Gibbs distribution of the number of $x$-axis contacts in $m$-watermelons with a wall has a phase transition at $q_c = 2$:

<table><thead><tr><th>Parameter q</th><th>0 &lt; q &lt; 2</th><th>q = 2</th><th>q &gt; 2</th></tr></thead><tbody><tr><td>Limit law of X<sub>n</sub>(q)</td><td>Negative binomial<br>NegBin(2m, 1 - q/2)</td><td>Chi distribution<br>X<sub>n</sub>/√n &rarr; χ(2m)</td><td>Gaussian<br>N(0, 1)</td></tr></tbody></table>
7:14 Composition Schemes: q-Enumerations and Phase Transitions in Gibbs Models

**Proof (sketch).** The q-enumeration of the number of contacts in m-watermelons of length 2n (n > 0) with a wall was given by Krattenthaler [33, Theorem 4]:

$$
f_n(q) = \frac{(n-1)! \prod_{i=0}^{m-1} (2i+1)! \prod_{i=0}^{m-2} (2n+2i)!}{\prod_{i=0}^{2m-2} (n+i)!} \sum_{\ell=2}^{n+1} \binom{2n-\ell}{n-1} \binom{\ell+2m-3}{\ell-2} q^{\ell}. \quad (12)
$$

In the following, we denote by $X_n$ the random variable counting the number of wall contacts, where we drop the dependence on $m$. Its probability generating function $\mathbb{E}(q^{X_n})$ satisfies

$$
\mathbb{E}(q^{X_n}) = \frac{f_n(q)}{f_n(1)}. \qquad (13)
$$

Let $F(z, q)$ denote the generating function of the numerator of the reduced fraction (13), i.e.,

$$
F(z, q) = \sum_{n>0} z^n \sum_{\ell=2}^{n+1} \binom{2n-\ell}{n-1} \binom{\ell+2m-3}{\ell-2} q^{\ell}. \quad (14)
$$

We change the order of summation and shift the index to get

$$
F(z, q) = \sum_{\ell \ge 2} \binom{\ell + 2m - 3}{\ell - 2} q^{\ell} \sum_{n \ge \ell - 1} \binom{2n - \ell}{n - 1} z^n = q^2 z \sum_{\ell \ge 0} \binom{\ell + 2m - 1}{\ell} q^{\ell} z^{\ell} \sum_{n \ge 0} \binom{2n + \ell}{n} z^n.
$$

Introducing the Catalan generating function $C(z) = \frac{1-\sqrt{1-4z}}{2z}$, one has

$$
\sum_{n \ge 0} \binom{2n + \ell}{n} z^n = \frac{C(z)^\ell}{\sqrt{1 - 4z}}.
$$

While such a formula can be proven by convolution identities [29, Eq. (5.72)], it is pleasant
to give a bijective proof; we invite the reader to pause here and find it before reading on.

The bijection consists in taking a walk of length $2n + \ell$ ending at altitude $\ell$, cutting it
at the initial longest bridge, and after this, at the last passage at each altitude. This gives
$\sum_{n \ge 0} \binom{2n+\ell}{n} z^{2n+\ell} = \frac{1}{\sqrt{1-4z}} (zC(z^2))^{\ell}$.

Going back to the quest for simplifying $F(z, q)$, we thus obtain

$$
F(z, q) = \frac{q^2 z}{\sqrt{1-4z}} \cdot \frac{1}{(1-qzC(z))^{2m}}, \quad (15)
$$

where in the last step we used the generating function identity $G(z) = \frac{1}{(1-z)^{2m}} = \sum_{\ell \ge 0} \binom{\ell+2m-1}{\ell} z^{\ell}$. Note that Eq. (15) suggests that there may be a bijective proof of Formula (12) using links with bridges and arches (instead of Krattenthaler's tour de force relying on determinants and jeu de taquin).

Now, in order to get the limit laws, our key observation is that Eq. (15) is a composition
scheme of shape $F(z, q) = M(z)G(qH(z))$, where $H(z) = zC(z)$, and the probability
generating function (under the Gibbs measure) of the number of contacts is given by

$$
\mathbb{E}(v^{X_n(q)}) = \frac{[z^{n-1}v^k]F(z, qv)}{[z^{n-1}]F(z, q)}.
$$

Next, we just apply singularity analysis with values $\lambda_G = -2m$, $\rho_G = 1$, $\lambda_H = \frac{1}{2}$. The scheme is critical for $q_c = 2$, where one gets the Mittag-Leffler distribution $\frac{1}{\sqrt{2}} ML(\frac{1}{2}, 2m - \frac{1}{2})$, which can be seen (from its moments) to be the same as the chi distribution $\chi(2m)$. This gives the theorem.

$\triangle$
## 4.2 Returns to zero in coloured walks

Let $m > 0$ be an integer. An $m$-coloured bridge is an $m$-tuple $(B_1, \dots, B_m)$ of (possibly empty) bridges $B_i$. As a visual representation, we think of them appended one after the other, $B_i$ is coloured in colour $i$. Note that not all colours need to be present. Let an $m$-coloured walk be an $m$-coloured bridge to which a final walk is appended that never returns to the $x$-axis. See Andrews [2] and [27, 30] for some combinatorial properties of these walks, and links with multicompositions.

We now prove that their number of returns to zero follows a $\chi(m)$ distribution. In particular, this gives the half-normal distribution for $m = 1$ (which extends Theorem 9 to unconstrained walks, see [42]), the Rayleigh distribution for $m = 2$, and the Maxwell distribution for $m = 3$.

<figure><img src="image_14.png" /><figcaption>Figure 6 A 3-coloured walk (only 2 of the available 3 colours are present) with 7 returns to zero (red dots).</figcaption></figure>

**Theorem 15 (Phase transitions for returns to zero).** Under the Gibbs model, the distribution of the number $X_n(q)$ of returns to zero in $m$-coloured walks of length $n$ has, after rescaling for $n \to +\infty$, a phase transition at $q_c = 1$ and follows, either a negative binomial, chi, or Gaussian distribution.

<table><thead><tr><th>Parameter q</th><th>0 &lt; q &lt; 1</th><th>q = 1</th><th>q &gt; 1</th></tr></thead><tbody><tr><td>Limit law of X<sub>n</sub>(q)</td><td>Negative binomial<br>NegBin(m, 1 - q)</td><td>Chi distribution<br>χ(m)</td><td>Gaussian<br>N(0, 1)</td></tr></tbody></table>

**Proof (Sketch).** We start by showing that returns to zero in $m$-coloured walks satisfy the composition scheme $F(z, q) = M(z)G(qA(z))$. First, let $B(z)$ be the generating function of bridges. Each bridge can be decomposed into a sequence of minimal bridges (or generalized arches), which have no return to zero between their extremities (yet jumps might cross the $x$-axis). Hence, $A(z) = 1 - \frac{1}{B(z)}$. Second, the $m$-tuple corresponding to an $m$-coloured bridge has the generating function $G(A(z))$, with $G(z) = \frac{1}{(1-z)^m}$. Third, the final part of the walk (that never returns to the $x$-axis) corresponds to $M(z) = W(z)/B(z)$, since each walk can be factored into an initial bridge and this final part.

Then, as before, the probability generating function (under the Gibbs measure) is

$$ \mathbb{E}(v^{X_n(q)}) = \frac{[z^n v^k] F(z, qv)}{[z^n] F(z, q)}. $$

We get the values $\lambda_G = -m$, $\rho_G = 1$, and $\lambda_M = -1/2$. Furthermore, for any directed walk model [4], $B(z)$ has a critical exponent $\lambda_B = -1/2$, and therefore $\lambda_A = 1/2$. This also means that $B(z)$ diverges at the singularity, and thus $A(z)$ is equal to 1. Hence, the scheme is universally critical at $q_c = 1$, where we get $\frac{1}{\sqrt{2}} \text{ML}(\frac{1}{2}, \frac{m-1}{2})$, which can be seen (from its moments) to be the same as the chi distribution $\chi(m)$. Other cases follow by singularity analysis. ◀
**5 Conclusion**

We unified the recent results of [6] with the classical results of [8,25] to obtain phase transitions for Gibbs models under the umbrella of composition schemes. This allows us to obtain a variety of limit laws, leading to new results, as well as summarizing and generalizing classical results in analytic combinatorics. It also explains the universality hidden behind some phase transitions up to now sporadically observed in the literature. In the full version of this article, we give several extensions of Theorem 6, thus treating many other examples of more general combinatorial constructions.

It is interesting to have an informal physicist look at our results: in statistical mechanics, the Gibbs measure can be seen as $q^k = \frac{\exp(-k/T)}{Z(1/T)}$, where $T$ is the temperature of the model. Accordingly, $T \to 0$ (i.e., $q$ is very small) gives a frozen “solid” phase (typically leading to a discrete distribution), while $T \to +\infty$ gives a “gaseous” phase (typically leading to a Gaussian distribution), and, around (or at) a critical temperature $T_c$, this gives a “liquid” phase (where the wild things are: one often observes at this location an unexpected fancy distribution). Our article is one more illustration of this informal paradigm.

**References**

1 Florian Aigner. *A new determinant for the *q*-enumeration of alternating sign matrices*. *Journal of Combinatorial Theory, Series A*, 180:27 pp., 2021.

2 George E. Andrews. *The theory of compositions*. IV: Multicompositions. *The Mathematics Student*, 2007:25–31, 2007.

3 Cyril Banderier and Michael Drmota. Formulae and asymptotics for coefficients of algebraic functions. *Combinatorics, Probability and Computing*, 24(1):1–53, 2015.

4 Cyril Banderier and Philippe Flajolet. Basic analytic combinatorics of directed lattice paths. *Theoretical Computer Science*, 281(1-2):37–80, 2002.

5 Cyril Banderier, Philippe Flajolet, Gilles Schaeffer, and Michèle Soria. Random maps, coalescing saddles, singularity analysis, and Airy phenomena. *Random Structures & Algorithms*, 19(3-4):194–246, 2001.

6 Cyril Banderier, Markus Kuba, and Michael Wallner. Phase transitions of composition schemes: Mittag-Leffler and mixed-Poisson distributions. *Annals of Applied probability*, 2024. 53 pp., to appear.

7 Nicholas R. Beaton, A. L. Owczarek, and Andrew Rechnitzer. Exact solution of some quarter plane walks with interacting boundaries. *Electronic Journal of Combinatorics*, 26(3 (P53)), 2019.

8 Edward A. Bender. Central and local limit theorems applied to asymptotic enumeration. *Journal of Combinatorial Theory, Series A*, 15:91–111, 1973.

9 Alexei Borodin, Vadim Gorim, and Eric M. Rains. *q*-distributions on boxed plane partitions. *Selecta Mathematica*, 16(4):731–789, 2010.

10 Mireille Bousquet-Mélou. Three osculating walkers. *Journal of Physics: Conference Series*, 42:35–46, 2006.

11 Richard Brak, John W. Essam, and Aleksander L. Owczarek. New results for directed vesicles and chains near an attractive wall. *Journal of Statistical Physics*, 93:155–192, 1998.

12 Richard Brak, John W. Essam, and Aleksander L. Owczarek. Scaling analysis for the adsorption transition in a watermelon network of *n* directed non-intersecting walks. *Journal of Statistical Physics*, 102:997–1017, 2001.

13 Aksheytha Chelikavada and Hugo Panzo. Limit theorems for fixed point biased permutations avoiding a pattern of length three. *arXiv*, 2023.

14 Mihai Ciucu and Christian Krattenthaler. Enumeration of lozenge tilings of hexagons with cut off corners. *Journal of Combinatorial Theory, Series A*, 100:201–231, 2002.
15 Michael Drmota, Omer Giménez, and Marc Noy. Degree distribution in random planar graphs. *Journal of Combinatorial Theory. Series A*, 118(7):2102–2130, 2011.

16 Michael Drmota and Michèle Soria. Marking in combinatorial constructions: generating functions and limiting distributions. *Theoretical Computer Science*, 144(1-2):67–99, 1995.

17 Michael Drmota and Michèle Soria. Images and preimages in random mappings. *SIAM Journal on Discrete Mathematics*, 10(2):246–269, 1997.

18 Philippe Duchon, Philippe Flajolet, Guy Louchard, and Gilles Schaeffer. Boltzmann samplers for the random generation of combinatorial structures. *Combinatorics, Probability and Computing*, 13(4-5):577–625, 2004.

19 Sergi Elizalde. Multiple pattern avoidance with respect to fixed points and excedances. *Electronic Journal of Combinatorics*, 11(1):40 pp., 2004.

20 Thomas Feierl. The height of watermelons with wall. *Journal of Physics A: Mathematical and Theoretical*, 45(9), 2012.

21 Thomas Feierl. The height and range of watermelons without wall. *European Journal of Combinatorics*, 34(1):138–154, 2013.

22 Thomas Feierl. Asymptotics for the number of walks in a Weyl chamber of type B. *Random Structures & Algorithms*, 45(2):261–305, 2014.

23 James Allen Fill, Philippe Flajolet, and Nevin Kapur. Singularity analysis, Hadamard products, and tree recurrences. *Journal of Computational and Applied Mathematics*, 174(2):271–313, 2005.

24 Michael E. Fisher. Walks, walls, wetting, and melting. *Journal of Statistical Physics*, 34:667–729, 1984.

25 Philippe Flajolet and Robert Sedgewick. *Analytic Combinatorics*. Cambridge University Press, 2009.

26 Philippe Flajolet and Michèle Soria. General combinatorial schemas: Gaussian limit distributions and exponential tails. *Discrete Mathematics*, 114(1-3):159–180, 1993.

27 Manosij Ghosh Dastidar and Michael Wallner. Bijections and congruences involving lattice paths and integer compositions. *arXiv*, 2024. A short version of this work was published in the proceedings of GASCOM 2024.

28 Xavier Gourdon. Largest component in random combinatorial structures. *Discrete Mathematics*, 180(1-3):185–209, 1998.

29 Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. *Concrete Mathematics*. Addison-Wesley Publishing Company, second edition, 1994.

30 Brian Hopkins and Stéphane Ouvry. Combinatorics of multicompositions. In *Combinatorial and additive number theory IV*, pages 307–321. Springer, 2021.

31 Sam Hopkins, Alexander Lazar, and Svante Linusson. On the *q*-enumeration of barely set-valued tableaux and plane partitions. *European Journal of Combinatorics*, 2021.

32 Hsien-Kuei Hwang. On convergence rates in the central limit theorems for combinatorial structures. *European Journal of Combinatorics*, 19:329–343, 1998.

33 Christian Krattenthaler. Watermelon configurations with wall interaction: exact and asymptotic results. *Journal of Physics: Conference Series*, 42:179–212, 2006.

34 Christian Krattenthaler, Anthony J. Guttmann, and Xavier G. Viennot. Vicious walkers, friendly walkers and Young tableaux II: with a wall. *Journal of Physics A: Mathematical and General*, 33:8835–8866, 2000.

35 Sara Kropf and Stephan Wagner. On *q*-quasiadditive and *q*-quasimultiplicative functions. *Electronic Journal of Combinatorics*, 24(1):Paper No. 1.60, 22 pages, 2017.

36 Colin L. Mallows. Non-null ranking models I. *Biometrika*, 44:114–130, 1957.

37 Aleksander L. Owczarek and Thomas Prellberg. Exact solution of pulled, directed vesicles with sticky walls in two dimensions. *Journal of Mathematical Physics*, 60:8 pp., 2019.

38 Valerie Roitner. Contacts and returns in 2-watermelons without wall. *Bulletin of the Institute of Combinatorics and its Applications*, 89, 2020.
7:18 Composition Schemes: *q*-Enumerations and Phase Transitions in Gibbs Models

39 Benedikt Stufler. Gibbs partitions: a comprehensive phase diagram. *Annales de l'Institut Henri Poincaré - Probabilités et Statistiques*, 2023. To appear.

40 Rami Tabbara, Aleksander L. Owczarek, and Andrew Rechnitzer. An exact solution of two friendly interacting directed walks near a sticky wall. *Journal of Physics A: Mathematical and Theoretical*, 47(1), 2014.

41 Antoine Vella. Pattern avoidance in permutations: Linear and cyclic orders. *Electronic Journal of Combinatorics*, 9(2):43 pp., 2003.

42 Michael Wallner. A half-normal distribution scheme for generating functions. *European Journal of Combinatorics*, 87:103138, 2020.

43 Shuang Wu. Sachdev-Ye-Kitaev model with an extra diagonal perturbation: phase transition in the eigenvalue spectrum. *Journal of Physics A: Mathematical and Theoretical*, 55(41):415207, 2022.

First version: arXiv, November 28, 2023.

This final version from July 17, 2024 corresponds to the article published by LIPIcs (with a
different style for the bibliography).