Algorithm Used by the LabVIEW Random Number (0 - 1) Function

Updated Aug 11, 2021

Reported In

Software

  • LabVIEW

Issue Details

What is the algorithm used by the LabVIEW Random Number (0 - 1) function, and what is its period?

Solution

The LabVIEW Random Number (0 - 1) function produces numbers seeded by the system clock, rectangularly (evenly) distributed between 0 and 1, excluding the number 1. The algorithm is based on the use of multiple multiplicative congruential generators. This implementation improves the frequency of occurrence of values towards the extremes of the distribution. It has a periodicity of 6.95 * 10^12 random numbers before the cycle repeats. 

A detailed explanation of the algorithm can be found in "An Efficient and Portable Pseudo-random number generator", Applied Statistics 31 (1982), 188-190 by B.A. Wichmann and I.D. Hill.

Additional Information

Please note that for some applications which require completely different sequences for generating for example a universally unique identifier (UUID) and not a pseudorandom generator, it is recommended to use a different method such as an external GUID generator. In the following article, you can find an example of using .NET GUID functions to generate a unique identifier: How to Generate a MessageID/GUID/UUID With LabVIEW?