union - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


MultiSet/union

MultiSet union operator

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

M union N

`union`( M, N, ... )

Parameters

M

-

MultiSet; a MultiSet, set, or list

N

-

MultiSet; a MultiSet, set, or list

...

-

0 or more additional MultiSets, sets or lists

Description

• 

M union N returns the MultiSet which is the elementwise maximum of M and N by multiplicity.  For example, if a has multiplicity 2 in M and 3 in N then it will have multiplicity 3 in M union N.

• 

Note that this definition of union preserves idempotency: M union M = M.  To obtain the MultiSet comprised of the totality of elements of a collection of MultiSets, use addition: M + N.

• 

The `union`( M, N, ... ) command performs the n-ary union of its arguments.

• 

At least one argument must be a MultiSet for this routine to be invoked.  Any other argument which is expected to be a MultiSet can be a MultiSet, a set or a list; in the latter two cases the argument is converted to a MultiSet before proceeding to evaluate this command.  IsGeneralized(M) must return the same value for all MultiSet arguments M, and all non-MultiSet arguments will be promoted to MultiSets with this same property.

Examples

MMultiSeta=2,b=5,c=4

Ma,2,b,5,c,4

(1)

NMultiSeta=4,c=3,d=7

Na,4,c,3,d,7

(2)

MunionN

a,4,b,5,c,4,d,7

(3)

MunionNunionb,c,c,e

a,4,b,5,c,4,d,7,e,1

(4)

Compatibility

• 

The MultiSet/union command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

MultiSet

MultiSet/intersect

MultiSet/minus

MultiSet/plus

MultiSet/subset

MultiSet/symmdiff