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


Groups > comp.soft-sys.math.mathematica > #6956

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

From Adriano Pascoletti <adriano.pascoletti@uniud.it>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to get elements satisfying specific condition from a list
Date 2011-12-06 03:17 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jbk1fp$fkc$1@smc.vnet.net> (permalink)

Show all headers | View raw


In[3]:= Cases[B, {x_Integer, y_Integer} /; x + y > 9, {2}]
Out[3]= {{4, 6}, {5, 5}, {5, 6}, {6, 4}, {6, 5}, {6, 6}}


Adriano Pascoletti

2011/12/4 e-changb <e-changb@hanmail.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 ?
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: How to get elements satisfying specific condition from a list Adriano Pascoletti <adriano.pascoletti@uniud.it> - 2011-12-06 03:17 +0000

csiph-web