title: Generate Array of Numbers that fit to a Probability Distribution in Ruby?
body: <p>Say I have 100 records, and I want to mock out the <code>created_at</code> date so it fits on some curve.  Is there a library to do that, or what formula could I use?  I think this is along the same track:</p>
  
  <p><a href="https://stackoverflow.com/questions/3109670/generate-random-numbers-with-probabilistic-distribution">Generate Random Numbers with Probabilistic Distribution</a></p>
  
  <p>I don't know much about how they are classified in mathematics, but I'm looking at things like:</p>
  
  <ul>
  <li>bell curve</li>
  <li>logarithmic (typical biology/evolution) curve?
  ...</li>
  </ul>
  
  <p>Just looking for some formulas in code so I can say this:</p>
  
  <ul>
  <li>Given 100 records, a timespan of <code>1.week</code>, and an interval of <code>12.hours</code></li>
  <li>set <code>created_at</code> for each record such that it fits, roughly, to <code>curve</code></li>
  </ul>
  
  <p>Thanks so much!</p>
  
  <p><strong>Update</strong></p>
  
  <p>I found <a href="http://www.ruby-forum.com/topic/104729" rel="nofollow noreferrer">this forum post about ruby algorithms</a>, which led me to <a href="https://github.com/alexgutteridge/rsruby" rel="nofollow noreferrer">rsruby</a>, an R/Ruby bridge, but that seems like too much.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I wrote this little snippet trying out the <code>gsl</code> library, getting there...</p>
  
  <p><a href="http://snippets.dzone.com/posts/show/12793" rel="nofollow noreferrer">Generate test data in Rails where created_at falls along a Statistical Distribution</a></p>