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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-13 05:25:17 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: Discrete random with given distribution ? Date: Thu, 13 Jun 2002 14:10:48 +0200 Organization: UNINETT Message-ID: 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 1023970376 12759 193.156.99.159 (13 Jun 2002 12:12:56 GMT) X-Complaints-To: news-abuse@uninett.no NNTP-Posting-Date: Thu, 13 Jun 2002 12:12:56 +0000 (UTC) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:25854 Date: 2002-06-13T14:10:48+02:00 List-Id: 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 ? 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). reinert