Top "Cartesian-product" questions

The Cartesian product, named after René Descartes, of two sets A and B is the set of all ordered pairs ab, where a is element of A and b is element of B.

Is there a good LINQ way to do a cartesian product?

I have a class structure like so: Person Dogs (dog 1, dog 2, etc) Puppies (puppy A, puppy B, etc) There is …

c# sql asp.net linq cartesian-product
python all possible pairs of 2 list elements, and getting the index of that pair

let's say I have two lists: a = list(1,2,3) b = list(4,5,6) So I can have 9 pairs of these list members: (1,4) (1,5) (1,6) (2,4) (2,5) (2,6) (3,4) (3,5) (3,6) Now, …

python list tuples cartesian-product
Cartesian product in MATLAB

Here is the simplified version of the problem I have. Suppose I have a vector p=[1 5 10] and another one q=[.75 .85 .95]. …

matlab matrix cartesian-product
Generate a matrix containing all combinations of elements taken from n vectors

This question pops up quite often in one form or another (see for example here or here). So I thought …

arrays matlab matrix combinations cartesian-product
How can I make Cartesian product with Java 8 streams?

I have the following collection type: Map<String, Collection<String>> map; I would like to create …

java java-8 java-stream cartesian-product
Working with list of lists in Prolog

Please help me to solve this problem: I have a list of lists [[1,2],[3,4]] How do I get: [1,3] [1,4] [2,3] [2,4] Or if I …

list prolog cartesian-product cross-product
How to find all permutations (with repetition) in MATLAB?

Suppose I have 4 letters and I want to arrange them in 3 places (repetition allowed), so I would have 43=64 possible permutations. …

matlab permutation cartesian-product
Clear explanation of the "theta join" in relational algebra?

I'm looking for a clear, basic explanation of the concept of theta join in relational algebra and perhaps an example (…

sql relational-database cartesian-product relational-algebra
How can I create cartesian product of vector of vectors?

I've a vector of vectors say vector<vector<int> > items of different sizes like as follows 1,2,3 4,5 6,7,8 …

c++ vector combinations cartesian-product
Finding cartesian product with PHP associative arrays

Say that I have an array like the following: Array ( [arm] => Array ( [0] => A [1] => B [2] => C ) [gender] =&…

php algorithm associative-array cartesian-product