in - Maple Help

# Online Help

###### All Products    Maple    MapleSim

MultiSet/member

test if an expression is a member of a MultiSet

 Calling Sequence member( x, M ) x in M

Parameters

 M - MultiSet; a MultiSet x - anything, an expression

Description

 • member( x, M ) returns true if x is a member of the MultiSet M, false otherwise
 • Note: member( x, M ) is equivalent to evalb( x in M ) and also equivalent to evalb( M[x] <> 0 ).
 • Note: As a MultiSet is unordered, attempting to use the three-argument form of the member command, as in member( x, M, 'k' ) will result in an error.

Examples

 > $M≔\mathrm{MultiSet}\left(a=2,b=5\right)$
 ${M}{≔}\left\{\left[{a}{,}{2}\right]{,}\left[{b}{,}{5}\right]\right\}$ (1)
 > $\mathrm{member}\left(b,M\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{member}\left(c,M\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{evalb}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}M\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{member}\left(a,M,'k'\right)$

Compatibility

 • The MultiSet/member command was introduced in Maple 2016.
 • For more information on Maple 2016 changes, see Updates in Maple 2016.

 See Also