网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Linear congruential generator
释义

Linear congruential generator

中文百科

线性同余方法

线性同余方法(LCG)是个产生伪随机数的方法。

它是根据递归公式:

N_{j+1} \equiv (A \times N_j + B ) \pmod{M}

其中A,B,M是产生器设置的常数。

LCG的周期最大为M,但大部分情况都会少于M。要令LCG达到最大周期,应符合以下条件:

  1. B,M互质;
  2. M的所有质因数都能整除A-1
  3. M是4的倍数,A-1也是;
  4. A,B,N_0都比M小;
  5. A,B是正整数。
英语百科

Linear congruential generator 线性同余方法

Visualisation of generation of pseudo-random numbers in [0, 8] using a linear congruential generator. The top two rows show a generator with m = 9, a = 2 and c = 0 outputting numbers from left to right until the output equals the seed, when the sequence repeats. A seed of 1 gives a cycle length of 6 but a seed of 3 gives a cycle length of only 2. Using a = 4 and c = 1 (bottom row) gives a full cycle length of 9 with any seed.
Hyperplanes of a linear congruential generator in three dimensions

A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generator algorithms. The theory behind them is relatively easy to understand, and they are easily implemented and fast, especially on computer hardware which can provide modulo arithmetic by storage-bit truncation.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/17 17:17:12