Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7063267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:41:37+00:00 2026-05-28T04:41:37+00:00

Given two lists A={a1,a2,a3,…an} and B={b1,b2,b3,…bn} , I would say A>=B if and only

  • 0

Given two lists 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 logical comparison of two lists, 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?

EDIT:
Great thanks for all of you.

Here’s a further question:

How to find the Maximum list (if exist) among N lists?

Any efficient easy way to find the maximum list among N lists with the same length using Mathematica?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:41:38+00:00Added an answer on May 28, 2026 at 4:41 am

    Method 1: I prefer this method.

    NonNegative[Min[a - b]]
    

    Method 2: This is just for fun. As Leonid noted, it is given a bit of an unfair advantage for the data I used.
    If one makes pairwise comparisons, and return False and Break when appropriate,
    then a loop may be more efficient (although I generally shun loops in mma):

    result = True;
    n = 1; While[n < 1001, If[a[[n]] < b[[n]], result = False; Break[]]; n++]; result
    

    Some timing comparisons on lists of 10^6 numbers:

    a = Table[RandomInteger[100], {10^6}];
    b = Table[RandomInteger[100], {10^6}];
    
    (* OP's method *)
    And @@ Table[a[[i]] >= b[[i]], {i, 10^6}] // Timing
    
    (* acl's uncompiled method *)
    And @@ Thread[a >= b] // Timing
    
    (* Leonid's method *)
    lessEqual[a, b] // Timing
    
    (* David's method #1 *)
    NonNegative[Min[a - b]] // Timing
    

    timings 2


    Edit: I removed the timings for my Method #2, as they can be misleading. And Method #1 is more suitable as a general approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a built-in routine for doing numerical integration in Mathematica given two lists
I need to retrieve all items from two lists that contains a given value.
Given two lists, I can produce a list of all permutations the Cartesian Product
Given two sorted lists, each containing n real numbers, is there a O(log n)
For a given integer, n , I need to print all the lists of
Given two Lists, each list holding the same object type, I would like to
Is there a way to merge(union without dupes) two given lists into one and
Given two lists (IList) A and B. I would like to use linq to
Given two lists, which contain same elements of string but in different orders, is
Given two lists of equal length, is there a simpler or preferred way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.