= Inversion of a word
= Inversions of a word
{synonym}
= Word inversion
{synonym}
For a <word> $w=w_1\cdots w_n$ over a totally ordered <alphabet>, an <inversion of a word> is a pair of positions $i<j$ with $w_i>w_j$. Equal symbols contribute no <inversion of a word>. In `baba`, with $a<b$, the pairs are $(1,2),(1,4),(3,4)$, so the <word inversion number> is three. <Counting> these pairs records distance from sorted order even when letters repeat; replacing the letters by distinct ordered labels gives the <inversion of a permutation> case.
Back to article page