| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Strings & Permutation: Permute strings</title> |
| 3 |
<style> |
| 4 |
td { padding-left: 5pt; padding-right: 5pt; } |
| 5 |
th { padding-left: 5pt; padding-right: 5pt; } |
| 6 |
code { white-space: pre-wrap; } |
| 7 |
dd { white-space: pre-wrap; } |
| 8 |
</style> |
| 9 |
</head><body bgcolor="#FFFFFF"> |
| 10 |
|
| 11 |
<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 |
Strings & Permutation: Permute strings |
| 13 |
</b></font></table></table> |
| 14 |
<p>Generate a new <a href="Strings.html">Strings</a> with a strings ordering determined by the <a href="Permutation.html">Permutation</a>.</p> |
| 15 |
<p>The number of strings in the <b>Strings</b> and the number of elements in the <b>Permutation</b> have to be equal.</p> |
| 16 |
<h2>Examples</h2> |
| 17 |
<p>1. If the selected Strings has the 4 strings ordered as "heed", "hid", "hood", "hud", and the permutation is (4,3,2,1), the new Strings has the ordering "hud", "hood", "hid", "heed".</p> |
| 18 |
<p>2. In the example that is discussed in the <a href="ExperimentMFC.html">listening experiment</a> section, we have four stimuli "heed.wav", "hid.wav", "hood.wav", "hud.wav" that we want to present three times to each subject with a <PermuteBalancedNoDoublets> randomization strategy, i.e. stimuli presented in blocks of four, randomized, and no two successive stimuli equal. This type of randomization can easily be accomplished with a Permutation object and a Strings.</p> |
| 19 |
<dl> |
| 20 |
<dd style="position:relative;padding-left:1em;text-indent:-2em">1. Fill the Strings object with 12 strings, i.e. three repetitions of the four stimuli. </dd> |
| 21 |
<dd style="position:relative;padding-left:1em;text-indent:-2em">2. Create a Permutation object with 12 elements and perform <b><a href="Permutation__Permute_randomly__blocks____.html">Permute randomly (blocks):</a> 0, 0, 4, "yes", "yes"</b>. We randomly permute blocks of size 4 and permute randomly within these blocks and make sure that on the transition from on block to the other no two stimuli are equal. (Of course, the random permutation of the blocks makes no difference here since all the blocks have the same content.)</dd> |
| 22 |
<dd style="position:relative;padding-left:1em;text-indent:-2em">3. Select the Strings and the Permutation together and choose <b>Permute strings</b>. Now the new Strings will contain the new ordering of the stimuli.</dd> |
| 23 |
</dl> |
| 24 |
<h3>Links to this page</h3> |
| 25 |
<ul> |
| 26 |
<li><a href="Index__To_Permutation___.html">Index: To Permutation...</a> |
| 27 |
<li><a href="Strings__To_Permutation___.html">Strings: To Permutation...</a> |
| 28 |
</ul> |
| 29 |
<hr> |
| 30 |
<address> |
| 31 |
<p>© djmw 20140130</p> |
| 32 |
</address> |
| 33 |
</body> |
| 34 |
</html> |