[MUD-Dev] Expected value and standard deviation.

Kwon J. Ekstrom justice at softhome.net
Fri Sep 5 18:01:50 CEST 2003


Ben Chambers wrote:
> From: Zach Collins (Siege)

> -infinite to infinite.  Furthermore, if you investigate the amount
> of random number generation necessary, using the normal
> distribution only requires 1 random number for every generation
> (actually 2 for the first, and then none for the second, and then
> 2 for the third... but average is 1).  The dice require a number
> of random numbers equal to the number of dice.  While not a
> significant bottleneck, it is still a potential optimization.

Most muds I know of (including my own) optimize this by generating a
range.

Give the format: xDy+z

    min = x+z
    max = (x*y)+z

At the very least:

    min = x
    max = (x*y)

This guaruntees a single random number.  Additionally it allows the
ever so popular dice format.

-- Kwon J. Ekstrom
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list