Preparing a list of numbers based on certain rules and conditions
Show older comments
Dear All,
I need to generate a list of 100 trials for my experiment. Each trial is a row with 5 columns consisting of the numbers 1,2,3,4 and 5. Eg: Trial 1 = 5 3 2 1 4 Trial 2 = 5 4 2 3 1 Trial 3 = 4 2 3 5 1 The conditions and rules are as follows:
1) The number 5 is the target number
2) None of the numbers from 1 to 5 should repeat itself within a trial except in catch trials.
3) Valid trials = In 60 % of the trials the target number should occur in the first column
4) Invalid trials = 20 % of the trials the target number should occur in the remaining columns (2nd, 3rd, 4th and 5th columns). The individual probability of target number occurring in each of these 4 columns should be nearly equal. Invalid trails cannot occur consecutively and should be preceded by either a catch trial or valid trial with equal probability.
5) Catch trials = In the remaining 20 % of the trials none of the columns should contain the target number. Any one non-target number from 1 to 4 can be repeated with equal probability of each of those 4 numbers to be repeated within the 20 trials
6) There should be a minimum of 3 consecutive valid trials before a catch or invalid trial.
As I am just a beginner, any help in this regard is much appreciated. Thanks in anticipation.
Regards, Imran
2 Comments
Anthony Smith
on 17 Jun 2011
Sounds like a fairly strict set of conditions. Originally reading your post I thought you were looking to randomly generate these trials with roughly 60/20/20% probability. But it sounds like you need exactly 60/100 valid, etc., which would mean you need to generate each trial conditionally based on the trials that preceded it. Please confirm. If that is the case you should be able to just loop over the 100 trials and have different sub-functions to generate each trial type.
imran
on 20 Jun 2011
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!