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: Changing a list with the information of other
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Joaquim Nogueira

Posts: 21
Registered: 12/13/04
Changing a list with the information of other
Posted: Jul 2, 2013 12:32 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Good morning

I have the following (possibly very simple) problem.
I have a list, created using a Table

{{0, 1}, {1, w}, {2, 1 + w}, {3, 1 + 2 w}, {4, 2}, {5, 2 w}, {6, 2 + 2 w}, {7, 2 + w}}.

Then, using another Table, I created the list

{1, 1 + w, 2 + w, 2 w, 2, 2 + 2 w, 1 + 2 w, w}

Note that all these elements appear always in second place, in the ordered pairs of the first list. What I want is an instruction that allows to replace all these elements by the ones that appear first in the ordered pairs above. That is, I would like to replace this list by the new one

{0, 2, 7, 5, 4, 6, 3, 1}.

As you may guess this is only of interest when the lists are very big (with thousands of elements).

Thank you




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.