Hi
The Random function in R:Base is doing the same function as all other
languages I have worked in.
The function was designed to created repeatable random number sequences. I
guess they were using it for testing purposes.
So to say that this is a bug, in my opinion is incorrect.
Although my view is like yours in that it should create a non-repeatable
sequence.
I realized the only way for this to happen is to have a plugin card that
measured
the following.
1. the azimuth of the moon
2. the relative humidity
3. your mood
4. the price of tea in china
5. the velocity of the wind generated by that butterfly in Africa
6. the rpm of you cpu fan
and then factor them into a seed (a number between 0 and 1)
This is the only way to get true random, but the cost of developing the card
was
to much. so I just use the seconds / minutes and the random function to get
a somewhat
random sequence
Ben Johansen
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Manuel de Aguiar
Sent: Monday, April 23, 2001 11:20 AM
To: [EMAIL PROTECTED]
Subject: Re: Randomly generated unique numbers - Razzak's Reply
Hello Jouke,
Did you get the same result as I did on your computer when you type:
set var vrand = (random(1000))
and repeating this process?
I performed this test on a W98 and a W95 computer with identical results.
It
could be that It only happens on the two test computers I used and that is
why
RDCC would check this issue.
The whole purpose of having a function that generates a random number is so
that
you do not have to go through convolutions to get a random number. The
technique of using a date or time component to change the seed value of the
random number generator is something that the programmer of the random
function
should have used so that when anyone using the random number generator
function
would correctly generate a random number.
If you create a random number function that generate predictable numbers, it
is
NOT a random number generator function. The test I performed repeated the
numbers EXACTLY every time you enter RBase.
For a user to have to add a seed value to a supposedly random number
generator
function is at best a workaround for a defective function.
Manuel
Jouke Hendrik de Vries wrote:
> Why is this seen as a BUG?
> There is not a single product on the market who remembers earlier values
> after the database has been closed and connected again.
> The only possible way is to load every obtained value in a table (single
> column) that does not accept duplicates.
> (RANDOM(1000)) continues until a value is accepted
>
> SET ERR VAR verr
> WHILE #date IS NOT NULL THEN
> SET VAR vtest = (RANDOM(1000)
> LOAD RANDOMTAB
> .vtest
> END
> IF verr = 0 THE
> BREAK
> ENDI
> ENDW
>
> Another method is to use RANDOM in conjunction with values extracted from
> DATE and TIME variables, but even then you cannot quarantee a unique
result.
>
> Jouke
>
> ----- Original Message -----
> From: Manuel de Aguiar <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 23, 2001 6:51 PM
> Subject: Re: Randomly generated unique numbers - Razzak's Reply
>
> > Hello Rich,
> > I think you just found a bug.
> > Using RBase for Windows V6.5++ Build: 1.840gxRT03 I tried your command
> line
> > verbatim seven time and got the following number:
> > 10
> > 3
> > 335
> > 33
> > 355
> > 217
> > 536
> > I then exit RBase, open RBase again SIX TIMES and got the same numbers.
> Since
> > you discover it, please report it to RDCC so that the Dream Team can
> correct
> > this problem.
> > Thank you,
> > Manuel de Aguiar
> > M|D Enterprises
> >
> > rich wrote:
> >
> > > One item to watch out for:
> > > 1. If you set a variable to a random number like: set var vrand =
> > > (random(1000)) it will generate a number.
> > > 2. if you exit rbase and restart it, define the variable again you
will
> get
> > > the same random number.
> > >
> > > rich
> > > ----- Original Message -----
> > > From: "A. Razzak Memon" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, April 23, 2001 10:35 AM
> > > Subject: Re: Randomly generated unique numbers - Razzak's Reply
> > >
> > > >
> > > > Bob,
> > > >
> > > > Use the R:BASE (RANDOM(value)) Function!
> > > >
> > > > http://www.RSyntax.com
> > > >
> > > > Enjoy!
> > > >
> > > > Very Best Regards,
> > > >
> > > > Razzak.
> > > >
> > > > At 10:05 AM 4/23/2001 -0400, Bob Powell wrote:
> > > > >
> > > > >Does anyone know how to randomly generate a nine
> > > > >digit number that is always unique?
> > > >
> > > >
> > > > ===================================-============================
> > > > R:BASE Developers's Conference: http://www.rbase.com/conference
> > > > Official R:BASE List Server: mailto:[EMAIL PROTECTED]
> > > > RBTI Events/Training: http://www.rbase2000.com/events
> > > > R:DCC Members: http://www.rbase2000.com/rdcc
> > > > ================================================================
> > > > R:BASE, Oterro & R:Tango are registered trademarks of RBTI.
> > > > ==================================-=============================
> >