Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Replacing elements of list' topicStudent Support Forum > General > Archives > "Replacing elements of list"

Next Comment >Help | Reply To Topic
Author Comment/Response
yedidel
06/27/08 06:35am

Hello,

I have a list of pairs that looks like this:

{{1,2},{3,4},{1,{1,2}}}

Each pair element can be a pair by itself.

I have another list which lists all elements possible:
{1,2,3,4,{1,2}}

Now I want to create a list of rules that will take the element list and give it a running number ({1,2} will be 5 in this example)

after that I want to apply those rules to the pair list BUT that will do it only from the second level down. This means that the final result should be:

{{1,2},{3,4},{1,5}}
without the first pair {1,2} changing to 5 because it is a pair and not an element.



URL: ,

Subject (listing for 'Replacing elements of list')
Author Date Posted
Replacing elements of list yedidel 06/27/08 06:35am
Re: Replacing elements of list yehuda ben-s... 06/27/08 4:22pm
Re: Replacing elements of list Xavier 06/27/08 5:08pm
Next Comment >Help | Reply To Topic