Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Perform the product operation on multisets
ResourceFunction["MultisetProduct"][list1,list2,…] gives a sorted list of all the elements that appear in any of the listi. The number of occurrences of each distinct element is the product of the counts in each of the listi. | |
ResourceFunction["MultisetProduct"][list] effectively sorts the elements of list. | |
ResourceFunction["MultisetProduct"][assoc1,assoc2,…] gives an Association where the keys are the union of the keys in the associations associ and the values are the product of the merged values. |
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:
In[1]:= |
Out[1]= |
Multisets as an Association of counts:
In[2]:= |
Out[2]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License