It's not uniformly distributed, suppose the given random generator is
uniformly distributed

-----Original Message-----
From: algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Sandesh
Sent: Tuesday, January 30, 2007 11:09 PM
To: Algorithm Geeks
Subject: [algogeeks] Re: (need help) How to solve this random number
generatioin problem?



suppose "given" function returns the random numbers between 1 -5  then
you can have

       (given + given) % 7 +1

which will generate between 1 and 7 .

       -Sandesh Hegde


On Jan 31, 6:57 am, "Jialin" <[EMAIL PROTECTED]> wrote:
> Question:
>
> Given a program which can generate one of {1, 2, 3, 4, 5} randomly.
> How can we get another generator which can generate one of
> {1,2,3,4,5,6,7} randomly?
>
> Thank you!




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to