Application of the Central Limit Theorem to dice notation parsing
By Ian Frederick Vigogne Goodbody Hunter
The Central Limit Theorem (Moivre, 1738) describes how a normal distribution can be used to approximate the sum of identical distributions.
This approximation can be used in optimizations for dice notation parsers to calculate the result of rolling a large number of dice.
A parser given a dice notation "1000000d6" will roll a six-sided dice 1000000 times. Instead a calculation can be done to select a value with a constant time independent of the number of dice.
This optimization was implemented on the GNOLL dice notation parser (Hunter, 2022) and eliminated the adverse scaling of the parser when using large values in dice notation statements.
A performance graph is attached.
Attachment: Performance_Delta.png (28.5 KB)