Ada Reference Manual (Ada 2022) — Legal Information

# G.2.5 Performance Requirements for Random Number Generation

1
In the strict mode, the performance of Numerics.Float_Random and Numerics.Discrete_Random shall be as specified here.

#### Implementation Requirements

2
Two different calls to the time-dependent Reset procedure shall reset the generator to different states, provided that the calls are separated in time by at least one second and not more than fifty years.
3
The implementation's representations of generator states and its algorithms for generating random numbers shall yield a period of at least 231–2; much longer periods are desirable but not required.
4/5
The implementations of Numerics.Float_Random.Random and Numerics.Discrete_Random.Random shall pass at least 85% of the individual trials in a suite of statistical tests. For Numerics.Float_Random, the tests are applied directly to the floating point values generated (that is, they are not converted to integers first), while for Numerics.Discrete_Random they are applied to the generated values of various discrete types. Each test suite performs 6 different tests, with each test repeated 10 times, yielding a total of 60 individual trials. An individual trial is deemed to pass if the chi-square value (or other statistic) calculated for the observed counts or distribution falls within the range of values corresponding to the 2.5 and 97.5 percentage points for the relevant degrees of freedom (that is, it shall be neither too high nor too low). For the purpose of determining the degrees of freedom, measurement categories are combined whenever the expected counts are fewer than 5.

Ada 2005 and 2012 Editions sponsored in part by Ada-Europe