Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Correlating two lists

  • To: mathgroup at
  • Subject: [mg100150] Correlating two lists
  • From: anguzman at
  • Date: Tue, 26 May 2009 05:11:05 -0400 (EDT)
  • References: <gv2jr1$9af$>

Hi all.
I have the following problem:
Two lists: "x" and "y";  and a boolean relation R[a,b] with a in x and 
b in y, and for each "a" there is at most one "b" in "y" such that 
R[xi,yj]is true.
R is also "expensive" to calculate. I would like to group each xi in 
"x" with its partner in "y" (if there is one) and create a merged list:
such that R[xi,yi]  is true
I'm looking for the adequate Mathematica function to do this as 
efficiently as possible. by the way, I'm using now this 
straightforward-naive approach:


but I'm sure there must be a better one (without the Do's would be beautiful).
Any thoughts will be greatly appreciated.
Thanks in advance, and cheers for the 100.000

Atte. Andres Guzman

This message was sent using IMP, the Internet Messaging Program.

  • Prev by Date: Re: NIntegrate & Integrate
  • Next by Date: Re: Accessing Dictionary definitions
  • Previous by thread: Re: uncomplete NDSOlve results
  • Next by thread: Re: Correlating two lists