David,
I ran some quick tests on Windows (the new binaries) and Linux, and also
looked ta the source code. It seems that we have already changed the code
so that there is more abrupt changes in the initial values of &random,
making them appear not directly correlating with the clock. Yet from the
tests I still see the "seconds" limitation, where &random doesn't change in
the same second. I see code that brings milliseconds to the picture to
create variation in the same second but I don't see this reflected in the
output. Something is not exactly right there, and needs a closer look.
milliseconds would make it virtually impossible to reproduce the sequence,
at least for a human user.
I will add this to my "to do" list.
Thanks for your continuous feedback!
Jafar
On Thu, Feb 2, 2012 at 6:43 PM, David Gamey <david.ga...@rogers.com> wrote:
> Jafar,
>
> Even the small perturbation changes the sequence produced with ?n. If you
> run the program twice very quickly you can see the same sequence.
> Actually, &random itself seems to be clock based and grows second to second.
>
> It's a gut reaction, whenever I see any clustering/lack of spread in
> random numbers I find it disturbing. I'm used to looking for crypto
> strength randomness and have to remind myself that PRNGs of this type work
> for simulation/modeling/games but they are limited.
>
> David
>
> ------------------------------
> *From:* Jafar Al-Gharaibeh <to.ja...@gmail.com>
> *To:* David Gamey <david.ga...@rogers.com>
> *Cc:* UniconGroup <unicon-group@lists.sourceforge.net>
> *Sent:* Thursday, February 2, 2012 7:27:26 PM
> *Subject:* Re: [Unicon-group] &random behaviour and documentation.
>
> Hi David,
>
> I believe &random is the seed and not to be confused with the random
> sequence you would get if you use the "?" operator. &random probably gets
> its initial value using the system clock with some simple math. That is why
> you have numbers (seeds) that are all clustered together since probably you
> ran the program several times around the same clock. If you want the same
> sequence to be repeated, set &random at program start up to a specific
> value, zero for example, but if you want random numbers you can do
> something like
>
> ?x # where x is 10^6 for example to get numbers in the range of [0
> : 10^6-1 ]
> # (have to double check if I got the boundaries right)
>
> In any case, the Unicon book seems to be inconsistent about whether the
> value of &random is "randomly" set at start up or not. I believe it is.
>
> Jafar
>
>
>
> On Thu, Feb 2, 2012 at 3:59 PM, David Gamey <david.ga...@rogers.com>wrote:
>
> Hi Folks,
>
> I know the built-in PRNG is a bit quirky and as I understand it Unicon
> departed from Icon by randomizing it initially (although UB3/Sesrit
> contradicts this).
>
> If I run this several times on Win7/x64 UniconV12:
>
> procedure main();write("&random=",&random);end
>
> I get only minor variations:
>
> &random=20122651
> &random=20122851
> &random=20123251
> &random=20123351
> &random=20123451
> &random=20122961
> &random=20123161
> &random=20123261
> &random=20123361
> &random=20123461
>
> Does anyone have any idea what is supposed to happen?
>
> This doesn't help much for testing (fixed &random) or for simulation
> (random &random)
>
> David
>
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>
>
>
> --
> "Let there be no compulsion in religion: Truth stands out clear from
> error" [The Holy Qur'an 2:256]
>
> "Injustice anywhere is a threat to justice everywhere" Dr. King
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
>
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
> _______________________________________________
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>
>
--
"Let there be no compulsion in religion: Truth stands out clear from error"
[The Holy Qur'an 2:256]
"Injustice anywhere is a threat to justice everywhere" Dr. King
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group