[OT] Generating distribution of N dice rolls
Ali Çehreli
acehreli at yahoo.com
Thu Nov 10 02:27:50 UTC 2022
On 11/9/22 18:10, H. S. Teoh wrote:
> Note that in all cases, the output array must sum to N;
I don't know what the standard deviation should be and whether it is a
function of N but the following makes sense:
- for all k, pick a random number with mean == N/k and standard
deviation == ???
- if the sum > N, remove an item from a random bucket for sum - N times
- if the sum < N, add an item to a random bucket for N - sum times
Ali
More information about the Digitalmars-d
mailing list