But he needs a Uniform distribution function, not a Normal one.

-- barata

On Apr 19, 5:07 am, "deeepanshu shukla" <[EMAIL PROTECTED]>
wrote:
> see Random[0,1] gives  o with probability  1/2 and 1 with prob. 1/2  so when
> u  generate t=lg(b-a+1) bits  by calling it gives any number  between 0 and
> 2^t-1 = (b-a)  with probability
> 1/2^t = 1/(b-a)  .........this is a normal distribution ,
> adding a to it u obtain normal distribution for [a,b] .......
>
> when b-a+1 is not a integer u nedd to do more .........
> first generate t bits using t calls to  RAndom(0,1) then divide it by number
> containg all t is ...
>
> this gives normal distribution in the range (0,1) ......
> now multiply it by (b-a) and add a ....
>
> Finish
>
> On 4/18/08, Zhang Fan <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Can you explain it more detailedly?
>
> > A number composed of randomly generated log b bits is a number
> > distributed between [0, b], is it equal to random(a, b) ?
>
> > On Tue, Apr 15, 2008 at 5:20 PM, Chonku <[EMAIL PROTECTED]> wrote:
> > > What you need to generate is a random number between a & b using
> > > random(0,1). I think a hint should be enough for you. Any given number n
> > can
> > > be represented using log n bits.
>
> > > On 4/14/08, Vishal <[EMAIL PROTECTED]> wrote:
>
> > > > 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
>
> > --
> > zhangfan
>
> --
> 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