Combinations of unequal lists

Quick easy question I’m just having a mental block on this.

I have 4 lists of values, but each list is unequal in the number of records. For example:

List 1 : 13 values
List 2 : 5 values
List 3 : 9 values
List 4: 15 values.

How many combinations of List 1:List 2: List 3: List 4 values can I have?

Is it just 13x5x9x15 --> 8775?

You got it.

See Cartesian product for more details.

Your terminology is a little ambiguous but for the obvious interpretation your answer is mostly correct.

If you really mean you want to pick one item from each list, and keep the resulting 4-tuple in the order of [item from list 1, then from list 2, then from list 3, then from list 4] then yes, there are count1 * count2 * count3 * count4 such tuples.

But …

If list 1 has 2 values the same, then two of those resulting tuples will appear to be identical. e.g. if items a and j in list 1 are the same value then tuples (listitem1-a, listitem2-b, listitem3-c, listitem4-d) and (listitem1-j, listitem2-b, listitem3-c, listitem4-d)
will appear identical.

If list 1 and list 2 both have a value in common that occurs only once in each list, then the good tuple (listitem1-a, listitem2-b, listitem3-c, listitem4-d) will look the same as the defective tuple (listitem2-b, listitem1-a, listitem3-c, listitem4-d)

Whether you care or not about those identical looking tuples is up to you.

Thanks folks.