Re: [algogeeks] rand 7

2010-06-28 Thread Senthilnathan Maadasamy
@Saumya, This is a great approach. But it still has a small problem since there is a non-zero probability (though small) that we need to repeat this experiment infinitely many times to get a single random number in [1,7]. Is this the best we can do? -- You received this message because you

Re: [algogeeks] rand 7

2010-06-27 Thread Soumya_Prasad_Ukil
Random 5 function will ensure equal probability for all number starting from 0 to 5. Now consider an event that you will run that random 5 function twice. This will create 25 elements in your sample space. Now make seven groups of three elements. This means that each group will be having three