Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Cartesian product of two lists
ResourceFunction["CartesianProduct"][list1,list2] compute the Cartesian product of list1 and list2. |
Find the Cartesian product of two lists of integers:
In[1]:= |
Out[1]= |
The lists given to CartesianProduct can contain any type of expression:
In[2]:= |
Out[2]= |
Compute the Cartesian product:
In[3]:= |
Out[3]= |
Visualize the Cartesian product:
In[4]:= |
Out[4]= |
Find and compare the Cartesian product to equivalent Wolfram Language expressions:
In[5]:= |
Out[5]= |
The Cartesian product is equivalent to Distribute:
In[6]:= |
Out[6]= |
The Cartesian product can be written in terms of Outer:
In[7]:= |
Out[7]= |
The Cartesian product can be written in terms of Tuples:
In[8]:= |
Out[8]= |
This work is licensed under a Creative Commons Attribution 4.0 International License