Compute the Cartesian product of two lists
Contributed by:
Jordan Hasler, Wolfram|Alpha Math Team
Examples
Basic Examples (2)
Find the Cartesian product of two lists of integers:
The lists given to CartesianProduct can contain any type of expression:
Scope (2)
Compute the Cartesian product:
Visualize the Cartesian product:
Properties and Relations (4)
Find and compare the Cartesian product to equivalent Wolfram Language expressions:
The Cartesian product is equivalent to Distribute:
The Cartesian product can be written in terms of Outer:
The Cartesian product can be written in terms of Tuples:
Publisher
Wolfram|Alpha Math Team
Version History
-
2.0.0
– 23 March 2023
-
1.0.0
– 09 December 2022
Related Resources
Author Notes
To view the full source code for CartesianProduct, evaluate the following: