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


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

How to get elements satisfying specific condition from a list

Started bye-changb <e-changb@hanmail.net>
First post2011-12-04 07:56 +0000
Last post2011-12-06 03:14 +0000
Articles 2 — 2 participants

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


Contents

  How to get elements satisfying specific condition from a list e-changb <e-changb@hanmail.net> - 2011-12-04 07:56 +0000
    Re: How to get elements satisfying specific condition from a list "Nasser M. Abbasi" <nma@12000.org> - 2011-12-06 03:14 +0000

#6921 — How to get elements satisfying specific condition from a list

Frome-changb <e-changb@hanmail.net>
Date2011-12-04 07:56 +0000
SubjectHow to get elements satisfying specific condition from a list
Message-ID<jbf94b$l4b$1@smc.vnet.net>
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]


#6953

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-12-06 03:14 +0000
Message-ID<jbk1bf$fjj$1@smc.vnet.net>
In reply to#6921
On 12/4/2011 1:56 AM, e-changb wrote:
> 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 ?
>


may be

b = Table[{x, y}, {x, 1, 6}, {y, 1, 6}];
Select[Flatten[b, 1], #[[1]] + #[[2]] > 9 &]


-->  {{4, 6}, {5, 5}, {5, 6}, {6, 4}, {6, 5}, {6, 6}}

--Nasser


[toc] | [prev] | [standalone]


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


csiph-web