Say I have a list of letters {A,B,C,D,E,F,G,H}, I want to create an $4\times 8$ array where each row must not contain duplicates and each column must also not contain duplicates.
Naively writing:
gps = CharacterRange["A", "H"];
Table[RandomSample[gps], {4}] // MatrixForm
gives you the correct condition that no row may contain duplicates. Take an example below:
$ \left( \begin{array}{cccccccc} \text{H} & \text{G} & \text{C} & \text{E} & \text{F} & \text{B} & \text{A} & \text{D} \\ \text{G} & \text{D} & \text{H} & \text{A} & \text{F} & \text{C} & \text{B} & \text{E} \\ \text{B} & \text{E} & \text{C} & \text{G} & \text{H} & \text{A} & \text{F} & \text{D} \\ \text{A} & \text{C} & \text{D} & \text{F} & \text{H} & \text{B} & \text{G} & \text{E} \\ \end{array} \right) $
Every row is unique, but column 3,5,6,8 all have duplicates. This is the case most of the time that one column or more will have a duplicate. Brute force I would just create a while loop that keeps doing random sampling until the more difficult no duplicate in column conditions is met.
This way doesn't really sit well with me. Perhaps there is a fancy use of permutations. Any ideas would be great. Thanks