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:

Cardinality Calculator

Cardinality

Function: cardinality (<a>) Returns the number of distinct elements of the set <a>.

num_partitions (5) = cardinality (integer_partitions (5));
 num_partitions (8, list);
 num_partitions (n);

cardinality ignores redundant elements even when simplification is disabled.

Examples:

          (%i1) cardinality ({});
          (%o1)                           0
          (%i2) cardinality ({a, a, b, c});
          (%o2)                           3
          (%i3) simp : false;
          (%o3)                         false
          (%i4) cardinality ({a, a, b, c});
          (%o4)                           3

(%o1)                                true
(%i2) 

Cardinality Example

Related Examples

cardinality

cardinality ({{},{2,{...

Calculate

cardinality-false-simp

cardinality ({});

cardinality ({a, a, ...

simp : false;

Calculate

cardinality-false-simp

cardinality ({1,{{1}}});

cardinality ({a, a, ...

simp : false;

Calculate

cardinality-false-simp

cardinality ({1,{2,3,...

cardinality ({a, a, ...

simp : false;

Calculate

cardinality-false-simp

cardinality ({1,2,3,4...

cardinality ({a, a, ...

simp : false;

Calculate

cardinality-false-simp

cardinality ({});

cardinality ({0, 1, ...

simp : false;

Calculate

cardinality

cardinality ({0, a, {...

Calculate

cardinality-false-simp

cardinality ({{{{}}}});

cardinality ({a, a, ...

simp : false;

Calculate

cardinality

cardinality ({{0},2});

Calculate

cardinality-false-simp

cardinality ({null, {...

cardinality ({a, a, ...

simp : false;

Calculate