| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Permutation: Permute randomly (blocks)...</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 |
Permutation: Permute randomly (blocks)... |
| 13 |
</b></font></table></table> |
| 14 |
<p>Generates a new <a href="Permutation.html">Permutation</a> by randomly permuting blocks of size <i>blocksize</i>.</p> |
| 15 |
<h2>Settings</h2> |
| 16 |
<dl> |
| 17 |
<dt><b>Index range</b> |
| 18 |
<dd>the range of elements whose blocks will be permuted.</dd> |
| 19 |
<dt><b>Block size</b> |
| 20 |
<dd>the size of the blocks that will be permuted. There must fit an integer number of blocks in the chosen range.</dd> |
| 21 |
<dt><b>Permute within blocks</b> |
| 22 |
<dd>when <i>on</i>, the elements in each block are also randomly permuted.</dd> |
| 23 |
<dt><b>No doublets</b> |
| 24 |
<dd>guarantees that the first element in each block does not equal the last element of the previous block modulo the block size. E.g. the numbers 3, 6, 9 are all equal modulo 3. This parameter only has effect when <b>Permute within blocks</b> is <i>on</i>.</dd> |
| 25 |
</dl> |
| 26 |
<h2>Examples</h2> |
| 27 |
<p>1. With <b>Index range</b> = [0,0], <b>Block size</b> = 3 and <b>Permute within blocks</b> is <i>off</i>, the permutation ((1,2,3),(4,5,6),(7,8,9)) is turned into one of six possible permutations, for example into ((4,5,6),(7,8,9),(1,2,3)). (The option <b>No doublets</b> will be ignored and the parentheses are only there to indicate the blocks.)</p> |
| 28 |
<p>2. With <b>Index range</b> = [0,0], <b>Block size</b> = 3, <b>Permute within blocks</b> is <i>on</i> and <b>No doublets</b> is <i>off</i>, the permutation ((1,2,3),(4,5,6),(7,8,9)) might turn into ((5,4,6),(9,8,7),(3,1,2)).</p> |
| 29 |
<p>3. With the same options as 2 but <b>No doublets</b> is <i>on</i>, the previously given outcome is forbidden because the last element of the first block (6) and the first element of the next block (9) are equal modulo 3 (the blocksize). A valid outcome might then be ((5,4,6),(8,9,7),(3,1,2)).</p> |
| 30 |
<h3>Links to this page</h3> |
| 31 |
<ul> |
| 32 |
<li><a href="Strings___Permutation__Permute_strings.html">Strings & Permutation: Permute strings</a> |
| 33 |
</ul> |
| 34 |
<hr> |
| 35 |
<address> |
| 36 |
<p>© djmw 20110105</p> |
| 37 |
</address> |
| 38 |
</body> |
| 39 |
</html> |