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:

Union Calculator

Union

Function: union (<a_1>, ..., <a_n>) Returns the union of the sets <a_1> through <a_n>.

load(graphs);
A : create_graph(10, [[0, 2], [1, 2], [1, 3], [2, 3], [3, 4], [4, 5], [4, 9], [7, 6], [6, 5], [8, 7], [7, 5], [9, 8]]);
G(s) := (z : A, s : string(s), n : slength(s), for i from 1 thru n do (z : graph_union(z,A), remove_edge([10*i - 1, 10*i - 2], z), if charat(s,i)="1" then add_edges([[10*i-2,10*i],[10*i-1,10*i+1],[10*i-1,10*i+6]],z) else add_edges([[10*i-1,10*i],[10*i-2,10*i+1],[10*i-1,10*i+6]],z)), z);
draw_graph(G(100),show_id=true);

union() (with no arguments) returns the empty set.

union complains if any argument is not a literal set.

Examples:

          (%i1) S_1 : {a, b, c + d, %e};
          (%o1)                   {%e, a, b, d + c}
          (%i2) S_2 : {%pi, %i, %e, c + d};
          (%o2)                 {%e, %i, %pi, d + c}
          (%i3) S_3 : {17, 29, 1729, %pi, %i};
          (%o3)                {17, 29, 1729, %i, %pi}
          (%i4) union ();
          (%o4)                          {}
          (%i5) union (S_1);
          (%o5)                   {%e, a, b, d + c}
          (%i6) union (S_1, S_2);
          (%o6)              {%e, %i, %pi, a, b, d + c}
          (%i7) union (S_1, S_2, S_3);
          (%o7)       {17, 29, 1729, %e, %i, %pi, a, b, d + c}
          (%i8) union ({}, S_1, S_2, S_3);
          (%o8)       {17, 29, 1729, %e, %i, %pi, a, b, d + c}

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

(%o1)                                true
(%i2) 

Union Example

Related Examples

union

M1:{49,23,27,665};

M2:{9,23,37,49,66,88};

M3:{48,665,666};

Calculate

union

a: {};

b: {1};

c: {0};

Calculate

union

A: {.75};

B: {.83};

C: union(A, B) * 100;

Calculate

union

A: {.75};

B: {.83};

C: union(A, B) * 100;

Calculate

union

M1:{49,23,27,665};

M2:{9,23,37,49,66,88};

M3:{48,665,666};

Calculate

union

A : {1,2,3};

B : {a,b};

union(A,B);

Calculate

union

A: {.75};

B: {.83};

union(A, B);

Calculate

union

A:set(1,2,3,4,5,6,7,8);

B:set(2,4,6,8,10,12,1...

C:set(3,6,9,12,18);

Calculate

union

s_1 : {a, b, c + d, %e};

s_2 : {%pi, %i, %e, ...

s_3 : {17, 29, 1729,...

Calculate

union

s_1 : {a, b, c + d, %e};

s_2 : {%pi, %i, %e, ...

s_3 : {17, 29, 1729,...

Calculate