Discrete Mathematics & Theoretical Computer Science |
A composition $\pi = \pi_1 \pi_2 \cdots \pi_m$ of a positive integer $n$ is an ordered collection of one or more positive integers whose sum is $n$. The number of summands, namely $m$, is called the number of parts of $\pi$. Using linear algebra, we determine formulas for generating functions that count compositions of $n$ with $m$ parts, according to the number of occurrences of the subword pattern $\tau$, and according to the sum, over all occurrences of $\tau$, of the first integers in their respective occurrences, where $\tau$ is any pattern of length three with exactly 2 distinct letters.