Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: identical rows in tables
Replies: 3   Last Post: Mar 17, 2009 6:01 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
King, Peter R

Posts: 32
Registered: 11/15/05
identical rows in tables
Posted: Mar 16, 2009 5:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a table of values

e.g.{{1, 2, 3, 4, 5, 6, 7, 8}, {1, 4, 6, 2, 8, 3, 7, 5}, {1, 4, 2, 6, 3,
8, 5, 7}, {1, 3, 2, 5, 4, 7, 6, 8}, {1, 3, 5, 2, 7, 4, 8, 6}, {1, 2,
4, 3, 6, 5, 8, 7}, {1, 2, 3, 4, 5, 6, 7, 8}}

and want to check if any rows are identical (so there are none in the above=
- I can remove last or first row which are supposed to be the same).

But in the following {{1, 2, 3, 4, 5, 6, 7, 8}, {1, 4, 6, 2, 8, 3, 7, 5}, {=
1, 4, 2, 6, 3,
8, 5, 7}, {1, 3, 2, 5, 4, 7, 6, 8}, {1, 3, 5, 2, 7, 4, 8, 6}, {1, 8,
7, 6, 5, 4, 3, 2}, {1, 8, 6, 7, 4, 5, 2, 3}, {1, 3, 2, 5, 4, 7, 6,
8}, {1, 3, 5, 2, 7, 4, 8, 6},....}

there is a pair {1, 3, 2, 5, 4, 7, 6,
8}, {1, 3, 5, 2, 7, 4, 8, 6} which are the same.

In an ideal world when I print out (in say TableForm) the repeated rows ca=
n be printed in red (or some specified colour)

These rows are permutations if that makes any difference. The tables can be=
of any size (but always permutations of n numbers)

as a subsidiary question is there an easy way to convert the tables into nu=
mbers (or strings) eg

{12345678,14628375,14263857 etc}

Alternatively is there an easy way to perform permutations on strings of ch=
aracters?

Many thanks for your help to the multiple questions
ps I am using Mathematica 6.03




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.