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 » sci.math.* » sci.math.symbolic.independent

Topic: Is there any efficient easy way to compare two lists with the same
length with Mathematica?

Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Rex

Posts: 23
Registered: 10/13/10
Is there any efficient easy way to compare two lists with the same
length with Mathematica?

Posted: Jan 16, 2012 3:00 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Given two lists with same length, `A={a1,a2,a3,...an}` and
`B={b1,b2,b3,...bn}`, I would say `A>=B` if and only if all `ai>=bi`.

There is a built-in comparison of two lists, `A==B` and `A-B`, but no
`A>B`.
Do we need to compare each element like this

And@@Table[A[[i]]>=B[[i]],{i,n}]

Any better tricks to do this?



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.