Combinations as bargraphs

In this paper, we consider statistics on combinations of [n] when combinations are presented as bargraphs. The statistics we consider are cardinality of a combination, semi-perimeter, outer site-perimeter, and inner site-perimeter. We find an explicit formula for the generating function for the number of combinations of [n] according to the considered statistics. We also find an explicit formula for the total of the above statistics over all combinations of [n].


Introduction
A bargraph is a self-avoiding random walk in the first quadrant starting at the origin and ending with its first return to the x-axis that has three types of steps: an up step (0, 1), a down step (0, −1), and a horizontal step (1, 0) and that horizontal steps must all lie strictly above the x-axis. An up step cannot directly follow a down step and vice versa. For a given bargraph B the points (x, y), (x + 1, y), (x + 1, y + 1), (x, y + 1) that lie either along B or within the area it subtends in the first quadrant define a cell of B. Each bargraph will be identified as a sequence of columns π = π 1 π 2 · · · π m such that column j (from the left) contains π j cells. Let B n,m denote the set of bargraphs with n cells and m columns. As bargraphs with n cells and m columns are in a one-to-one correspondence with compositions of n with exactly m parts, we have |B n,m | = n−1 m−1 . Recall that a combination of [n] = {1, 2, . . . , n} is a subset of [n]. We denote the set of all combinations of [n] by C n . To each subset of [n], written in increasing order, we associate a corresponding bargraph. For example, in Figure 1, it is given the bargraph of {1, 3, 4, 5, 7}, a subset of [7] (it is also a subset of [k], k > 7). We will enumerate combinations of [n] presented as bargraphs, according to several known statistics, such as semiperimeter (sp), outer site-perimeter (op) and inner site-perimeter (ip). Given a bargraph B, the perimeter is the number of edges on the boundary of B; the semi-perimeter is the half of the perimeter; the inner site-perimeter is the number of cells inside B that have at least one common edge with an outside cell. Similarly, the outer site-perimeter is the number of cells outside B that have at least one common edge with a cell in B. For any combination π of [n], we define card(π) = |π| to be the number of elements in π.
We look again at π = {1, 3, 4, 5, 7} and illustrate in Figure 2 inner site-perimeter and outer site-perimeter. Note that the inner site-perimeter is the sum of cells marked by 'i' and the outer site-perimeter is the sum of cells marked by 'o'. We see that for the subset under consideration the semi-perimeter, inner site-perimeter and outer site-perimeter are equal to 12, 15, 20, respectively. Clearly, card(π) = 5. Next, we present a brief overview of main research related to bargraphs in general and to perimeter statistics in particular.
Bargraphs, referred to as wall polyominoes or skylines [12], have recently been studied from several directions and have lead to various refined enumerations. We emphasize here the results given by Prellberg and Brak [17] and Feretić [13], who found a generating function with variables x and y that keep track of the number of horizontal and up steps, respectively. Further refined enumerations of bargraphs were found by Blecher et al. according to such statistics as levels [2], peaks [4] and descents [3]. Deutsch and Elizalde [11] considered bargraphs as Motzkin paths without peaks or valleys and derived distribution formulas for some further statistics. Bargraphs have connections to probability theory where they represent frequency diagrams and have been used to model polymers in statistical physics [15,16]. Some recent results in relation to bargraphs appear in [14] where the authors studied several statistics on bargraphs such as the area and up step on set partitions, corners in compositions, and set partitions presented as bargraphs. Another recent study in [7] relates the problem involving the enumeration of partitions of an integer by the number of corners in their Ferrers diagrams.
The enumeration of bargraphs by their site-perimeter is studied in [9]. The author in [1], by using Viennot's correspondence between directed animals and elements of a partially commutative monoid, bijectively computed the average of several parameters including the site perimeter. The site-perimeter for directed animals and staircase polygons were considered in [1,10]. The more recent results [5] study the parameter of 'site-perimeter' in compositions. In [6] the inner site-perimeter of bargraphs is considered and in [8], the perimeter of words presented as bargraphs is considered.
The organization of this paper is as follows. In the next section, we find an explicit formula for the generating function for the number of combinations of [n] according to the statistics card and semi-perimeter sp. Then, we find an explicit formula for the generating function for the number of combinations of [n] according to the statistics card and outer siteperimeter op (inner site-perimeter ip). Moreover, we derive an explicit formula for the total of the statistic sp (op, ip) over all combinations of [n]. In particular, we show the following result. ).

Semi-perimeter
Let P n (p, q) be the generating function for the number of combinations π of [n] according to the statistics card and sp, namely, P n (p, q) = π∈Cn p card(π) q sp(π) .
Here, we define P 0 (p, q) = 1. First, let us write a recurrence relation for P n (p, q). Since each combination of [n] either contains n or not, we have P n (p, q) = P n−1 (p, q) + P n (p, q|n), where P n (p, q|n) is the generating function for the number of combinations of [n] that contain n according to the statistics card and sp. Since each combination π of [n] that contains n either has the second maximal element in π is j, 1 ≤ j ≤ n − 1 or π has only one element, we obtain where P n (p, q|jn) is the generating function for the number of combinations of [n] that contain the elements j and n according to the statistics card and sp. Thus, P n (p, q|n) = pq n+1 + p n−1 j=1 q n+1−j P j (p, q|j), which, by taking first difference, implies P n (p, q|n) − qP n−1 (p, q|n − 1) = pq 2 P n−1 (p, q|n − 1).
By differentiating P n (1, q) at q = 1, we obtain that the total semi-perimeter over all combinations of [n] is given by 1 + (3n − 2)2 n−1 . Thus, the average value of semi-perimeter over all combinations of [n] is asymptotic to 3n−2 2 .

Outer site-perimeter
Let O n (p, q) be the generating function for the number of combinations π of [n] according to the statistics card and op, namely, O n (p, q) = π∈Cn p card(π) q op(π) .
Here, we define O 0 (p, q) = 1. First, let us write a recurrence relation for O n (p, q). Since each combination of [n] either contains n or not, we have where O n (p, q|n) is the generating function for the number of combinations of [n] that contain n according to the statistics card and op. Since each combination π of [n] that contains n either has that the second maximal element in π is j, 1 ≤ j ≤ n − 1 or π has only one element, we obtain Therefore, by induction on n, we have P n (p, q|n) = pq 4 (q 2 + pq 3 ) n−1 , for all n ≥ 1.
with O 0 (p, q) = 1. Hence, we can state the next result.
By differentiating O n (1, q) at q = 1, we obtain that the total outer-perimeter over all combinations of [n] is given by 1 + (5n − 2)2 n−1 . Thus, the average number of outer site-perimeter over all combinations of [n] is asymptotic to 5n−2 2 .

Inner site-perimeter
Let I n (p, q) be the generating function for the number of combinations π of [n] according to the statistics card and ip, namely, Here, we define I 0 (p, q) = 1. Moreover, we define I n (p, q|a 1 a 2 · · · a s ) = π=π a1a2···as∈Cn p card(π) q ip(π) .
First, let us write a recurrence relation for I n (p, q). Since each combination of [n] either contains n or not, we have I n (p, q) = I n−1 (p, q) + I n (p, q|n), By the definitions, we have I n (p, q|n) = pq n + n−1 j=1 I n (p, q|jn).
Note that if a combination π contains the letters j and n, then there is no letter i in π such that j < i < n. So, by exchanging the letter n by letter j + 1, we obtain I n (p, q|n) = pq n + n−1 j=1 q n−1−j I j+1 (p, q|j(j + 1)), Moreover, for j ≥ 2, Again, if a combination π contains the letters i, j, and j + 1, then there is no letter s in π such that i < s < j. So, by exchanging the letter j by letter i + 1, we obtain which implies I j+1 (p, q|j(j + 1)) − q 2 I j (p, q|(j − 1)j) = pq 3 I j (p, q|(j − 1)j).
By differentiating I n (1, q) at q = 1, we obtain that the total inner-perimeter over all combinations of [n] is given by 6 + 2n + (5n − 12)2 n−1 . Thus, the average number of inner site-perimeter over all combinations of [n] is asymptotic to 5n−12 2 .