Lexicographic OrdersThe lexicographic order can be described as an order of the Cartesian product of a minimum two partially ordered sets, X and Y. We can also call the lexicographic order as dictionary order, alphabetic order, and lexicographical order. The lexicographic order is indicated by the symbol <. There are many categories in which we can use the lexicographic order, which is described as follows: Order involving Two setsSuppose there are two partially ordered sets (X, <_{1}) and (Y, <_{2}). We will use the following way to show the lexicographic order < on Cartesian product X * Y: (x, y) < (z, d) If and only if x <_{1} z or (x = z and y <_{2} d). Order Involving N setsWe can also generalize the abovedefined Cartesian product into the n posets. For this, we will assume the partially ordered set (X_{1}, <_{1}), (X_{2}, <_{2}), (X_{3}, <_{3}), …., (X_{n}, <_{n}). We will use the following way to show the lexicographic order < on Cartesian product X_{1}, X_{2}, X_{3}, ……, X_{n}: (x_{1}, x_{2}, x_{3}, …., x_{n}) < (y_{1}, y_{2}, y_{3}, …., y_{n}), Or it can have an integer 0 < i ≤ in such a way that x_{1} = y_{1}, x_{2} = y_{2}, x_{3} = y_{3},….., x_{n1 }= y_{n1 }and a_{i }< b_{i}. From the above explanation, we can say that if X_{1}, X_{2}, X_{3}, ….., X_{n} are the partially ordered set, in this case, the lexicographic order will also be in partial order. Similarly, if there is a proper arrangement (wellordered) of all these sets, in this case, the lexicographic order will be in total order. Ordering of WordsSuppose there is a certain alphabet that is indicated by set X. The letter x1, x2, x3, …., xk of the alphabet X must assume to be strictly totally ordered like this: x_{1} < x_{2} < x_{3} < …. < x_{k}. The strings of length n or words will be indicated by the elements of nth Cartesian power X^{n}. On the basis of the order of symbols, we can determine the order of two words. For this, we will check the first place where two words differ, and we will start checking from the beginning of the words. If there are two words that contain two different lengths, then we will pad the shortest word with the trailing blank characters so that the shortest word can contain the same length as the longest word. If there is any blank symbol, then it must come first before any other symbol in the alphabet. In this way, we can compare the words lexicographically. So with the help of basic Latin alphabet, the name of the city can be sorted in a way that is described as follows:
Cairo < Delhi < Jakarta < Kinshasa < Lagos < London < Los Angeles < Mexico < Moscow < Mumbai < New York < Paris < Shanghai < Tokyo
In order to compare the words of different lengths, we also have one more convention, which is very useful and frequently used for the comparison, and this convention is known as the shortlex order. In the process of shortlex word order, the shortest word will always come before a longer word. On the basis of shortlex ordering, the abovedescribed city will be arranged in the following order:
Cairo < Delhi < Lagos < Paris < Tokyo < London < Mexico < Moscow < Mumbai < Jakarta < Kinshasa < New York < Shanghai < Los Angeles
Ordering of Numeric TuplesSuppose there is A = N. Where, set N^{n} is used to indicate the n tuples of natural numbers. For example: (2, 5, 8, 9) for n = 4, or (1, 4, 10, 15, 18, 20) for n = 6. The lexicographic order is used to compare the n tuples of natural numbers. If we use it to apply the less than order < on the set of natural numbers N, then we can define it in the following way: (x_{1}, x_{2}, x_{3}, …, x_{n}) < (y_{1}, y_{2}, y_{3}, …., y_{n}), Here i ≤ n in such a way that aj = bj for all j < i and ai ≤ bi. For example: (1, 1) < (1, 2) < (1, 3, 2) < (1, 3, 5); (7, 5, 4, 2) < (7, 6, 4, 2). In the same way, we can use the set of other numerical objects and define the lexicographic orders on them. We can define it on R^{n}, which is used to contain the n tuples of real numbers, or Z^{n}, which is used to contain n tuples of integers. Ordering of SubsetsIf there are some objects which are indicated in the form of a list with a partial ordering, in this case, we can use the lexicographic order so that we can sort any object. Here we have to order the subsets of set X that have n number of elements. These can be called the subset of size k or all subsets of the power set of X. We should remember that the order of elements within the subsets will not matter in case of defining the ordering of subsets. Therefore, on the basis of the implied or given ordering rules first, we will arrange them in increasing order. So with the help of standard less than order, we can arrange the numbers, and with the help of alphabetic order, we can sort the letter. After that, we are able to apply the lexicographic ordering to subsets. For example: In this example, we have a subset of X = {x, y, z, d}, and we will show it in lexicographic orders in the following way: Φ < {x} < {x, y} < {x, y, z} < {x, y, z, d} < {x, y, d} < {x, z} < {x, z, d} < {x, d} < {y} < {y, z} < {y, z, d} < {y, d} < {z} < {z, d} < {d} Lexicographic order in Normal languageA lexicographic order can be described as an arrangement of words, characters, or numbers in alphabetic order. The letters of this order must be sorted from A to Z. The lexicographic order can also be called the dictionary order. This is because the search for lexicographic order and the search for a particular word in an actual dictionary is similar to each other. For this, we will begin our search from the section that has those types of words that begin with the first letter of desired word. After this, we will start from that section, and start our search for those words that have the second letter of the desired word, and the process will go on. Now we will understand the lexicographic order with the help of an example, which is described as follows: In the start of this example, we have a list of prime numbers, i.e., {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}. When we arrange these prime numbers with the help of lexicographic order, then the list will become: {11, 13, 17, 19, 2, 23, 29, 3, 5, 7}. Now we will discuss one more example so that we can more understand the lexicographic order. In the above example, there is a list of two words, i.e., {educative, educated}. Now we will sort this twoword list with the help of lexicographic order. For this, we will compare these two words letter by letter, and then we will sort these letters in the alphabetic order. After this, we will get our result in the form of a list like this {educated, educative}. Examples of Lexicographic orderThe lexicographic order contains a lot of examples, and some of them are described as follows: Example 1: In this example, we have to use the lexicographic order, which has less than a relation, and we have to define the Cartesian square A^{2} with the help of this order, where A = {1, 2, 3, 4}. Here we have to determine all pairs of A^{2} which are greater than (3, 2). Solution: The lexicographic order on A^{2} will be represented as follows: (1, 1) < (1, 2) < (1, 3) < (1, 4) < (2, 1) < (2, 2) < (2, 3) < (2, 4) < (3, 1) < (3, 2) < (3, 3) < (3, 4) < (4, 1) < (4, 2) < (4, 3) < (4, 4). Now from the above pairs, we will select that pairs that are greater than (3, 2), which are described as follows: (3, 3), (3, 4), (4, 1), (4, 2), (4, 3), (4, 4) Example 2: In this example, we have to use the lexicographic order, which has less than a relation, and we have to define the Cartesian square B^{3} with the help of this order, where B = {1, 2, 3}. Here we have to determine all elements in B^{3} which are greater than (2, 1, 3) and less than (3, 2, 1). Solution: The lexicographic order on the list of elements of B^{3} will be represented as follows: (1, 1, 1) < (1, 1, 2) < (1, 1, 3) < (1, 2, 1) < …. < (3, 2, 3) < (3, 3, 1) < (3, 3, 2) < (3, 3, 3) Now from the above pairs, we will select that pairs that are greater than (2, 1, 3) and less than (3, 2, 1), which are described as follows: (2, 2, 1), (2, 2, 2), (2, 2, 3), (2, 3, 1), (2, 3, 2), (2, 3, 3), (3, 1, 1), (3, 1, 2), (3, 1, 3) Example 3: In this example, we have a list of all 3 subsets of set {x, y, z, u, v}, and we have to arrange them in the lexicographic order. Solution: The lexicographic order on the list of all 3 subsets of set {x, y, z, u, v} will be represented as follows: {x, y, z} < {x, y, u} < {x, y, v} < {x, z, u} < {x, z, v} < {x, u, v} < {y, z, u} < {y, z, v} < {y, u, v} < {z, u, v}. Example 4: In this example, we have a list of all 4 subsets of set {1, 2, 3, 4, 5, 6}, and we have to arrange them in the lexicographic order. Solution: The lexicographic order on the list of all 4 subsets of set {1, 2, 3, 4, 5, 6} will be represented as follows: {1, 2, 3, 4} < {1, 2, 3, 5} < {1, 2, 3, 6} < {1, 3, 4, 5} < {1, 3, 4, 6} < {1, 4, 5, 6} < {2, 3, 4, 5} < {2, 3, 4, 6} < {2, 4, 5, 6} < {3, 4, 5, 6}. Example 5: In this example, there are two posets (A, ≤) and , where A = {1, 2, 3} and P(A) are used to indicate the power set of A. Here we have a lexicographic order with less than relation (<), which is defined on the Cartesian product A * P(A). Now we have to find out whether the following statements are true or false.
Solution:
Example 6: In this example, there are two posets (B, ) and where B = {2, 3, 4, 8}, "". Here  is used to indicate the divisibility relation, and P(A) is used to indicate the power set of B. Here we have a lexicographic order with less than relation (<), which is defined on the Cartesian product B * P(B). Now we have to find out whether the following statements are true or false.
Solution:
Important PointsThere are some important points related to lexicographic order, and some of them are described as follows:
