# randomizing sub groups while keeping big loop sequential order

Hi

I want to design this experimental structure:

-- block sequence loop (repeated 8 times)

-- random sequence type 1 (1 out of 8)

-- random sequence type 2 (1 out of 8)

-- random sequence type 3 (1 out of 8)

-- random sequence type 4 (1 out of 8)

I would like to know how can a sequence be picked randomly in each type, but still keep the sequence of the big loop (type 1, and then 2, 3 and 4 in that order)?

And also, in total, I need to show all the sequences in the big loop in that order, without repeating on a sequence, so all 32 sequences will be shown, each in its group type, but they will be picked randomly from the pool. how can I be sure all 32 sequences will be shown once without repetition or emissions?

I hope I succeeded to explain myself well...

Thank you for your help!!

Hadas

## Comments

Hi Hadas,

That's an interesting scenario.

The trick will be to use a

`loop`

for each random sequence type, let's call itloop_type_1(for type 1, etc.), which has 8 cycles, such that each cycle corresponds to one random sequence type. In the loop table you would then define a variable, saysequence_nr, which controls which of your 8 random sequences will be executed. Then you set the repeat value to 0.125, so that only 1 cycle is executed at a time, and you tick the boxResume after break, to make sure that the next time thatloop_type_1is executed, a new cycle is sampled without replacement.Does that make sense? I realize that this is not an out-of-the-box implementation, but I think it might provide sufficient guidance to take a shot at implementing it yourself!

Cheers,

Sebastiaan

There's much bigger issues in the world, I know. But I first have to take care of the world I know.

cogsci.nl/smathot