Closed DK96-OS closed 2 years ago
Remaining Tasks:
A sequence of Linear
and Uniform
probability Elements that span consecutive ranges of integers:
This is a common requirement. There is a known method of mediating the interaction between the number of states of the two Linear
Elements.
The Lowest Common Multiple is an important number that solves this problem. A potential for integer overflow is present when calculating the Lowest Common Multiple of numbers with large differences in prime number composition.
The LCM has to be multiplied again to obtain the relevant number, and so to limit this inflation, the Linear
Element accepts Short
type integers, limited to around 200, as input parameters.
The limit of 200 can be increased, but there should be a strategy to validate that the inputs can work together without causing an overflow.
Another piece of the strategy is to look for changes in work required on large inputs. The CompareFactors.lcm
method is the most impacted by changes in inputs. It appears that this method has no tests on inputs larger than 256.
Create a Generator with a linearly changing probability.
The outcomes are arranged in consecutive order from 1 to Length. Length must be greater than zero.
The first outcome 1, has the highest probability. Each outcome reduces in probability at a constant Rate. Rate must be greater than zero.