mardi 28 août 2018

How to pseudo-randomize trials without repeating same condition more than three times

I know there are lots of pseudo-randomization skills but this one, I couldn't search it so I put it on here.

I am using MATLAB 2018a. I've been trying to set up a behavior experiment which has 10 conditions. Each condition has 50 trials. This results in 500 trials total. I would like to pseudo-randomize the sequence of trials such that no same conditions appear more than three times consecutively.

I thought it would be not so difficult since I have many conditions but some of the methods I found by googling had minor problems. One of the methods I used was by extracting indexes using 'unique(find(diff(seq)==0))', re-randomize it and replace it with the original redundant sequence. (Link) But this method had a problem that it would randomly change the total number of a condition. If you wanted 40 stimuli for each condition, it would result in 39 for some conditions while 41 for others..

My question would be how to improve this method to have constraints of having no one condition repeated three times, while solving the problem mentioned above. Or would there be any better ways?




Aucun commentaire:

Enregistrer un commentaire