3 ms·
I'm not sure of the original intent, but you could approach this as the Cartesian product of [1..5] * [1..10] * [1..10] which is then filtered such that the 2nd
by falcor84 9y ago
I'm not sure of the original intent, but you could approach this as the Cartesian product of [1..5] * [1..10] * [1..10] which is then filtered such that the 2nd value is not smaller than the first, and the 3rd value is inclusively between the two
- catnaroek 9y agoA subset of a Cartesian product is not a Cartesian product. inb4, spare me the wisecrack “It's the Cartesian product of itself and no other factors”.
- timjver 9y ago> It’s a really compact syntax that deals with Cartesian product of lists. Couldn't taking the subset of a Cartesian product be considered to be dealing with one?
- falcor84 9y agoExactly. Indeed, from what I recall from relational database theory, joins are usually treated as cartesian products (outer joins) which are then filtered by the join condition.