title: Given a random int generator [0-5], generate [0-7]
body: <p>So this was an interview question.</p>
  
  <p>You are provided with a function <code>rand5()</code> which generates a random integer in the range [0-5] i.e. {0,1,2,3,4,5}</p>
  
  <p>a) Can you use that function to generate a random integer in the range [0-7]?</p>
  
  <p>b) Can you use that function to generate a random integer in the range [0-7] with each number having equal probability?</p>
  
  <p>You may use the function multiple times.</p>
  
  <p>One of the solution for part a, <code>((rand5() +rand5())*7)//10</code> where <code>// represents integer division</code> would give you the range [0-7] however the probabilities are not equal.</p>
  
  <p>Would love to see your answers and thought process on this.</p>