From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd40601768eaf8fd X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Array of Variant Records Question... Date: 1999/09/22 Message-ID: <37E922DE.9007776F@mitre.org>#1/1 X-Deja-AN: 528330745 Content-Transfer-Encoding: 7bit References: <7r5vh3$imu1@svlss.lmms.lmco.com> <37d6a45c@news1.prserv.net> <7rrmqd$l89@drn.newsguy.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 938025411 5165 129.83.41.77 (22 Sep 1999 18:36:51 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 22 Sep 1999 18:36:51 GMT Newsgroups: comp.lang.ada Date: 1999-09-22T18:36:51+00:00 List-Id: Robert A Duff wrote: > I don't know much about the theory of these things, but I was under the > impression that Random can never ever return the same value twice in a > row. Robert Eachus or somebody can tell us for sure. See previous post. There is a major distiction here between a floating-point generator and an integer or fixed-point generator. In an idealized enivronment, a floating-point generator would have zero chance of returning the same value twice in a row. (There are aleph-one possible return values and any generator can only return aleph-null of them. Therefore the probabilty of returning the same value the next time it is called is one over aleph-one.) But in a computer environment where floating point values are represented by a finite set of values, there should be a small but finite probability that two succesive values are the same. In the fixed-point or integer case, the number of possible return values is very small, so that the probability of repeated values in a long sequence approaches unity. (Even in a boolean generator, if it is truly random, there is a finite probability that you will see a long sequence of True, False, True, False, True, etc...) > > I do know that in fact the Random function is *not* random. (Okay, you asked.) Which Random function? How do you know that? Linear Congruential Generators have a lot of faults, including that it is possible to look at a short sequence and predict the next value. Or to put it differently successive values are highly correlated. In fact, if you look at the unscaled output of an LCG you will never see the same value repeated until the generator runs through its entire period. The generator used by GNAT is much different. You can only tell it is not random by knowing its period, either by running the generator that long, looking at interior details, or by being a very good cryptographer. If the generator does not behave that way, there is a bug in the code. (And there was a minor bug in the 3.10p code for the integer generator...) Pseudo-random number generators of this type are technically "more random than random," and are used to "whiten" the outpot of physical generators that sample the environment. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...