Talk:Random number generator (included): Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Main types of PRNG: new section)
Line 11: Line 11:


Probably needs more work. Feel free to massage! –[[User:Dkf|Donal Fellows]] 16:17, 24 January 2010 (UTC)
Probably needs more work. Feel free to massage! –[[User:Dkf|Donal Fellows]] 16:17, 24 January 2010 (UTC)
: Not much massaging done, just added some WP links. Ta! --[[User:Paddy3118|Paddy3118]] 04:06, 25 January 2010 (UTC)

Revision as of 04:06, 25 January 2010

Remove draft status?

The entries so far are as I had hoped. --Paddy3118 15:03, 24 January 2010 (UTC)

Main types of PRNG

This might be text sometime to transfer to the main task page.

The main types of PRNG that are in use are the Linear Congruential Generator and the Generalized Feedback Shift Register (of which the mersenne twister generator is a subclass). The last main type is where the output of one of the previous ones (typically a mersenne twister) is fed through a cryptographic hash function to maximize unpredictability of individual bits.
LCGs have the advantage of not requiring much state and being very fast to calculate, but produce random numbers with spectral problems. This makes them unsuitable for both Monte Carlo simulation and cryptography. By contrast, GFSRs (of which the Mersenne Twister is is particularly high quality version) require a lot more internal state and are considerably more expensive to compute and initialize (so much so that it is normal to use a LCG or simpler GFSR to drive the initialization); GFSRs tend to have much higher quality spectral properties than LCGs, and are suitable for use in Monte Carlo simulation. Neither LCGs nor GFSRs should be used for the most demanding applications (cryptography) without additional steps.

Probably needs more work. Feel free to massage! –Donal Fellows 16:17, 24 January 2010 (UTC)

Not much massaging done, just added some WP links. Ta! --Paddy3118 04:06, 25 January 2010 (UTC)