title: Generating a random number between a range with a weight/bias?
body: <p>I am trying to generate a random number between 1 and a maximum. This I don't have a problem doing so and do so with the following:</p>
  
  <pre><code>var max = 200;    
  var randomNumber = Math.floor(Math.random() * max) + 1;
  </code></pre>
  
  <p>However in an ideal situation I would like to generate a number between 1 and my maximum however the lower numbers have a higher probability of occurring. I want the variable to be biased towards 1. However my maths skills aren't strong enough to work this out, it would be great if someone could point me in the right direction.</p>
  
  <p>Thank you,</p>
  
  <p>Josh</p>