Possible Duplicate:
Expand a random range from 1-5 to 1-7
Hi, This question is taken from http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
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.
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.
Could anyone pls solve it ?