网站首页  情感咨询  情感美文  情感百科  情感生活  学习充电  旧版美文

请输入您要查询的词汇:

 

词汇 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.

随便看

 

依恋情感网英汉例句词典收录3870147条英语例句词条,基本涵盖了全部常用英语单词的释义及例句,是英语学习的有利工具。

 

Copyright © 2004-2024 Yiyi18.com All Rights Reserved
京ICP备2021023879号 更新时间:2025/8/5 15:44:11