Lexicographic Order
An ordering for the Cartesian product π Γ
of any two sets π A
and π B
with order relations π <A
and π <B
, respectively, such that if π (a_1,b_1)
and π (a_2,b_2)
both belong to π AΓB
, then π (a_1,b_1)<(a_2,b_2)
iff either
1. π a_1<Aa_2
,
or
2. π a_1=a_2
and π b_1<Bb_2
.
The lexicographic order can be readily extended to cartesian products of arbitrary length by recursively applying this definition, i.e., by observing that π AΓBΓC=AΓ(BΓC)
.
When applied to permutations, lexicographic order is increasing numerical order (or equivalently, alphabetic order for lists of symbols;
Skiena 1990, p. 4). For example, the permutations
of π {1,2,3}
in lexicographic order are 123, 132, 213, 231, 312, and 321.
When applied to subsets, two subsets are ordered by their smallest elements (Skiena 1990, p. 44). For example, the subsets of π {1,2,3}
in lexicographic order are π {}
, π {1}
, π {1,2}
, π {1,2,3}
, π {1,3}
, π {2}
, π {2,3}
, π {3}
.
Lexicographic order is sometimes called dictionary order.
See also
Order, Monomial Order, Transposition OrderExplore with Wolfram|Alpha
References
Ruskey, F. "Information on Combinations of a Set." http://www.theory.csc.uvic.ca/~cos/inf/comb/CombinationsInfo.html.SΓ©roul, R. Programming for Mathematicians. Berlin: Springer-Verlag, p. 23, 2000.Skiena, S. "Lexicographically Ordered Permutations" and "Lexicographically Ordered Subsets." Β§1.1.1 and 1.5.4 in Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley, pp. 3-5 and 43-44, 1990.Referenced on Wolfram|Alpha
Lexicographic OrderCite this as:
Weisstein, Eric W. "Lexicographic Order." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LexicographicOrder.html
