s are as above, whereas in the second population they are reversed (<code>1-p</code>)…again not at all realistic but to help illustrate an idea.</p>
<pre class="r"><code>set.seed(123)
P = rbind(p,1-p)
print(P)</code></pre>
<pre><code>  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
p  0.1  0.2  0.3  0.4  0.5  0.6  0.7  0.8  0.9
   0.9  0.8  0.7  0.6  0.5  0.4  0.3  0.2  0.1</code></pre>
<pre class="r"><code>sim = r_simplemix(n=20,P)</code></pre>
<p>Here are the results of the simulation (first column is the