// Using George Marsaglia's Multiply With Carry generator
int rnd10()
{
static unsigned int x = time(0);
x = 63663 * (x&65535) + (x>>16);
return (x & 65535) % 10;
}
On Sunday, February 2, 2014 2:51:47 AM UTC-5, atul007 wrote:
>
> Generate random number form 1 - 10 with probability of 1/10.You are not
> allowed to used rand() function.
>
> any simple way of achieving above with using any complex implementation of
> random number generators algorithm .
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].