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-16 22:02:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!3bae8248!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Discrete random with given distribution ? References: <3D0D0D48.B4B3156A@despammed.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 64.175.240.255 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1024290096 ST000 64.175.240.255 (Mon, 17 Jun 2002 01:01:36 EDT) NNTP-Posting-Date: Mon, 17 Jun 2002 01:01:36 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: Q[R_PJONAJUMB_LY@BCBNWX@RJ_XPDLMN@GZ_GYO^JWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Date: Mon, 17 Jun 2002 05:01:36 GMT Xref: archiver1.google.com comp.lang.ada:26117 Date: 2002-06-17T05:01:36+00:00 List-Id: > Hmmm, that's not as clumsy as I thought it would be. :-) Unfortunately, roundoff complicates it a bit. Consider: Size = 10 type Discrete_Things is (Apples, Bananas, Cantaloupes, Dates, Eggs); Probability := (Apples .. Dates => => 0.04, Eggs => 0.84); Integer( Probability(I) * Size) = 0 for I in Apples .. Dates which is fine for a one digit accuracy, but Integer( Probability(I) * Size) = 8 for I = Eggs leaving Lookup(9 .. 10) undefined. And if you just select from Lookup(1 .. 8), then Probability of random selection = Eggs is 100%