convert/multiset
convert to a multiset
Calling Sequence
Parameters
Description
Examples
convert( f, multiset )
f

table, list, or algebraic expression
This utility function converts f to a multiset. A multiset is represented in the form $\[\[{e}_{1}\,{m}_{1}\]\,...\,\[{e}_{n}\,{m}_{n}\]\]$; it is a list of pairs where each ${e}_{i}$ is a value (an expression), and ${m}_{i}$ is its multiplicity (an integer).
If f is a table, each index is interpreted as a value and the associated entry (which should be an integer) is interpreted as its multiplicity.
If f is an algebraic expression, each factor is interpreted as a value, and the exponent to which this factor is raised (which should be an integer) is interpreted as its multiplicity.
If f is a list, the number of instances of each entry in the list is interpreted as its multiplicity.
Note: The output from this command is a listoflists structure, which is not the same as the MultiSet object introduced in Maple 2016.
$t\u2254\mathrm{table}\left(\left[x=1\,y=3\,z=2\right]\right)\:$
$\mathrm{convert}\left(t\,\mathrm{multiset}\right)$
$\left[\left[{z}{\,}{2}\right]{\,}\left[{y}{\,}{3}\right]{\,}\left[{x}{\,}{1}\right]\right]$
$\mathrm{convert}\left(\frac{x{y}^{3}}{{z}^{2}}\,\mathrm{multiset}\right)$
$\left[\left[{x}{\,}{1}\right]{\,}\left[{y}{\,}{3}\right]{\,}\left[{z}{\,}{\mathrm{2}}\right]\right]$
$\mathrm{convert}\left(\left[x\,y\,z\,y\,z\,y\right]\,\mathrm{multiset}\right)$
See Also
convert/MultiSet
convert/set
MultiSet
Download Help Document
What kind of issue would you like to report? (Optional)