Lexicographic and colexicographic order
Lexicographic (Lex) and colexicographic (CoLex) order are probably the most important ways to order tuples in mathematics.
Lex order is that of a dictionary.
CoLex order is obtained by reflecting all tuples, applying Lex order, and reflecting the tuples again.
Lex order is more intuitive for most people.
CoLex order is more practical when the finite sets of tuples to be ordered shall be generalized to infinite sets of sequences.
Both orderings can be reversed, so there are actually four different orderings.
They can also be reflected (see here), but that's not a different ordering of the set of tuples, but just a certain ordering written in a different way.
When the set of tuples contains all reflections, each reflected order is equal to some of the four others (see below).
Contents |
Combinations [edit]
The sequence of the
k-subsets of
in CoLex order
is the beginning of the infinite sequence of k-subsets of
in CoLex order.
This corresponds to the increasing sequence
A014311 = 7,11,13,14,19,21...
In the file on the left it can be seen that the blue patterns are horizontally reflected.
However, this is not the case in the file on the right, which shows only some of the subsets.
| Combinations with repetition |
|---|
Permutations [edit]
Permutations are often shown in Lex order (see here),
but RevCoLex is the order that works for an infinite number of permutations
and corresponds to the CoLex order of the permutations' inversion vectors (shown in red in the following files, except the one on the right).
|
The 24 permutations of
in RevCoLex orderThis is the top left submatrix of all bigger tables of this kind (compare this one). Here the inversion vectors are shown in g b g r. |
||
| Reflections are redundant |
|---|
Partitions [edit]
Infinite orderings of integer partitions and set partitions can be defined using CoLex ordering.
|
Partitions of 10
The binary vectors are in CoLex order and correspond to the increasing sequence |
| Partitions of a 5-set |
|---|
Walsh functions [edit]
The rows of binary Walsh matrices in Lex and CoLex order give symmetric matrices.
For normal Walsh matrices (with 1 and −1 instead of 0 and 1) RevLex and RevCoLex would give this result.
| Search Wikimedia Commons for images, sounds and other media related to: Lexicographic and colexicographic order |
3-subsets of 
3-subsets of 
3-submultisets of 