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:

Partition_set Calculator

Partition_set

Function: partition_set (<a>, <f>) Partitions the set <a> according to the predicate <f>.

a : set(a,b,c);
b: powerset(a);
c:disjoin({},b);
c:disjoin(a,c);
c;
	partition_set(c,evenp);

partition_set returns a list of two sets. The first set comprises the elements of <a> for which <f> evaluates to false, and the second comprises any other elements of <a>. partition_set does not apply is to the return value of <f>.

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

See also subset.

Examples:

          (%i1) partition_set ({2, 7, 1, 8, 2, 8}, evenp);
          (%o1)                   [{1, 7}, {2, 8}]
          (%i2) partition_set ({x, rat(y), rat(y) + z, 1},
                               lambda ([x], ratp(x)));
          (%o2)/R/              [{1, x}, {y, y + z}]

(%o1)                                true
(%i2) 

Partition_set Example

Related Examples

partition_set

? partition_set;

Calculate

partition_set

? partition_set;

Calculate