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:43:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!news-in-sanjose!newsfeed.onecall.net!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Discrete random with given distribution ? Date: 13 Jun 2002 07:35:02 -0600 Organization: LJK Software Message-ID: <4A30iZwu6HO0@eisner.encompasserve.org> References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1023971719 11698 192.135.80.34 (13 Jun 2002 12:35:19 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Thu, 13 Jun 2002 12:35:19 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:25855 Date: 2002-06-13T07:35:02-06:00 List-Id: 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. > 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).