Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Similar to ContainsAll but taking the multiplicities into consideration
ResourceFunction["ContainsAllMultiplicities"][e_{1},e_{2}] yields True if e_{1} contains all of the elements of e_{2} taking into account multiplicities. 

ResourceFunction["ContainsAllMultiplicities"][e_{2}] is an operator form that yields True when the object to which it is applied contains all of the elements of e_{2}. 
Check if the elements of the second list are all contained in the first list:
In[1]:= 

Out[1]= 

Check if the elements of the second list are all contained in the first list:
In[2]:= 

Out[2]= 

Make a function that checks if a list has one 1, two 2s and one 3:
In[3]:= 

Out[3]= 

Apply to a bunch of lists:
In[4]:= 

Out[4]= 

Elements of e_{1} and e_{2} can be lists themselves:
In[5]:= 

Out[5]= 

There are not enough c’s in the first list:
In[6]:= 

Out[6]= 

Check the same but without considering the multiplicities:
In[7]:= 

Out[7]= 

If e_{1} is empty and e_{2} is nonempty, the answer is always False:
In[8]:= 

Out[8]= 

If e_{2} is empty, the answer is always True:
In[9]:= 

Out[9]= 

If e_{1} and e_{2} are empty, the answer is True:
In[10]:= 

Out[10]= 

What are the chances that two randomly generated lists of length 10 overlap exactly:
In[11]:= 

Out[12]= 

This work is licensed under a Creative Commons Attribution 4.0 International License