title: Random Number, Math.floor(...) vs Math.ceil(...)
body: <p>I've seen a lot of code where random numbers are generated like</p>
  
  <pre><code>// random integers in the interval [1, 10]
  Math.floor(Math.random()*10 + 1)
  </code></pre>
  
  <p>Anyway, I feel like I'm missing something. Why don't people use the more succint way</p>
  
  <pre><code>Math.ceil(Math.random()*10);
  </code></pre>
  
  <p>?</p>
  
  <p>I tried to test the randomness and it seems true so far.</p>
  
  <p>In fact, the subsequent code</p>
  
  <pre><code>// will generate random integers from 1 to 4
  var frequencies = [ 0, 0, 0, 0, 0 ]; // not using the first place
  var randomNumber;
  for ( var i = 0; i &lt; 1*1000*1000; ++i ) {
     randomNumber = Math.ceil(Math.random()*4);
     frequencies[randomNumber]++;
  }
  
  for ( var i = 1; i &lt;= 4; ++i ) {
     console.log(i +": "+ frequencies[i]);
  }
  </code></pre>
  
  <p>prints out</p>
  
  <pre><code>1: 250103
  2: 250161
  3: 250163
  4: 249573
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p><em>Quick OT: Is there a more succint way to declare and initialize frequencies? I mean like <code>frequencies[5] = { 0 };</code> from C++...</em></p>