title: Selecting a random row that hasnt been selected much before?
body: <p>Lets just put it at its simplest, a table with two fields: 'item_id' &amp; 'times_seen'.</p>
  
  <pre><code>| item_id | times_seen |
  ----------+-------------
  |   1001  |     48     |
  |   1002  |     25     |
  |   1003  |      1     |
  |   1004  |     12     |
  |   1005  |     96     |
  |   1006  |     35     |
  </code></pre>
  
  <p>I'm trying to find a way to randomly select a row, but give preference to items that haven't been selected much before.</p>
  
  <p><em>(obviously, a second query would be sent to increment the 'times-seen' field after it has been selected)</em></p>
  
  <p>Although my current "project" is  a php/mysql one, I'd like language agnostic solutions if possible. I'd much rather have a math based solution that could be adapted elsewhere. I'm not opposed to a php solution though. I'd just like to be able to understand how the code works rather than just copy and paste it. </p>