 I chose the patterns so you can see them by eye, not to be realistic.)</p>
<pre class="r"><code>print(cbind(z=sim$z,sim$x))</code></pre>
<pre><code>      z                  
 [1,] 2 1 1 0 0 0 0 1 0 0
 [2,] 1 0 0 0 0 1 1 1 1 0
 [3,] 1 0 0 1 1 1 1 1 1 1
 [4,] 1 1 0 1 0 0 0 1 1 1
 [5,] 2 1 1 1 1 0 0 0 0 0
 [6,] 2 1 1 1 1 0 0 1 1 0
 [7,] 1 0 0 0 1 0 0 0 1 1
 [8,] 1 0 0 0 0 0 1 1 1 1
 [9,] 2 1 1 0 1 0 1 1 1 0
[10,] 2 1 1 1 1 0 1 0 0 0
[11,] 1 0 0 1 0 1 0 1 1 1
[12,] 1 0 0 1 1 0 1 0 1 1
[13,] 1 0 0 0 0 1 1 1 1 1