### Basic Examples

Basic Examples

Give a sorted list of elements common to all the lists, where the number of each distinct element is the product of the individual cardinalities:

[{a,b,a,c},{d,a,e,b},{c,d,b,a,d}]

In[]:=

{a,a,b}

Out[]=

Multisets as Association of counts :

[<|"a"3,"b"1,"c"2,"d"1|>,<|"a"2,"b"2,"c"2,"e"1|>,<|"a"1,"b"2,"c"2,"e"2|>]

In[]:=

a6,b4,c8

Out[]=

### Scope

Scope

MultisetProduct works with any head, not just List :

[f[a,b,c,c],f[c,a,a],f[b,b,a,c,c,c]]

In[]:=

f[a,a,c,c,c,c,c,c]

Out[]=

### Properties and Relations

Properties and Relations

Compare to Intersection:

[{a,b,c,c},{c,a,a},{b,b,a,c,c,c}]

In[]:=

{a,a,c,c,c,c,c,c}

Out[]=

Intersection[{a,b,c,c},{c,a,a},{b,b,a,c,c,c}]

In[]:=

{a,c}

Out[]=