Random number generation
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/137783/expand-a-random-range-from-1-5-to-1-7">Expand a random range from 1-5 to 1-7</a>  </p>
</blockquote>



<p>Hi,
  This question is taken from 
<a href="http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html" rel="nofollow">http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html</a></p>

<blockquote>
  <p>Given a function which produces a
  random integer in the range 1 to 5,
  write a function which produces a
  random integer in the range 1 to 7.</p>
</blockquote>

<p>I am not getting a way to generate all random numbers 1 to 7 with almost equal probability by using 1 to 5 random generator.</p>

<p>Could anyone pls solve it ?</p>
