Given a value
such that
we can map
onto a different range such that
by using the formula:
Given a range
represented as an ordered set
, the inverted-range ordered set
is obtained using the formula
such that
where
is a function that returns the largest element in a set.
Or, in other words, the set
is the sequential union of all elements
obtained via the formula
as follows:
Given an arbitrary random number
, in order to obtain a random number
such that
and notice that
, the following formula can be used:
where:
represents the remainder division of the two left operands (in this case
) and right operands (
)