Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Give the index of a subset or return the subset with that index
ResourceFunction["IndexedSubset"][choose,index] returns a subset of length choose with given index. | |
ResourceFunction["IndexedSubset"][list] gives the index of subset list. |
The following 3-subset ordering can be extended to infinity:
| In[1]:= |
| Out[1]= |
The function returns the same subsets in the same order:
| In[2]:= |
| Out[2]= |
The function can return subsets of a large index:
| In[3]:= |
| Out[3]= |
Applying the function to a subset returns the index:
| In[4]:= |
| Out[4]= |
Any strictly increasing list of integers can be considered as a subset with a unique index:
| In[5]:= |
| Out[5]= |
The index above generates a unique 9-subset:
| In[6]:= |
| Out[6]= |
Some binomial representations of the number 320:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Here are some two item subsets with their indices to show their structure:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
The 2-subset {4,5} has an index of
:
| In[9]:= |
| Out[9]= |
Recover the same information using IndexedSubset:
| In[10]:= |
| Out[10]= |
The structure of 3-subsets in 3D:
| In[11]:= | ![]() |
| Out[11]= | ![]() |
Find the trillionth number with binary weight eight:
| In[12]:= |
| Out[12]= |
Find the index of an eight-term subset:
| In[13]:= |
| Out[13]= |
This work is licensed under a Creative Commons Attribution 4.0 International License