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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,edb23fd6716e96f5,start X-Google-Attributes: gid103376,public X-Google-Thread: 109d8a,3417cfe6445aca2d X-Google-Attributes: gid109d8a,public X-Google-ArrivalTime: 2001-09-07 03:30:33 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: yae9911@netscape.net (HP) Newsgroups: sci.math,comp.lang.ada Subject: Re: basic random number generating methods Date: 7 Sep 2001 03:30:33 -0700 Organization: http://groups.google.com/ Message-ID: <89c716bb.0109070230.398d993e@posting.google.com> References: NNTP-Posting-Host: 53.122.73.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 999858633 18246 127.0.0.1 (7 Sep 2001 10:30:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Sep 2001 10:30:33 GMT Xref: archiver1.google.com sci.math:73205 comp.lang.ada:12877 Date: 2001-09-07T10:30:33+00:00 List-Id: Ada95 has very strict requirements (probably better than any other language) on the quality of its PRNGs, see G.2.5 Performance Requirements for Random Number Generation at http://ada-auth.org/~acats/arm-html/AA-G-2-5.html The test battery can be considered as a subset of Marsaglia's DIEHARD test suite. The GNAT Ada compiler http://www.gnat.com uses an implementation of the Blum-Blum-Shub method, has a period of ~2**49, a sophisticated time dependent seed mechanism and passes the a.m. test battery. It is certainly not a LCG (as some of the C RNGs, e.g. the "portable" one proposed in the C standard) The compiler you used certainly does not pass the requirements of the Numerics Annex in the "strict mode". Which one did you use? Using Ada.Numerics.Discrete_Random should be perfectly suitable for the application you described, at least for a compiler adhering to the Reference Manual. Those who know what they are talking about may themselves decide, which one is the "ugly language" ;-) HTH Hugo Pfoertner "sachi" wrote in message news:... > hi, > I need to generate thousands of instances of n by n-1 tables for n sometimes > >200, the calculations i do on the tables seem to match the theoretical > results in some way for large 'n' but for small n say 4 or 6 when i generate > say 5 instances of them i get lots of repeated rows or even tables. > I am using ADA 95 random number generator which is a LCG, the numbers being > generated are then taken modulo of so as to get the desired range. However > they aint very random.. > > ..any suggestions for other generators or anything? > > i havent done any background on this whatsoever but how well distributed are > the digits of pi and can we possibly generate the 'kth' digit or whatever > using an appropriate function [ok so it may not be very random but well > distributed will do]?// > //..sachi