Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] ranomization problem

edited April 2012

Hi Sebastiaan,

First of all, thank you for this program. I'm pretty new at this and I have a problem with randomization. I hope I didn't miss an appropriate discussion, if so, please post the link.
I have, let's say a "big loop" which contains two "small ones". I want the experiment to loop over the small ones in a randomized order and the random-button doesn't work with this. I am pretty much at a loss by now, 'cause it works well with the trials within the small loops and nothing seems to help with this question. I already tried to do some inline-script stuff, but without succeeding.

Hope, you or someone else can give me a hint.

regards, Caroline

• edited 5:51PM

Hi Caroline,

So you have a structure somewhat like this, right?

```big_loop
- big_sequence
- - small_loop
- - - small_sequence```

And you want the big_loop to run the big_sequence in randomized order. Do I understand that correctly? If so, it should work simply by setting order of big_loop to random.

If this doesn't work for you, or if I have misunderstood the question, please let me know!

Cheers,
Sebastiaan

• edited April 2012

Thanks for the quick reply, Sebastian. I guess you misunderstood me a little or I didn't explain too well. My structure is the following:

```big_loop
- big_sequence
-- small_loop 1
--- small_sequence 1
--small_loop 2
--- small_sequence 2```

and I want small_sequence 1 and small_sequence 2 randomized, so it looks approximately like this:

```small_sequence 2
small_sequence 1
small_sequence 2
small_sequence 2
small_sequence 1
small_sequence 2
...```

At the moment the structure of small_sequence 1 and 2 is alternating.
In the end, I want to show each sequence 5 times in randomized order. The thing is, that the big_loop is already set to random and it doesn't work somehow. Hope you can tell me what I did wrong.

Regards, Caroline

• edited 5:51PM

Ah, I see now. The easiest way to achieve this is probably to add a variable myorder to the big_loop with the values 1 and 2. Then you add the two possible orders to the big_sequence with conditional statements, like so:

```big_sequence
- small_loop_1 (run if '[myorder] = 1')
- small_loop_2 (run if '[myorder] = 1')
- small_loop_2 (run if '[myorder] = 2')
- small_loop_1 (run if '[myorder] = 2')```

Does that make sense? I added a simple example as a gist on GitHub: link

• edited 5:51PM

Yes it does. thanks so much!