Shuffling a list with a constraint
问题 Preparing a new psychophysical experiment, I have 48 original stimuli displayed 4 times (4 conditions), resulting in 192 trials. Trying to randomize the order of presentation during the experiment, I need to maximize the distance between the 4 display of the same original stimuli. Please consider : Table[{j, i}, {j, Range[48]}, {i, Range[4]}] Where j is the original stimuli number and i the condition Output Sample : {{1, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 1}, {2, 2}, {2, 3}, {2, 4}, ... {47, 1},