title: An extension method on IEnumerable needed for shuffling
body: <p>I need an extension method which will shuffle an <code>IEnumerable&lt;T&gt;</code>. It can also take an <code>int</code> to specify the size of the returned <code>IEnumerable</code>. Better keeping Immutability of the <code>IEnumerable</code>. My current solution for <code>IList</code>-</p>
  
  <pre><code>public static IList&lt;T&gt; Shuffle&lt;T&gt;(this IList&lt;T&gt; list, int size)
  {
      Random rnd = new Random();
      var res = new T[size];
  
      res[0] = list[0];
      for (int i = 1; i &lt; size; i++)
      {
          int j = rnd.Next(i);
          res[i] = res[j];
          res[j] = list[i];
      }
      return res;
  }
  
  public static IList&lt;T&gt; Shuffle&lt;T&gt;(this IList&lt;T&gt; list)
  { return list.Shuffle(list.Count); }
  </code></pre>