Re: Random numbers
- From: quasi <quasi@xxxxxxxx>
- Date: Sat, 22 Dec 2007 13:12:01 -0500
On Fri, 21 Dec 2007 10:37:17 -0800 (PST), bill <b92057@xxxxxxxxx>
wrote:
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
For one thing, T mod 7 can be 0, which is not even in the correct
range. But even ignoring that, if you were trying to create generators
which produce uniformly distributed (pseudo) random numbers, you
failed.
quasi
.
- References:
- Random numbers
- From: John
- Re: Random numbers
- From: bill
- Random numbers
- Prev by Date: real analysis - it is neither continuum nor discrete
- Next by Date: Re: real analysis - it is neither continuum nor discrete
- Previous by thread: Re: Random numbers
- Next by thread: Residues of poles of elliptic functions
- Index(es):
Relevant Pages
|