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:

Equiv_classes Calculator

Equiv_classes

Function: equiv_classes (<s>, <F>) Returns a set of the equivalence classes of the set <s> with respect to the equivalence relation <F>.

equiv_classes ({0, 1, 2, 3, 4, 5, 6},                                 lambda ([x, y], is (equal (x, y))));
 equiv_classes ({1, 1.0, 2, 2.0, 3, 3.0}, equal);
 equiv_classes ({1, 2, 3, 4, 5, 6, 7},                               lambda ([x, y], remainder (x - y, 3) = 0));

<F> is a function of two variables defined on the Cartesian product of <s> with <s>. The return value of <F> is either true or false, or an expression <expr> such that is(<expr>) is either true or false.

When <F> is not an equivalence relation, equiv_classes accepts it without complaint, but the result is generally incorrect in that case.

Examples:

The equivalence relation is a lambda expression which returns true or false.

          (%i1) equiv_classes ({1, 1.0, 2, 2.0, 3, 3.0},
                                  lambda ([x, y], is (equal (x, y))));
          (%o1)            {{1, 1.0}, {2, 2.0}, {3, 3.0}}

The equivalence relation is the name of a relational function which is evaluates to true or false.

          (%i1) equiv_classes ({1, 1.0, 2, 2.0, 3, 3.0}, equal);
          (%o1)            {{1, 1.0}, {2, 2.0}, {3, 3.0}}

The equivalence classes are numbers which differ by a multiple of 3.

          (%i1) equiv_classes ({1, 2, 3, 4, 5, 6, 7},
                               lambda ([x, y], remainder (x - y, 3) = 0));
          (%o1)              {{1, 4, 7}, {2, 5}, {3, 6}}

(%o1)                                true
(%i2) 

Equiv_classes Example

Related Examples

equiv_classes

s:{1, 1.0, 2, 2.0, 3,...

equiv_classes(s,"=");

Calculate

equiv_classes-is-lambda

equiv_classes ({1, 1....

Calculate

equiv_classes

? equiv_classes;

Calculate

equiv_classes

? equiv_classes;

Calculate

equiv_classes-is-lambda

equiv_classes ({1, 1....

Calculate