On the average Cartier-Foata height of traces

The height of a trace is the height of the corresponding heap of pieces in X.G. Viennot's formalism, or equivalently the number of components in its Cartier-Foata decomposition. Let h(t) and ∣t∣ be, respectively, the height and the length of a trace t. We prove that the bivariate commutative series ∑tx ∣t∣yh(t) is rational, and we give a finite representation of it. As a by-product we obtain that the asymptotic average height of the traces of a given length is rational and explicitly computable. We show how to exploit the symmetries in the dependence graph to obtain representations of reduced dimensions of the series. For highly symmetric trace monoids, the computations may become very effective. To illustrate this point, we consider the family of trace monoids whose dependence graphs are triangular graphs, i.e., line graphs of complete graphs. We study the combinatorics of this case in details.