I would like to calculate possible combinations for a given set of data:
There is an x amount of columns (let's say 3) each column contains y amount of words (lets say 2), now I would like to calculate total amount of permutations possible, the thing is that columns may have common elements and repetition is not allowed, i.e you can't choose the same elements twice or more
For example: column 1 contains "one" and "two", column 2 contains "one" and "four", column 3 contains "four" and "six" then all possible combinations are:
["one", "four", "six"], ["two", "one", "four"], ["two", "one", "six"], ["two", "four", "six"], That's 4, how I can calculate that, is there a closed form or recursive form solution for large matrices?