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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6e2278eaed9619d6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-13 05:49:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!not-for-mail From: Reinert Korsnes Newsgroups: comp.lang.ada Subject: Re: Discrete random with given distribution ? Date: Thu, 13 Jun 2002 14:49:45 +0200 Organization: UNINETT Message-ID: References: <4A30iZwu6HO0@eisner.encompasserve.org> NNTP-Posting-Host: sthrkou.ffi.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: dolly.uninett.no 1023972713 13487 193.156.99.159 (13 Jun 2002 12:51:53 GMT) X-Complaints-To: news-abuse@uninett.no NNTP-Posting-Date: Thu, 13 Jun 2002 12:51:53 +0000 (UTC) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:25856 Date: 2002-06-13T14:49:45+02:00 List-Id: Larry Kilgallen wrote: > In article , Reinert Korsnes > writes: >> Hi, >> >> Is it under Ada any "natural" way to generate random >> elements of enumeration type (for example (a,b,c)) >> and with a given non-uniform probability distribution ? > > If you want truly random data, you need a connection to some physical > source of randomness, such as thermistor noise. > > If you really meant "pseudo-random", continue the discussion. Pseudo. The point this time was to make pretty code - not to be subtle about random numbers. reinert > >> I.e. so for example "a" is produced by probability 1/2 >> and "b" and "c" both with probability 1/4 ? >> >> (Yes, I can do it via Float_Random, but the code looks ugly).