I have 3 variables (A,B,C); each variable can assume 3 different values (1,2,3) . I want to calculate ho many combinations there are which follow this rule:
let's fix A1, then cycle on all the others variables which can assume 3 values each; then let's move on to A2 and calculate again all the combinations by cycling over the 2 remaining variables (which can assume 3 values each); same thing for A3. Once I am done with A I repeat the same process with B and so on. The constrain is that the combinations must repeat only once over all: in fact if I fix A1 and the combination I get is (A1 B3 C2 ), then when I fix for example B3 I must not count (A1 B3 C2) because it has been already found before.
So what I need is the mathematical formula that allows me to do this calculation with a generic number of variables which can assume a generic number of values