VOOZH about

URL: https://mathworld.wolfram.com/LexicographicOrder.html

⇱ Lexicographic Order -- from Wolfram MathWorld


πŸ‘ Image

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 Order

Explore 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 Order

Cite this as:

Weisstein, Eric W. "Lexicographic Order." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LexicographicOrder.html

Subject classifications