Calculate item from n-size cross product without creating product?

AI Thread Summary
The discussion centers on calculating a specific set from a Cartesian product of an array without generating the entire product. The user has an array of length 512 and seeks a method to access elements at a specific index efficiently. An example is provided with a smaller array to illustrate the Cartesian product's structure. The term "cross product" is clarified as referring to the Cartesian product. The focus is on finding a solution that avoids the computational overhead of creating the full set.
SophieP
Messages
8
Reaction score
0
Hi all,

I'm trying to work out how I can get the set at specific index in a cross product without creating the whole product.

For instance:

I have array A of length 512

I also have a number that specifies how many times that array needs to be 'cross-producted' against itself.

This gives me a potentially huge set of sets. I need to be able to work out what the set is at a particular point, without iterating through the entire cross product creation procedure.

Anyone have any advice?
 
Physics news on Phys.org
What doew "cross product" mean in this context?
 
Hi Mathman,

As an example:

A = [1, 2, 3, 4]

gives:
1,1
1,2
1,3
1,4
2,1
2,2
2,3
2,4
3,1
3,2
3,3
3,4
4,1
4,2
4,3
4,4

I've just noticed that I meant to say Cartesian product, sorry!
 
Last edited:
Back
Top