# Matrices of higher or lower lexicographical order?

**URL:** <https://community.wolfram.com/t/matrices-of-higher-or-lower-lexicographical-order/880>\
**Category:** Questions\
**Tags:** mathematica\
**Created:** [November 13, 2013, 4:24am UTC](https://community.wolfram.com/t/matrices-of-higher-or-lower-lexicographical-order/880 "2013-11-13T04:24:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![22padrinos](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/22padrinos/32/29645_2.png) [@22padrinos](https://community.wolfram.com/u/22padrinos)\
**Post date:** [November 13, 2013, 4:24am UTC](https://community.wolfram.com/t/matrices-of-higher-or-lower-lexicographical-order/880/1 "2013-11-13T04:24:23Z")

</div>

Hi everybody, I am writing to ask if anyone has any idea about the lexicographic order matrices, this is if I have the following matrices {{1,2,3}, {4,7,5}, {6,0,8}} and {{1, 2,3}, {4,5,0}, {6,7,8}} and {{1,0,3}, {4,2,5}, {6,7,8}} as knowing which has either higher or lower lexicographical order.

I hope someone has understood my question.

---

<div class="post-metadata">

**Author:** ![brucem](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/brucem/32/26319_2.png) [@brucem](https://community.wolfram.com/u/brucem)\
**Post date:** [November 13, 2013, 5:07pm UTC](https://community.wolfram.com/t/matrices-of-higher-or-lower-lexicographical-order/880/2 "2013-11-13T17:07:54Z")

</div>

Are you looking for something like

```auto
In[3]:= Sort[ { {{1, 2, 3}, {4, 7, 5}, {6, 0, 8}}, {{1, 2, 3}, {4, 5, 
    0}, {6, 7, 8}} , {{1, 0, 3}, {4, 2, 5}, {6, 7, 8}} }]

Out[3]= {{{1, 0, 3}, {4, 2, 5}, {6, 7, 8}}, {{1, 2, 3}, {4, 5, 0}, {6,
    7, 8}}, {{1, 2, 3}, {4, 7, 5}, {6, 0, 8}}}

```

In this case, numerical order and lexical order are the same.

The ordering procedure that Sort uses is described in the Details section of [ref/Sort](http://reference.wolfram.com/mathematica/ref/Sort.html) .
