title: produce a random subset of all permutations
body: <p>I'm looking for a way to randomly sample a fixed length subset of all permutations. </p>
  
  <pre><code>import itertools
  from random import shuffle
  
  mylist = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T']
  </code></pre>
  
  <h2>APPROACH A</h2>
  
  <p>Approach A below suffers from the problem that the permutations are too similar.</p>
  
  <pre><code>a_pre = itertools.permutations(mylist,20)
  a = itertools.islice(a_pre,3)
  
  list(a)
  </code></pre>
  
  <blockquote>
    <p>['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T']</p>
    
    <p>['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'T', 'S']</p>
    
    <p>['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'S', 'R', 'T']</p>
  </blockquote>
  
  <h2>APPROACH B</h2>
  
  <p>Approach B gets me closer to my desired outcome, but here there's always a risk of producing identical ordering between lists, so this approach is not feasible.</p>
  
  <pre><code>#repeat n=3 times
  
  shuffle(mylist)
  print(mylist)
  </code></pre>
  
  <blockquote>
    <p>['J', 'B', 'M', 'A', 'O', 'C', 'K', 'S', 'H', 'Q', 'N', 'T', 'R', 'D', 'G', 'P', 'I', 'E', 'F', 'L']</p>
    
    <p>['R', 'O', 'C', 'I', 'G', 'E', 'Q', 'L', 'P', 'J', 'F', 'N', 'A', 'B', 'H', 'T', 'D', 'K', 'M', 'S']</p>
    
    <p>['L', 'O', 'I', 'G', 'B', 'E', 'R', 'A', 'D', 'N', 'J', 'S', 'H', 'F', 'K', 'M', 'Q', 'T', 'C', 'P']</p>
  </blockquote>