<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv2000828700"><table cellspacing="0" cellpadding="0" border="0" id="yiv2000828700bodyDrftID" class="yiv2000828700"><tbody><tr><td id="yiv2000828700drftMsgContent" style="font: inherit; "><font class="Apple-style-span" size="2">Thanks, all.</font><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">It seemed like something like this should exist in a prob/stat package, and if so, didn't want to reinvent the wheel.</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; "><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; ">Shuffle [1..20], then take 5?</span></div><div style="font-family: arial; font-size: 10pt; "><span
 class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; "><br></span></div><div style="font-family: arial; font-size: 10pt; "><span class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; ">Yes, so simple, I'm embarrassed I didn't think of it.</span></div><div style="font-family: arial; font-size: 10pt; "><span class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; "><br></span></div><div style="font-family: arial; font-size: 10pt; "><span class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; ">Michael</span></div><div style="font-family: arial; font-size: 10pt; "><span class="Apple-style-span" style="font-family: monospace; font-size: 14px; line-height: 16px; "><br></span></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-size: 14px; line-height:
 16px;"><br></span></font></div><div style="font-family: arial; font-size: 10pt; "><br>--- On <b>Mon, 6/13/11, Felipe Almeida Lessa <i>&lt;felipe.lessa@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>From: Felipe Almeida Lessa &lt;felipe.lessa@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: haskell-cafe@haskell.org<br>Date: Monday, June 13, 2011, 9:38 PM<br><br><div class="yiv2000828700plainMail">On Mon, Jun 13, 2011 at 8:56 PM, michael rice &lt;<a rel="nofollow">nowgate@yahoo.com</a>&gt; wrote:<br>&gt; Is there an (existing) way to select 5 Ints randomly (no duplicates) from a population, say 1-20 (inclusive)?<br><br>Yes, already implemented in the monte-carlo package as sampleSubset [1],<br><br>&nbsp; sampleSubset :: MonadMC m =&gt; [a] -&gt; Int
 -&gt; m [a]<br><br>Complete example code for your example:<br><br>&nbsp; evalMC (sampleSubset [1..20] 5) (mt19937 0)<br><br>Cheers!<br><br>[1] <a rel="nofollow" target="_blank" href="http://hackage.haskell.org/packages/archive/monte-carlo/0.4.1/doc/html/Control-Monad-MC-Class.html#v:sampleSubset">http://hackage.haskell.org/packages/archive/monte-carlo/0.4.1/doc/html/Control-Monad-MC-Class.html#v:sampleSubset</a><br><br>--<br>Felipe.<br></div></blockquote></div></td></tr></tbody></table></div></td></tr></table>