title: what is the purpose of variable i minus 1 within the swap method? Is - 1 really necessary for a fair randomization?
body: <p>I saw this code in Oracle documentation. </p>
  
  <p>The documentation states: "The shuffle method below,unlike most naive attempts at shuffling, it's fair (all permutations occur with equal likelihood, assuming an unbiased source of randomness)".</p>
  
  <p>My question is what is the purpose of variable i minus 1 within the swap method? Is - 1 really necessary for a fair randomization?</p>
  
  <pre><code>public static void shuffle(List&lt;?&gt; list, Random rnd) {
      for (int i = list.size(); i &gt; 1; i--)
          swap(list, i - 1, rnd.nextInt(i));
  }
  </code></pre>