If RANDOM(0,1) gives you only 0 or 1, then RANDOM(a,b) is expected to give
you a or b.

On 4/14/08, deeepanshu shukla <[EMAIL PROTECTED]> wrote:
>
> thanks for the reply ,
> but this will give only two nos. as Random(0,1) gives only o or 1 so your
> algo gives either a or b ..
>
> but i hv got the right one........
> see first generate a  generator using Random(0,1) which  gives uniform
> distribution between 0 and 1 ....
> (generatinga bit string ad normalizing it)
>
> then multiplying by b-a...........
> enjoy
>
> On 4/14/08, Karthik Singaram Lakshmanan <[EMAIL PROTECTED]> wrote:
> >
> >
> > RANDOM(0,1)*(b-a)+a
> >
> >
> > On Mon, Apr 14, 2008 at 10:15 AM, deeepanshu shukla
> > <[EMAIL PROTECTED]> wrote:
> > > hello everybody .......
> > >  can anyone help me solving this........
> > >
> > > Describe an implementation of the procedure RANDOM(a, b) that only
> > makes
> > > calls to
> > >  RANDOM(0, 1). What is the expected running time of your procedure, as
> > a
> > > function of a and
> > >  b?
> > > --
> > > Deepanshu Shukla
> > > 3rd year , Mathematics and Computing,
> > > I.T.-B.H.U.  ,
> > > Varanasi,India
> > >  >
> > >
> >
> > > >
> >

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

Reply via email to