title: Randomly select a specific quantity of indices from an array?
body: <p>I have an array of boolean values and need to randomly select a specific quantity of indices for values which are <strong>true</strong>.</p>
  
  <p>What is the most efficient way to generate the array of indices?</p>
  
  <p>For instance,</p>
  
  <pre><code>BitArray mask = GenerateSomeMask(length: 100000);
  int[] randomIndices = RandomIndicesForTrue(mask, quantity: 10);
  </code></pre>
  
  <p>In this case the length of <code>randomIndices</code> would be 10.</p>