title: How stdrandom shuffle method works
body: <pre><code> public static void shuffle(Object[] a) {
      int N = a.length;
          for (int i = 0; i &lt; N; i++) {
              int r = StdRandom.uniform(i + 1);      
              exchange( a, i , r) 
          }
      }
  </code></pre>
  
  <p>above is a method from StdRandom Class coded in java. I was wondering why for stdRandom.uniform( i + 1) it is between 0 and i and not between 0 and (N - 1). </p>