get or set the multiplicity of an element of a MultiSet
M[x] := n;
MultiSet; a MultiSet
anything, an expression
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
Mb ≔ 7
Ma ≔ 0
Mc ≔ 4
N ≔ MultiSetgeneralized⁡
Nw ≔ 3.14159
Download Help Document
What kind of issue would you like to report? (Optional)