On two subclasses of Motzkin paths and their relation to ternary trees
Helmut Prodinger, Sarah J. Selkirk, Stephan Wagner

TL;DR
This paper introduces two subclasses of Motzkin paths, establishes bijections with ternary and non-crossing trees, and derives generating functions to analyze their combinatorial properties.
Contribution
It presents new subclasses of Motzkin paths and their explicit bijections with ternary and non-crossing trees, along with symbolic equations and generating functions.
Findings
Bijections between S-Motzkin paths and ternary trees
Bijections between S-Motzkin paths and non-crossing trees
Bijections between T-Motzkin paths and pairs of ternary trees
Abstract
Two subclasses of Motzkin paths, S-Motzkin and T-Motzkin paths, are introduced. We provide bijections between S-Motzkin paths and ternary trees, S-Motzkin paths and non-crossing trees, and T-Motzkin paths and ordered pairs of ternary trees. Symbolic equations for both paths, and thus generating functions for the paths, are provided. Using these, various parameters involving the two paths are analyzed.
| S-Motzkin path | Ternary tree | S-Motzkin path | Ternary tree |
|---|---|---|---|
| S-Motzkin path | Non-crossing tree | S-Motzkin path | Non-crossing tree |
|---|---|---|---|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
| Mean | ||
|---|---|---|
| Variance |
| Mean | ||
|---|---|---|
| Variance |
| Mean | ||
|---|---|---|
| Variance |
| Mean | ||
|---|---|---|
| Variance |
| Mean | ||
|---|---|---|
| Variance |
| Mean | ||
|---|---|---|
| Variance |
| Generating function | In terms of derivatives | Power series expansion |
|---|---|---|
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopological and Geometric Data Analysis · Advanced Combinatorial Mathematics · Markov Chains and Monte Carlo Methods
11institutetext: Helmut Prodinger 22institutetext: Sarah Selkirk 33institutetext: Stephan Wagner 44institutetext: Stellenbosch University, Department of Mathematical Sciences, Stellenbosch, 7602, 44email: @sun.ac.za
\motto
To Peter Paule, a vibrant mathematician and a true innovator, on the occasion of his 60th birthday.
On two subclasses of Motzkin paths and their relation to ternary trees
Helmut Prodinger
Sarah J. Selkirk
Stephan Wagner
Abstract
Two subclasses of Motzkin paths, S-Motzkin and T-Motzkin paths, are introduced. We provide bijections between S-Motzkin paths and ternary trees, S-Motzkin paths and non-crossing trees, and T-Motzkin paths and ordered pairs of ternary trees. Symbolic equations for both paths, and thus generating functions for the paths, are provided. Using these, various parameters involving the two paths are analyzed.
1 Introduction
A Motzkin path is a non-negative lattice path with steps from the step set such that the path starts and ends on the -axis. By placing further restrictions on Motzkin paths we obtain an interesting subclass.
Definition 1
An S-Motzkin path is a Motzkin path of length with of each type of step such that the following conditions hold
The initial step must be , and 2. 2.
and steps alternate.
This definition was inspired by a question at the recent International Mathematics Competition [10] involving restricted three-dimensional walks which can be translated into the two-dimensional S-Motzkin paths. These paths are enumerated by the generalized Catalan number, , and thus are bijective to ternary trees and non-crossing trees, as well as many other combinatorial objects [2, 5, 8, 11, 13]. We define another subclass of Motzkin path which is related to both S-Motzkin paths and ternary trees.
Definition 2
A T-Motzkin path is a Motzkin path of length with of each type of step such that
The initial step is , and 2. 2.
and steps alternate.
Note that although similar in definition, the class of T-Motzkin paths is larger than the class of S-Motzkin paths. Interchanging the and
steps in an arbitrary S-Motzkin path provides a T-Motzkin path, but the converse is not true. T-Motzkin paths of length are enumerated by and thus bijective to the class of ordered pairs of ternary trees introduced by Knuth [6]. There are several other equinumerous objects which can be found on the Online Encyclopedia of Integer Sequences A006013 [13].
Introducing another type of path is necessary for finding generating function equations for S-Motzkin and T-Motzkin paths, and thus we define a U-path to be an S-Motzkin path without the initial step. Symbolic equations for T-Motzkin paths and U-paths can be obtained in terms of each other by making use of a decomposition based on the first return of the path. Since S-Motzkin paths and U-paths are ‘almost’ the same, the generating function for S-Motzkin paths can be easily obtained from that of U-paths.
Various parameters associated with different types of lattice paths have been studied [1, 9, 12] and we provide analysis of the number of returns, peaks, valleys, and valleys on the -axis in both S-Motzkin and T-Motzkin paths. This analysis is done using the symbolic equations and generating functions that are derived, as well as methods from the seminal book Analytic Combinatorics by Flajolet and Sedgewick [4]. During this analysis some interesting identities were found and are discussed briefly in Section 5.
The study of these paths as well as parameters related to them has resulted in some generalizations and developments which will be reported in further publications.
2 Bijections
2.1 S-Motzkin paths and ternary trees
A bijection between S-Motzkin paths of length and ternary trees with nodes is provided.
S-Motzkin paths to ternary trees
We define to be the empty path. For an arbitrary S-Motzkin path , the canonical decomposition is given by
[TABLE]
where , , and represent the S-Motzkin paths associated with the left, middle, and right subtrees respectively. Furthermore,
- •
is the path from the penultimate to the final return of , with the initial and final step removed,
- •
is the path from to (not including ), where is the first
to the left of , is a step, and the path from y to x is a Motzkin path of maximal length, and
- •
is what remains of after removing the path from the penultimate to the final return of , as well as the path from to (including ).
This process is performed recursively and terminates at an empty path. Note that each application of adds one node and removes one of each type of step. This proves inductively that an S-Motzkin path of length maps to a ternary tree with (internal) nodes.
Ternary trees to S-Motzkin paths
The inverse mapping is performed recursively on the end nodes as follows. Each node of a ternary tree has three (possibly empty) subtrees. Call the paths associated with the left, middle, and right subtrees , , and respectively.
Starting at the end nodes, replace each node with where is the path from the start of to the final
step of . The path is what remains of after removing . This process is continued recursively on each set of end nodes and terminates at the root to produce an S-Motzkin path. Note that for each node that is removed one of each type of step is added, and thus a ternary tree with nodes produces an S-Motzkin path of length .
Example
As an example, we map the following S-Motzkin path into a ternary tree. Since the steps are reversible, the inverse mapping can be seen by reading the example in reverse. Let be the S-Motzkin path
.
The canonical decomposition of is then \Phi(\mathcal{M})=\Big{(}\leavevmode\hbox to17.64pt{\vbox to6.26pt{\pgfpicture\makeatletter\hbox{\hskip 0.28453pt\lower-0.2846pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\pgfsys@setlinewidth{0.56906pt}\pgfsys@invoke{ } {}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@lineto{5.69046pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{5.69037pt}{0.0pt}\pgfsys@lineto{11.38083pt}{5.69046pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{11.38065pt}{5.69037pt}\pgfsys@lineto{17.0711pt}{-0.00008pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,,\,\leavevmode\hbox to34.71pt{\vbox to6.26pt{\pgfpicture\makeatletter\hbox{\hskip 0.28453pt\lower-0.28477pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\pgfsys@setlinewidth{0.56906pt}\pgfsys@invoke{ } {}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@lineto{5.69046pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{5.69037pt}{0.0pt}\pgfsys@lineto{11.38083pt}{5.69046pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{11.38065pt}{5.69037pt}\pgfsys@lineto{17.0711pt}{5.69037pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{17.07083pt}{5.69028pt}\pgfsys@lineto{22.7613pt}{-0.00017pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{22.76096pt}{-0.00015pt}\pgfsys@lineto{28.45142pt}{5.69029pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{28.45097pt}{5.6902pt}\pgfsys@lineto{34.14143pt}{-0.00024pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,,\,\leavevmode\hbox to34.71pt{\vbox to6.26pt{\pgfpicture\makeatletter\hbox{\hskip 0.28453pt\lower-0.28467pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\pgfsys@setlinewidth{0.56906pt}\pgfsys@invoke{ } {}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@lineto{5.69046pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{5.69037pt}{0.0pt}\pgfsys@lineto{11.38083pt}{5.69046pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{11.38065pt}{5.69037pt}\pgfsys@lineto{17.0711pt}{-0.00008pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{17.07083pt}{-0.00006pt}\pgfsys@lineto{22.7613pt}{-0.00006pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{22.76096pt}{-0.00005pt}\pgfsys@lineto{28.45142pt}{5.6904pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{}}{}{{}}{} {{}{}}{}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@roundcap\pgfsys@invoke{ }{}\pgfsys@moveto{28.45097pt}{5.6903pt}\pgfsys@lineto{34.14143pt}{-0.00014pt}\pgfsys@stroke\pgfsys@invoke{ }\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\Big{)}. Hence
Continuing recursively:
\bullet$$\bullet$$\bullet$$\bullet$$\varnothing$$\varnothing$$\varnothing$$\varnothing$$\varnothing$$\varnothing$$\varnothing
\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\varnothing$$\varnothing$$\varnothing$$\varnothing$$\varnothing$$\varnothing
\bullet$$\bullet$$\bullet$$\bullet$$\bullet$$\bullet
2.2 T-Motzkin paths and pairs of ternary trees
T-Motzkin paths to pairs of ternary trees
Since a bijection between S-Motzkin paths and ternary trees is already provided, we show that every T-Motzkin path can be decomposed uniquely into an ordered pair of S-Motzkin paths (possibly including an empty path).
Given an arbitrary T-Motzkin path , we perform a canonical decomposition where
- •
is the path from to (not including ) where is the rightmost
step of , is a
step, and the path from to is a Motzkin path of maximal length, and
- •
is what remains of after removing the path from to (including ), with an additional
step at the start of the path. In Figure 2 this is the path .
Note that both and are S-Motzkin paths.
Pairs of ternary trees to T-Motzkin paths
Given an arbitrary pair of ternary trees, we can use the bijection given in Section 2.1 to obtain an ordered pair of S-Motzkin paths, . All S-Motzkin paths start with a
step and end in an
step followed by a series of steps. To obtain a T-Motzkin path from we
- •
remove the initial
step from , and
- •
insert the path immediately after the final
step of .
Example
We provide an example of the mapping from T-Motzkin paths to ternary trees. The inverse mapping can be seen by reading this example in reverse. Let be
[TABLE]
Then is given by
[TABLE]
2.3 S-Motzkin paths and non-crossing trees
The definition of a non-crossing tree as well as the representation of a non-crossing tree that is used in this text (with a marker to separate left and right children) can be found in [8]. To assist in describing the bijection, we define a piece to be a maximal subpath of a Motzkin path consisting of (in order) one up step, a series of down steps (possibly empty), one horizontal step, and a series of down steps (possibly empty). Note that an arbitrary S-Motzkin path of length consists of an initial step followed by pieces, and a final step followed by a series of steps. Each piece is uniquely determined by the number of steps and the position of the step. The characteristic pair of a piece is the ordered pair with denoting the number of steps in the piece, and denoting the position of the step (with the step in position [math]).
S-Motzkin paths to non-crossing trees
Given an arbitrary S-Motzkin path of length , we let denote the number of steps in the final series of steps of the path. In the resulting non-crossing tree, draw a root with children. Considering the pieces of the path from right to left, we find the characteristic pair and draw left subtrees and right subtrees on the rightmost available node.
Non-crossing trees to S-Motzkin paths
Given an arbitrary non-crossing tree, let denote the number of children of the root. Associate with each non-root node an ordered pair where equals the number of children of the node and equals the number of left subtrees of the node. Then remove the leftmost leaf. Draw an initial step and repeat the following until only the root remains: consider the leftmost leaf’s ordered pair and add an step, steps, a step and steps to the path, and then remove the leftmost leaf from the tree. Finally, add an step, and steps to the path.
3 Generating functions and related paths
Let be the class of T-Motzkin paths, be the class of U-paths, and
[TABLE]
be their respective generating functions, where and represent the number of paths of length in the given class.
We derive symbolic equations for the two types of paths based on a first return decomposition. Note that the only U-path of length less than five is given by . Taking into account the first return of a U-path, it is clear that a U-path of length five or more can be decomposed as either
[TABLE]
In , can either be a U-path or a T-Motzkin path. If is a U-path, then is either empty or is a step followed by a U-path. If is a T-Motzkin path, then is a U-path. In , has to be a U-path. This then results in the symbolic equation
[TABLE]
from which we obtain the equation
[TABLE]
Again, any T-Motzkin path of length is either empty or, considering the first return of the path, of the form or as given in the U-path case.
In , can either be a U-path or a T-Motzkin path. If is a U-path, then an ‘extra’ step needs to appear in , and thus is given by a step followed by a T-Motzkin path. If is a T-Motzkin path, then is also a T-Motzkin path. With analogous reasoning we can see that for the only possibility for is a T-Motzkin path. Using this we obtain the symbolic equation
[TABLE]
which results in the equation
[TABLE]
Solving the system of equations given by (1) and (2) yields
[TABLE]
which, with substitutions, is amenable to application of the Lagrange inversion formula. To demonstrate this, consider the equation
[TABLE]
This can be factorised as , and with substitutions and we find that . Therefore
[TABLE]
which results in
[TABLE]
Since U-paths are S-Motzkin paths without the initial horizontal step, the generating function for S-Motzkin paths is given by . Note that , which was pointed out by Knuth in his 2014 Christmas lecture [6]. We have proved this by means of the bijection provided in Section 2.2.
4 Analysis of various parameters
In this section the analysis of the number of returns is done in detail, and results for the number of peaks, the number of valleys, and the number of valleys on the -axis are done similarly. The study of these parameters in Dyck paths can be found in [1, 7].
4.1 The number of returns
From the generating functions for U-paths and T-Motzkin paths along with the substitutions and , we obtain
[TABLE]
We introduce the variable to count the number of returns, and from the symbolic equations for U-paths and T-Motzkin paths we obtain the bivariate generating functions:
[TABLE]
Solving this system of equations we find that
[TABLE]
Mean and variance
For a bivariate generating function with representing the parameter of interest, we obtain the mean and variance as follows. The mean is given by
[TABLE]
and the variance is
[TABLE]
In the sections that follow some simplifications occur when calculating variances. These are discussed in more detail in Section 5.
To determine the average number of returns we calculate the derivative of and with respect to ,
[TABLE]
The total number of returns in all paths of length is then obtained by extracting the coefficients of these expressions by means of Cauchy’s integral formula. For S-Motzkin paths this results in
[TABLE]
and for T-Motzkin paths we obtain
[TABLE]
Therefore in S-Motzkin paths the average number of returns for paths of length is
[TABLE]
and for T-Motzkin paths the average number of returns is
[TABLE]
To calculate the variance in the number of returns for paths of length , we find the second derivatives of and with respect to :
[TABLE]
and
[TABLE]
We again determine the coefficients using Cauchy’s integral formula,
[TABLE]
and
[TABLE]
with which we find that the variance for the number of returns for S-Motzkin paths of length is
[TABLE]
Similarly, the variance for the number of returns for T-Motzkin paths of length is given by
[TABLE]
Limiting distributions
We have defined implicitly by . It is well known that this type of implicit equation leads to a square root singularity [4, Section VII.4]. In this particular case, the singularity occurs at , , where . At this point, the singular expansion of with respect to is
[TABLE]
The generating function for the number of returns in S-Motzkin paths is given by
[TABLE]
Note that for and , we have and thus
[TABLE]
so the denominator is nonzero and the singularity of remains the dominant singularity. This generating function has the Taylor expansion (with substitution of the singular expansion of ):
[TABLE]
Applying singularity analysis [4, Section VI], we obtain
[TABLE]
Therefore, the probability generating function for the number of returns in S-Motzkin paths of length , which is given by , converges to
[TABLE]
By [4, Theorem IX.1], the distribution of the number of returns in S-Motzkin paths converges to the discrete distribution given by this probability generating function. The probability that the number of returns is precisely converges to
[TABLE]
In a similar manner, we find that the limiting probability generating function for the number of returns in T-Motzkin paths of length is given by
[TABLE]
and the probability that the number of returns is precisely converges to
[TABLE]
The convergence in both cases is demonstrated in the figures below.
[math]5$$10$$15$$20[math]0.05$$0.1$$0.15$$k-valuenormalised coefficientCoefficients of in for fixed values of n$$n=\phantom{1}60$$n=120$$n=180large
[math]5$$10$$15$$20[math]0.05$$0.1$$0.15$$k-valuenormalised coefficientCoefficients of in for fixed values of n$$n=\phantom{1}60$$n=120$$n=180large
4.2 The number of peaks
There are two possible types of peaks:
[TABLE]
We first consider peaks of type (1) and again use the variable to count them. Then from the symbolic equations given below, we obtain the results in Table 3.
[TABLE]
The system of equations for and satisfies the technical conditions of [3], where it is shown that we have convergence to a normal law in a rather general setting. By the main result of [3], the number of peaks (of both types) asymptotically follows a Gaussian distribution.
[math]10$$20$$30$$40[math]0.05$$0.1$$0.15$$0.2$$0.25$$k-valuenormalised coefficientCoefficients of in for fixed values of n$$n=\phantom{1}60$$n=120$$n=180
[math]10$$20$$30$$40[math]0.05$$0.1$$0.15$$0.2$$k-valuenormalised coefficientCoefficients of in for fixed values of n$$n=\phantom{1}60$$n=120$$n=180
We now consider peaks of type , and again use the variable to count them. From the symbolic equations we obtain
[TABLE]
Note that contains an empty path. As a result, for paths of the form
[TABLE]
if the T-Motzkin path is empty we obtain and respectively. If path is not empty we obtain and . Using the generating function equations we obtain the following results.
4.3 Valleys
There are two possible types of valleys:
[TABLE]
For valleys of type , using the variable to count them we obtain generating function equations
[TABLE]
This is taking into account that the empty T-Motzkin path does not contribute a valley of type . From the generating function equations we obtain:
As in our analysis of peaks in the previous subsection, we can apply the main result of [3] to prove that the number of valleys (of both types) asymptotically follows a Gaussian distribution.
The generating function equations for valleys of type , again using to count the number of valleys, are given by
[TABLE]
Again, we take into account the absence of a valley in the case of an empty T-Motzkin path. The equations yield:
4.4 Valleys on the -axis
We now consider valleys that lie on the -axis. Keeping the two types of valleys discussed in the previous subsection, a valley of type contributes one return, and a valley of type contributes two returns. For valleys on the -axis of type , using the variable to count them we obtain generating function equations
[TABLE]
Let and , then we obtain the following results.
In a similar manner to that of Section 4.1, we find the limiting probability generating function for valleys of type on the -axis is given by for S-Motzkin paths, and for T-Motzkin paths (both of length ).
For valleys on the -axis of type , again using to count the number of valleys, we obtain the generating function equations
[TABLE]
From these the following results are obtained.
The limiting probability generating functions for the number of valleys of type on the -axis is given by for S-Motzkin paths and for T-Motzkin paths (both of length ).
5 Identities
In Sections 4.2 and 4.3 the coefficients of the generating functions used to find the variance were greatly simplified by using derivatives (compared to extracting coefficients using Cauchy’s integral formula). An example of this simplification is given: Using Cauchy’s integral formula as in Section 4.1 we obtain the coefficients
[TABLE]
On the other hand, the generating function can be expressed as a derivative, and by using the formula we find that
[TABLE]
It follows that
[TABLE]
which is a special case of the more general identity
[TABLE]
This and other beautiful identities such as
[TABLE]
and
[TABLE]
can be proved directly by induction. A table of the simplifications used to calculate variances in Section 4 is given in Table 9.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] E. Deutsch. Dyck path enumeration. Discrete Mathematics , 204(1–3):167–202, 1999.
- 2[2] E. Deutsch, S. Feretić, and M. Noy. Diagonally convex directed polyominoes and even trees: a bijection and related issues. Discrete Mathematics , 256(3):645–654, 2002.
- 3[3] M. Drmota. Systems of functional equations. Random Structures and Algorithms – Special issue: average-case analysis of algorithms , 10:103–124, 1997.
- 4[4] P. Flajolet and R. Sedgewick. Analytic Combinatorics . Cambridge University Press, 2009.
- 5[5] N. S. S. Gu, N. Y. Li, and T. Mansour. 2-binary trees: Bijections and related issues. Discrete Mathematics , 308:1209–1221, 2008.
- 6[6] D. Knuth. Donald Knuth’s 20th Annual Christmas Tree Lecture: (3/2)-ary Trees. https://youtu.be/P 4Aa GQ Io 0HY , Dec 2014.
- 7[7] T. Mansour. Counting peaks at height k 𝑘 k in a Dyck path. Journal of Integer Sequences , 5:Article 02.1.1, 2002.
- 8[8] A. Panholzer and H. Prodinger. Bijections for ternary trees and non-crossing trees. Discrete Mathematics , 250(1–3):181–195, 2002.
