Re: Random numbers
- From: bill <b92057@xxxxxxxxx>
- Date: Fri, 21 Dec 2007 10:37:17 -0800 (PST)
On Dec 21, 3:16 am, John <iamach...@xxxxxxxxx> wrote:
Given a function that returns a random number between 1-5, write one
that returns a random number between 1-7 for the case when it should
be integer and for the case it can be real.
Let S be the function that generates a RN between 1 and 5. Then
T = S_1 + S_2 + ... + S_7
For the reals , RN_7 = T/7
For intgers, RN_7 = T mod 7
Bill J
.
- Follow-Ups:
- Re: Random numbers
- From: quasi
- Re: Random numbers
- From: simple . popeye
- Re: Random numbers
- From: simple . popeye
- Re: Random numbers
- References:
- Random numbers
- From: John
- Random numbers
- Prev by Date: Re: Geometry question
- Next by Date: Re: Minimizing (a^n + b^n - c^n)^2: Was: Re: Existence of reals and observation of them
- Previous by thread: Re: Random numbers
- Next by thread: Re: Random numbers
- Index(es):