Image for APL cartesian product

APL cartesian product

The APL cartesian product combines two arrays (lists) by pairing each element of the first array with every element of the second array, creating all possible ordered pairs. For example, if the first array is [a, b] and the second is [1, 2], the cartesian product results in [(a,1), (a,2), (b,1), (b,2)]. It's a systematic way to generate all combinations between two sets, widely used in mathematics, programming, and data analysis to explore every possible pairing of elements.