Had an exchange with Sommer about this outside of the Group, figured I
might as well post the result here for future reference.
We started by clarifying the specifications for Sommer's task ...
* You want to present 72 trials.
* On each trial you want to present one image with some rectangles
(let's assume you use a Slide object, and call it Rect1Slide), then a
nature scene (let's call it NatureSlide), then a tone (let's call it
ToneSound), and then another image with rectangles (let's call it
Rect2Slide).
* Half (36) of the trials will use the same rectangle image for
Rect1Slide & Rect2Slide, and half will use different images for
Rect1Slide & Rect2Slide.
* "Same" and "Different" trials may occur in any random order, with no
further constraints.
* You have a pool of 80 of the rectangle images.
* You would like to use each image at least once, in some randomized
order, with no further constraints.
Assuming no further constraints on the randomization I had some ideas.
Otherwise, I advised simply coming up with one suitable sequence and
then simply running that as a List running in Sequential order (as
advised in many other threads throughout the E-Prime Group). As it
turns out I neglected a specification to select images *with* (rather
than without) replacement -- I will address that at the end.
So then I set out in earnest with my ideas ...
As a starting exercise, let's see how we would do this with decks of
playing cards, and then implement that design in E-Prime.
Imagine you have a deck of 72 cards, with half (36) of them labeled
"Same", and half labeled "Different" -- let's call that TrialDeck.
Imagine you have another deck of 80 cards, each one with a different
image of rectangles -- let's call that RectDeck. You did not say
anything about the nature scenes, but I imagine that you have a number
of those to present in some random order, so we might as well also have
another deck for those -- let's call that NatureDeck, with some
arbitrary number of cards.
Start by shuffling each of these three card decks separately. On each
trial, draw one card from TrialDeck. Then draw one card from RectDeck.
Then of course one card from NatureDeck. Now comes the fun part -- if
the card drawn from TrialDeck says "Same", then just use the card that
you already drew from RectDeck for the second time; if the card from
TrialDeck says "Different", draw a second card from RectDeck.
Note that under the conditions given you will need to draw 36 + 2*36 =
108 rectangle cards throughout the session -- when you exhaust the deck
of 80 cards from RectDeck, simply reshuffle the deck and keep drawing
more cards.
This procedure guarantees that you will use every card from RectDeck at
least once as either the first or the second image on some trial, but
some cards might never serve as the first image (or as the second image)
on any trial; also, some rectangle cards will get used twice, and others
only once, and the same card may end up in a "Same" trial twice, etc.
It also has no control over runs of "Same" or "Different" trials. It
will however almost never use the same card for two trials in a row,
except possibly for the one trial after you reshuffle RectDeck. That's
the best I can do offhand.
So now let's implement this in E-Prime. Each Deck will become a List,
where TrialDeck becomes a main List and RectDeck & NatureDeck become
nested Lists. And it will use "colon syntax", which is a bit of an
advanced feature that you may learn about in Appendix C of the "E-Prime
2.0 User's Guide" (I also go over this in a lesson in my online E-Prime
2 course).
Here is how your structure might look now (I am using Slide objects,
although you might instead use simpler ImageDisplay objects):
- TrialList
--- RectList
--- NatureList
--- TrialProc
----- Rect1Slide
----- NatureSlide
----- ToneSound
----- Rect2Slide
TrialList has RectList and NatureList in each row of its "Nested"
column. It also has columns named "Rect1Image" and "Rect2Image" --
Rect1Slide will use [Rect1Image] to get its image file, and Rect2Slide
will use [Rect2Image] to get its image file. TrialList also has a
column for "NatureImage", which NatureSlide will use. If you like, you
may add another column to indicate Same vs. Different trials (call it
"TrialType"?) just for your own info, but we do not need that for the
program itself. Finally, we set TrialList to use Random order.
RectList (nested under TrialList) has a column that we will call
"RectImage". It has 80 rows, with a file name for RectImage in each
row, and we set this to use Random order.
NatureList (nested under TrialList) has a column that we will call
"NatureImage", with a file name for NatureImage in each row, and we set
this to use Random order.
Now back in TrialList, in the Rect1Image column, put "[RectImage:0]"
(without the quotation marks) in each row. In the Rect2Image column,
put "[RectImage:0]" for the same-RectImage trials, and "[RectImage:1]"
for the different-RectImage trials. Explanation -- [RectImage:0] means
use the top "card" that we drew from the RectList "deck", and
[RectImage:1] means draw one more "card" from the "deck", just like in
the playing card example that I gave above.
Also in TrialList, you may make 36 rows for the same-RectImage trials
and 36 rows for the different-RectImage trials; or, even easier, just
make two rows, one for same-RectImage trials and another for
different-RectImage trials, and give each of those rows a Weight of 36
-- E-Prime will treat this as a List of 72 rows and take care of the
shuffling for you.
Finally, Rect1Slide uses "[Rect1Image]" to gets its image file,
Rect2Slide uses "[Rect2Image]", and NatureSlide uses "[NatureImage]"
(we do not have to do anything special for NatureSlide because TrialList
implicitly picks up the NatureImage column from NatureList, but if it
makes you feel better you could add some sort of NatureImage column in
TrialList and then use that to reference the nested NatureList, etc.).
Finally, what about selecting images for the trials *with* (instead of
without) replacement? ...
Just to belabor the terminology a bit, sampling with replacement is like
rolling a die (or, drawing a card from a shuffled deck, then putting the
card back into the deck and reshuffling before drawing a card again),
while sampling without replacement is like simply drawing successive
cards from a shuffled deck of cards. The procedure outlined here
randomly samples the images *without* replacement, which makes things
easier; if you really need sampling *with* replacement then, in this
particular case, it makes things considerably harder. In fact, sampling
images with replacement pretty much conflicts with the requirement to
use each image at least once.
-- David McFarlane