Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Subset Calculator

Subset

Function: subset (<a>, <f>) Returns the subset of the set <a> that satisfies the predicate <f>.

subset returns a set which comprises the elements of <a> for which <f> returns anything other than false. subset does not apply is to the return value of <f>.

subset complains if <a> is not a literal set.

See also partition_set.

Examples:

          (%i1) subset ({1, 2, x, x + y, z, x + y + z}, atom);
          (%o1)                     {1, 2, x, z}
          (%i2) subset ({1, 2, 7, 8, 9, 14}, evenp);
          (%o2)                      {2, 8, 14}

There are also some inexact matches for subset. Try ?? subset to see them.

(%o1)                                true
(%i2) 

Subset Example

Related Examples

subset

subset;

{1,14, 17, 2, 20};

Calculate

subset

subset;

{7,8,9};

Calculate

subset

subset;

{1,2,3,4,5,6};

Calculate

subset

subset;

{18897109, 12828837,...

Calculate

subset

subset;

{1,2,3,4,5,6};

Calculate

subset

subset;

{7,8,9};

Calculate

subset

subset;

{1,2,3,4,5,6};

Calculate

subset

subset;

{1,2,3};

Calculate

subset

subset;

{2,3,4,5};

Calculate