A finite inversion formula for ternary words with three independent weights
A finite inversion formula for ternary words with three independent weights How can the joint distribution of the three inversion counts in a ternary word be evaluated when the multiplicities are fixed? Max Alekseyev asks for a closed formula with three independent weights in the original post of MathOverflow question 446914, edited on 16 May 2023 at 16:25 UTC. The answer is a nonrecursive finite sum with one term for each binary word obtained by deleting all zeros. Alekseyev's original question Let \(m,n,k\) be any nonnegative integers giving the multiplicities of \(0,1,2\), respectively. For a word \(x\), let \(I_{10}(x),I_{20}(x),I_{21}(x)\) count pairs of positions in which the indicated larger letter precedes the smaller one. With independent commuting weights \((u,v,w)=(q_{01},q_{02},q_{12})\), set \(f_{m,n,k}(u,v,w)=\sum_x u^{I_{10}(x)}v^{I_{20}(x)}w^{I_{21}(x)}\), where \(x\) ranges over all words with the given multiplicities. Then \[f_{m,n,k}(u,v,w)=\sum_{b_0+\cdots+b_k=n}w^{\sum_{i=0}^k i b_i}\,[z^m]\prod_{i=0}^k\prod_{s=0}^{b_i}(1-z u^{B_i+s}v^i)^{-1},\qquad B_i=\sum_{r=0}^{i-1}b_r. \] The sum is over weak compositions \(b=(b_0,\ldots,b_k)\), so empty runs are allowed. Each \(b\) specifies a binary word whose \(i\)th run of ones, of length \(b_i\), follows exactly \(i\) twos. That word contributes \(\sum_i i b_i\) inversions of type \(21\). A zero inserted after \(s\) ones of that run has \(B_i+s\) preceding ones and \(i\) preceding twos, and therefore contributes the weight \(u^{B_i+s}v^i\). The geometric factors record the number of zeros placed in each slot, and the coefficient of the auxiliary variable \(z\) enforces a total of \(m\). The \(\binom{n+k}{k}\) binary words and their slot weights can be reused for every \(m\). Write \(D=n+k+1\) for the number of slots in each binary word and \(\mathcal A_b\) for the multiset of their weights \(u^{B_i+s}v^i\). When the \(D\) weights within a term are pairwise distinct, the coefficient in that term can be evaluated as the finite sum \[\sum_{\alpha\in\mathcal A_b}\frac{\alpha^{m+D-1}}{\prod_{\beta\in\mathcal A_b,\,\beta\ne\alpha}(\alpha-\beta)}. \] The coefficient formula is polynomial in \(u,v,w\) and applies to every specialization, including coincident slot weights, zero weights, and an empty binary word. The same MathOverflow post proposes \(f_{m,n,k}(q,1,q)=\binom{m+k}{m}{m+n+k\brack n}_q\), where \({N\brack r}_q\) is the Gaussian binomial coefficient. As a polynomial identity, it holds exactly when at least one of \(m,n,k\) is zero. If all three are positive, the left constant coefficient is \(1\) because only the word with all zeros before all ones and all ones before all twos avoids both charged inversion types. The right constant coefficient is \(\binom{m+k}{m}>1\). In particular, \(f_{1,1,1}(q,1,q)=1+4q+q^2\). Alekseyev's original question and proposed specialization Steel's pairwise rank-sum recursion already gives the same joint coefficients after a deterministic rank shift. Wocjan's independently weighted shuffle encodes the general polynomial, and his predecessor-uniform product gives \(f_{m,n,k}(u,q,q)={m+n\brack m}_u{m+n+k\brack k}_q\) in this letter order. The slot formula gives a finite evaluation with all three weights free. Steel, Sections 4–5 · Wocjan, Proposition 3.11
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24776837
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint