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: Re: Reordering lists?!
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Gennady

Posts: 9
Registered: 12/7/04
Re: Reordering lists?!
Posted: Aug 1, 1996 2:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <4tkbna$q63@dragonfly.wolfram.com> Paul Abbott,
paul@physics.uwa.edu.au writes:
>Andre and Alain wrote:
>

>> Hey! I have a list of Numbers, 1 to 4, and wish to rescale them so
>> that 1 replkaces 4 and 3 replaces 2 and 2 replaces 3 etc. I made a
>> little code to do this on an element per element basis and it doesn't
>> seem to do
>> it! Could someone let me know what I'm doing wrong or whether it's a
>> Mma problem? Thanks



After having read different answers to this problem, I noticed that
the simplest way to get the result somehow evaded the respectable
mathgroupers. Here it is:

In[1]:=
list={2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 2, 1, 2, 1,
2, 1, 1,
1, 1, 2, 1, 2, 1, 3, 1,
2, 2, 1, 2, 1, 2, 3, 2, 4, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1,
2,
3, 2, 2, 2, 1, 2, 1,
2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1};

In[2]:=
5-list

Out[2]=
{3, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 3, 3, 4, 4, 2, 4, 4, 3,

4, 3, 4, 3, 4, 4, 4, 4, 3, 4, 3, 4, 2, 4, 3, 3, 4, 3,

4, 3, 2, 3, 1, 4, 4, 4, 4, 3, 4, 4, 4, 4, 3, 3, 3, 4,

3, 4, 3, 2, 3, 3, 3, 4, 3, 4, 3, 3, 3, 3, 3, 3, 4, 4,

4, 4, 4, 4, 3, 3, 3, 4}

Regards,
Gennady.







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.