Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Determine if one integer partition dominates another
Since 5+1<4+3, the first partition does not dominate the second:
| In[1]:= | ![ResourceFunction[
 "DominatingIntegerPartitionQ"][{5, 1, 1, 1}, {4, 3, 1}]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/57b1ebb62ec00415.png) | 
| Out[1]= |  | 
The first partition dominates the second, since 4≥4, 4+4≥4+3 and 4+4≥4+3+1:
| In[2]:= | ![ResourceFunction["DominatingIntegerPartitionQ"][{4, 4}, {4, 3, 1}]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/16e4510fe5d4811f.png) | 
| Out[2]= |  | 
Display the domination lattice on integer partitions, using the resource function HasseDiagram:
| In[3]:= | ![dominationLattice[n_, opts___] := ResourceFunction["HasseDiagram"][ResourceFunction[
  "DominatingIntegerPartitionQ"], IntegerPartitions[n], opts, VertexShapeFunction -> "Name"]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/738c161e03ddad80.png) | 
| In[4]:= | ![dominationLattice[8]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/5c3b91056a863967.png) | 
| Out[4]= |  | 
DominatingIntegerPartitionQ[p,q] being False does not imply that DominatingIntegerPartitionQ[q,p] is True:
| In[5]:= |  | 
| In[6]:= | ![ResourceFunction["DominatingIntegerPartitionQ"][p, q]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/318fb85539b2ec9d.png) | 
| Out[6]= |  | 
| In[7]:= | ![ResourceFunction["DominatingIntegerPartitionQ"][q, p]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/6d7f5a2f7ac5c3a0.png) | 
| Out[7]= |  | 
In this case, this is because the first element of q is smaller than the first element of p:
| In[8]:= | ![First[q] < First[p]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/3586161f8c660997.png) | 
| Out[8]= |  | 
DominatingIntegerPartitionQ[p,q] and DominatingIntegerPartitionQ[q,p] can both yield True for certain p and q:
| In[9]:= |  | 
| Out[9]= |  | 
| In[10]:= | ![ResourceFunction["DominatingIntegerPartitionQ"][p, q]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/7ca58d035855b2ed.png) | 
| Out[10]= |  | 
| In[11]:= | ![ResourceFunction["DominatingIntegerPartitionQ"][q, p]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/38e14d87a3f42b3a.png) | 
| Out[11]= |  | 
Among the partitions of n, {n} is always the largest and {1,…,1} is the smallest:
| In[12]:= | ![n = 8;
{First[#], Last[#]} &[
 Sort[IntegerPartitions[n], ResourceFunction[
  "DominatingIntegerPartitionQ"]]]](https://www.wolframcloud.com/obj/resourcesystem/images/b14/b14809a4-213b-4fae-8a0d-10a9309e2078/56eed05dd40ba1da.png) | 
| Out[13]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License