Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6946 > unrolled thread

Re: How to get elements satisfying specific condition from a list

Started by"Harvey P. Dale" <hpd1@nyu.edu>
First post2011-12-05 10:31 +0000
Last post2011-12-06 08:18 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to get elements satisfying specific condition from a list "Harvey P. Dale" <hpd1@nyu.edu> - 2011-12-05 10:31 +0000
    Re: How to get elements satisfying specific condition from a list "Nasser M. Abbasi" <nma@12000.org> - 2011-12-06 08:18 +0000

#6946 — Re: How to get elements satisfying specific condition from a list

From"Harvey P. Dale" <hpd1@nyu.edu>
Date2011-12-05 10:31 +0000
SubjectRe: How to get elements satisfying specific condition from a list
Message-ID<jbi6i3$52t$1@smc.vnet.net>
	You can use "Select" to do this.  For example:

		Select[Table[{x, y}, {x, 1, 6}, {y, 1, 6}], Total[#]>9&]

will give you your first desired result, and

		Select[Range[9], Sqrt[#]>2&]

will give you your second desired result.

	Best,

	Harvey


-----Original Message-----
From: e-changb [mailto:e-changb@hanmail.net]
Sent: Sunday, December 04, 2011 2:51 AM
Subject: How to get elements satisfying specific condition
from a list

Hi, please help me if you can.. Let

B:= Table[{x, y}, {x, 1, 6}, {y, 1, 6}]

It is clear that B has 36 elements.

I want to get the list of elements satisfying 'the first component +
second component is bigger than 9'

so that the answer is

{{5,5},{5,6},{6,5},{6,6}}.

In fact, I have no idea for following even simpler problem. : Let A be a
set of all natural numbers less than 10. Find every element whose squre
root is bigger than 2. (needless to say the answer is {5,6,7,8,9})

Can you help me ?

[toc] | [next] | [standalone]


#6965

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-12-06 08:18 +0000
Message-ID<jbkj4f$i3l$1@smc.vnet.net>
In reply to#6946
On 12/5/2011 4:31 AM, Harvey P. Dale wrote:
> 	You can use "Select" to do this.  For example:
>
> 		Select[Table[{x, y}, {x, 1, 6}, {y, 1, 6}], Total[#]>9&]

fyi, Using the above, I get on version 8.04

In[11]:= Select[Table[{x, y}, {x, 1, 6}, {y, 1, 6}], Total[#] > 9 &]

Out[11]= {}

--Nasser

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web