Re: List operations
- To: mathgroup at smc.vnet.net
- Subject: [mg25463] Re: [mg25399] List operations
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Sun, 1 Oct 2000 02:44:47 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In[1]:= listA = {{2, 8}, {1, 3}, {4, 1}, {3, 5}, {4, 6}, {1, 4}, {1, 5}, {1, 5}, {9, 3}, {6, 7}}; In[2]:= Select[listA, 3*#[[1]] + #[[2]]^2 == 12 &] Out[2]= {{1, 3}} Tomas Garza Mexico City "Matt Herman" <Henayni at hotmail.com> wrote: > Suppose I have a list of ordered pairs {{a1,b1},{a2,b2},...,{an,bn}}. > What is an efficient way of pulling out all the pairs such that, if I do > an operation on the first element in the list, and another on the > second, and I sum them, they equal some predetermined constant? > > For instance, say 3*listpart[[1]]+listpart[[2]]^2