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-Thread: 103376,8147387fe25d4e2a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: Random number generation Date: Thu, 30 Dec 2010 14:30:17 +0100 Message-ID: <86aajn4cd2.fsf@gareth.avalon.lan> References: <864o9vbkwz.fsf@gareth.avalon.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net lt58G8FgJEGipbZAPoUQeQlE8Y88G4Htbgl/WAjhgV6eijhMDC X-Orig-Path: gareth.avalon.lan!not-for-mail Cancel-Lock: sha1:ig6MFlT3gFtyImWeyas1xNddFYo= sha1:fO+xMgTANIVgjErlksIL3PXKPtE= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: g2news2.google.com comp.lang.ada:17227 Date: 2010-12-30T14:30:17+01:00 List-Id: "Dmitry A. Kazakov" writes: > > BTW, a sum of n realizations of a uniformly distributed random number is > distributed uniformly with the factor n. So you need not to run a cycle > within Roll: > > function Roll > ( Dice : Generator; > Number : in Positive; > Size : in Positive; > Modifier : in Integer := 0 > ) return Integer is > begin > return Number * ((Random (Dice) mod Size) + 1) + Modifier; > end Roll; This accomplishes not quite what I want. The idea is to add multiple random results together, which will result in a standard distribution. I don't think simply multiplying one random result gives the same distribution. Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.