# Is there an easy way to create n group of two digits (x;y) in a way that the combination of every of this number is never equal ?

Hi everyone ! I’ll try my best to be clear but I must precise that that english isn’t my native language. Also, I may post it in the wrong sub so if it is the case, excuse me in advance.

So, I was working on a statistical case where each element of a list responded to two conditions with two variables. Every element is then coded depending on (a;b) AND (c;d). Instead of considering it as a 2*2 model, I found it easier to create a row where I coded each element as a combination of these two conditions. It looked like this :

The first condition was coded (0;2) and the second was coded (1;2) so that :

An element being *a* and *c* is recoded 1

An element being *a* and *d* is recoded 2

An element being *b* and *c* is recoded 3

An element being *b* and *d* is recoded 4

Thus making it so that all my outputs are chosen from (1;2;3;4), coding differently for each combination of the two combination. But as I thought more about it, I realised it was may more difficult to find such a list for 3 diffrent couples.

Question : So, as the title state, I would like to know if their is a way to determine, with an algorithm, all the elements of a list, with every combination (like previously made) being different, for n couple of digits .

Thank you for your time !

Edits : Formating

submitted by /u/GozPeco