A bijection between bargraphs and Dyck paths
Emeric Deutsch, Sergi Elizalde

TL;DR
This paper introduces a novel bijection between bargraphs and Dyck paths, providing new insights into their combinatorial properties and a new interpretation of Catalan numbers related to bargraph statistics.
Contribution
It presents an unusual bijection between bargraphs and Dyck paths and explores how various statistics are preserved or transformed, offering new combinatorial interpretations.
Findings
New bijection between bargraphs and Dyck paths
Catalan numbers interpreted via bargraph statistics
Mapping of statistics between the two structures
Abstract
Bargraphs are a special class of convex polyominoes. They can be identified with lattice paths with unit steps north, east, and south that start at the origin, end on the -axis, and stay strictly above the -axis everywhere except at the endpoints. Bargraphs, which are used to represent histograms and to model polymers in statistical physics, have been enumerated in the literature by semiperimeter and by several other statistics, using different methods such as the wasp-waist decomposition of Bousquet-M\'elou and Rechnitzer, and a bijection with certain Motzkin paths. In this paper we describe an unusual bijection between bargraphs and Dyck paths, and study how some statistics are mapped by the bijection. As a consequence, we obtain a new interpretation of Catalan numbers, as counting bargraphs where the semiperimeter minus the number of peaks is fixed.
| Statistics on bargraphs | Statistics on Dyck paths | ||
|---|---|---|---|
| semiperimeter | semilength | ||
| number of peaks | number of peaks | ||
| number of valleys | number of returns | ||
| sum of heights of valleys | sum of heights of peaks | ||
| number of initial steps | number of initial steps | ||
| number of final steps | number of final steps | ||
| number of steps | number of even blocks in height sequence | ||
| number of steps at height | number of odd blocks in height sequence | ||
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.
A bijection between bargraphs and Dyck paths
Emeric Deutsch NYU Tandon School of Engineering, Brooklyn, NY 11201, USA.
Sergi Elizalde Department of Mathematics, Dartmouth College, Hanover, NH 03755, USA. [email protected]. Partially supported by grant #280575 from the Simons Foundation.
Abstract
Bargraphs are a special class of convex polyominoes. They can be identified with lattice paths with unit steps north, east, and south that start at the origin, end on the -axis, and stay strictly above the -axis everywhere except at the endpoints. Bargraphs, which are used to represent histograms and to model polymers in statistical physics, have been enumerated in the literature by semiperimeter and by several other statistics, using different methods such as the wasp-waist decomposition of Bousquet-Mélou and Rechnitzer, and a bijection with certain Motzkin paths.
In this paper we describe an unusual bijection between bargraphs and Dyck paths, and study how some statistics are mapped by the bijection. As a consequence, we obtain a new interpretation of Catalan numbers, as counting bargraphs where the semiperimeter minus the number of peaks is fixed.
Keywords: bargraph, bijection, Dyck path, Catalan number
1 Introduction
A bargraph is a lattice path with steps , and that starts at the origin and ends on the -axis, stays strictly above the -axis everywhere except at the endpoints, and has no pair of consecutive steps of the form or . Sometimes it is convenient to identify a bargraph with the corresponding word on the alphabet , and sometimes with the sequence of heights (i.e., -coordinates) of the steps of the path, thus interpreting the bargraph as a composition.
Bargraphs appear in the literature with different names. As a special class of convex polyominoes, they have been studied and enumerated by Bousquet-Mélou and Rechnitzer [6], Prellberg and Brak [10], and Feretić [8]. The distribution of several bargraph statistics has been given in a series of papers by Blecher, Brennan, Knopfmacher and Prodinger [1, 2, 3, 4, 5]. All of the above papers rely on a decomposition of bargraphs that is used to obtain equations satisfied by the corresponding generating functions. Recently, the enumeration of bargraphs with respect to some additional statistics has been obtained in [7] by using a simple bijection between bargraphs and Motzkin paths without peaks or valleys, together with the recursive structure of Motzkin paths.
The semiperimeter of a bargraph is defined as the number of steps plus the number of steps, and denoted by . It coincides with the semiperimeter of the closed polyomino determined by the bargraph and the -axis. Let denote the set of bargraphs, and let denote those of semiperimeter . An important bargraph statistic in this paper is the number of peaks, which are occurrences of for some .
A Dyck path is a lattice path with steps and that starts at the origin, ends on the -axis, and stays weakly above the -axis. Let denote the set of Dyck paths, and let denote those of semilength , where the semilength of a path is defined as half of the number of steps, and denoted by . It is well known that , the th Catalan number.
In Section 2 we introduce a bijection between bargraphs and Dyck paths. An unusual feature of our bijection is that it does not preserve “size” under the natural definitions, such as semiperimeter or semilength. Instead, the statistics preserved by the bijection are more subtle, as discussed in Section 3. As a consequence of the bijection, we obtain a new interpretation of the Catalan numbers in terms of bargraphs. An alternative proof of this result, using generating functions, is given in Section 4.
2 The bijection
In this section we define a bijection from Dyck paths to bargraphs, with the property that the semilength of a Dyck path becomes the semiperimeter minus the number of peaks of the corresponding bargraph.
Given a Dyck path , define the height of each step of as the -coordinate of its highest point. Consider the sequence of heights of the steps of . To construct the bargraph from this sequence, turn each maximal block of consecutive letters into columns of height .
For example, the Dyck path in Figure 1 has height sequence {\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11111}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3333}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2222}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3333}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}222}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1111}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}22}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1}, and thus its corresponding bargraph has column heights {\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}33}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}22}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}33}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}.
Next we describe the inverse. Consider a bargraph described by a sequence of column heights . By inserting terms with if necessary, we can assume that and for all . Define by convention. To construct a Dyck path, for , we replace with
[TABLE]
For example, the bargraph with column heights {\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}33}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}22}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}33}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2} is first written as {\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2^{0}}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2^{2}}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2^{1}}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2^{1}}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1^{0}}, which then becomes {\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}(ud)^{2}u}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}u}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}(ud)^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}(du)^{2}}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}(ud)^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}(du)d}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}(du)^{2}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}(ud)}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}d}.
3 Properties of
Next we show how some statistics on Dyck paths are mapped by the bijection into statistics on bargraphs. We start by defining some statistics on bargraphs and Dyck paths.
For a bargraph , denote by , and the number of , and steps in , respectively. Note that, by definition, . The area of the region under a bargraph and above the -axis is denoted by .
A peak (resp. valley) in a bargraph is an occurrence of (resp. ) for some . Denote by the number of peaks of , and by its number of valleys. Note that , since peaks and valleys in a bargraph alternate, always starting and ending with a peak. Let be the sum of the heights of the valleys of , where the height of a valley is the -coordinate of its steps. Denote by the number of steps of at height (equivalently, number of columns of of height ).
A peak in a Dyck path is an occurrence of , and a return is a step that ends on the -axis. For , let denote its number of peaks, and its number of returns. Defining the height of a peak as the -coordinate of its highest point, let denote the sum of the heights of the peaks of .
Define the height of a Dyck path or a bargraph to be the maximum -coordinate that it reaches. Denote by (resp. ) the number of initial steps (resp. final steps) in a Dyck path , and define and on a bargraph similarly.
Table 1 summarizes the notation that we use for statistics on bargraphs and Dyck paths.
Example 3.1**.**
The bargraph in Figure 1 has , , , , , , , , , .
Theorem 3.2**.**
Let and let . Then
- (a)
, 2. (b)
, 3. (c)
, 4. (d)
, 5. (e)
, 6. (f)
. 7. (g)
* (unless and have height , in which case ).*
Proof.
Let us first prove part (a). The height sequence of can be decomposed into maximal blocks of steps of the same height. Let be the number of even blocks, and let be the number of odd blocks. In the construction of , each block of size produces horizontal steps in the bargraph. Thus, the number of steps in equals .
Additionally, the height changes by one from each block to the next, which translates into a or a in the bargraph. Thus . More specifically, the two consecutive height changes occurring at the beginning and at the end of a given block (with the convention that the height is [math] outside the path) have the same sign if and only if the block has odd length.
For example, in the path of Figure 1, denoting by and height changes of and respectively, we get {\uparrow}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}11111}{\uparrow}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}{\uparrow}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3333}{\downarrow}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2222}{\uparrow}{\color[rgb]{0,1,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}3333}{\downarrow}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}222}{\downarrow}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1111}{\uparrow}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}22}{\downarrow}{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}1}{\downarrow}. In particular, the number of even blocks equals the number of peaks plus the number of valleys (which in turn equals the number of peaks minus one), and so .
Putting the above observations together,
[TABLE]
as desired.
To prove parts (b) and (c), note that in the above decomposition of into maximal blocks of steps of the same height, all peaks of occur within the blocks, since the two steps in a peak have the same height. Additionally, the height of such a peak coincides with the height of the block containing it, and thus with the height of the corresponding columns in the bargraph. Each odd block in of size contains peaks. Similarly, each even block of size contains peaks, unless the two blocks surrounding it are higher than the block itself, in which case it contains peaks. Blocks surrounded by higher blocks correspond to valleys of . It follows that . Additionally, since the area of a bargraph is the sum of the heights of its columns, we get .
Parts (d), (e) and (f) follow immediately from the construction of .
Finally, to prove part (g), note that all returns of occur in blocks of height . If (equivalently, , by part (c)) has height , then it is clear that . If has height at least , then the blocks of height are the first and last block, which are necessarily odd, plus possibly some even blocks. If the first block has length (for some ), it contributes returns to and steps at height to . If the last block has length , it contributes returns to and steps at height to . Any even block at height of length contributes returns to and steps at height to . The equality follows. ∎
The following is an immediate consequence of Theorem 3.2(a), giving a new interpretation of the Catalan numbers.
Corollary 3.3**.**
[TABLE]
Example 3.4**.**
For , the set consists of all bargraphs of semiperimeter , respectively, since each of these bargraphs has peak. For , this set, drawn in Figure 2, consists of all bargraphs of semiperimeter 5 (each of them having peak) and the only bargraph of semiperimeter 6 that has 2 peaks.
Table 2 displays the number of bargraphs with a given semiperimeter (up to ) and a given number of peaks. Corollary 3.3 states that the diagonal sums of this table (which is the triangular sequence [9, A271940]) are the Catalan numbers. This observation for small values of led to the results in this paper.
We end this section by describing other properties of , which can be used to give a recursive description of this map. Interpreting a bargraph as a lattice path, the path is the bargraph whose height sequence is obtained by adding one to each entry of the height sequence of . On the other hand, given bargraphs and , the expression denotes the concatenation of and viewed as height sequences. Let denote the bargraph consisting of one column of height .
Proposition 3.5**.**
Let , and let , . Then
- (i)
, 2. (ii)
\phi(PP^{\prime})=\begin{cases}B\circ\mathbf{1}\circ B^{\prime}&\text{if \operatorname{height}(P)\geq 2\operatorname{height}(P^{\prime})\geq 2,}\\ B\circ B^{\prime}&\text{otherwise.}\end{cases}**
Proof.
To prove part (i), note that elevating the path increases the entries of its height sequence by one, and adds a at the beginning and a at the end of it, neither of which contributes new columns to the bargraph.
Part (ii) follows from the observation that, if has , then the initial and final maximal blocks of ’s in the height sequence of have odd sizes. ∎
4 Generating functions
In this subsection we give an alternative proof of Corollary 3.3 using generating functions. Let
[TABLE]
be the generating function for bargraphs according to the number of peaks and the semiperimeter. It was shown in [2] (and can be easily derived from [7]) that satisfies
[TABLE]
Let
[TABLE]
be the generating function where keeps track of the semiperimeter minus the number of peaks. Then, substituting into (1), we see that satisfies
[TABLE]
Setting and simplifying, we get
[TABLE]
yielding
[TABLE]
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] A. Blecher, C. Brennan and A. Knopfmacher, Levels in bargraphs, Ars Math. Contemp. 9 (2015), 287–300.
- 2[2] A. Blecher, C. Brennan and A. Knopfmacher, Peaks in bargraphs, Transactions of the Royal Society of South Africa 71 (2016), 97–103.
- 3[3] A. Blecher, C. Brennan and A. Knopfmacher, Combinatorial parameters in bargraphs, Quaest. Math. 39 (2016), 619–635.
- 4[4] A. Blecher, C. Brennan and A. Knopfmacher, Walls in bargraphs, preprint.
- 5[5] A. Blecher, C. Brennan, A. Knopfmacher and H. Prodinger, The height and width of bargraphs, Discrete Appl. Math. 180 (2015), 36–44.
- 6[6] M. Bousquet-Mélou and A. Rechnitzer, The site-perimeter of bargraphs, Adv. in Appl. Math. 31 (2003), 86–112.
- 7[7] E. Deutsch and S. Elizalde, Statistics on bargraphs viewed as cornerless Motzkin paths, Discrete Appl. Math. 221 (2017), 54–66.
- 8[8] S. Feretić, A perimeter enumeration of column-convex polyominoes, Discrete Math. Theor. Comput. Sci. 9 (2007), 57–84.
