MultiSet Selection
get or set the multiplicity of an element of a MultiSet
Calling Sequence
Parameters
Description
Examples
M[x]
M[x] := n;
M
-
MultiSet; a MultiSet
x
anything, an expression
n
numeric, the new multiplicity of x in M
M[x] returns the multiplicity of the member x of the MultiSet M.
M[x] := n sets the multiplicity of x in M to n. Note that this is different from Insert( M, x=n ), which increases the multiplicity of x in M by n.
Note M[x] := 0 is equivalent to Remove( M, x ).
If M is a generalized MultiSet, n may be any real number. Otherwise, it must be a non-negative integer.
M≔MultiSet⁡a=2,b=5
M≔a,2,b,5
Ma
2
Mb≔7
Ma≔0
Mc≔4
b,7,c,4
N≔MultiSetgeneralized⁡
N≔∅
Nw≔3.14159
N
w,3.14159
See Also
MultiSet
MultiSet/Insert
MultiSet/Remove
Download Help Document