![]() |
1
3
我认为一个好的候选人是 斐波纳契线性反馈移位寄存器(LFSR) . 你可以从 Wikipedia . 只是摘录: The initial value of the LFSR is called the seed, and because the operation of the register is deterministic, the stream of values produced by the register is completely determined by its current (or previous) state. Likewise, because the register has a finite number of possible states, it must eventually enter a repeating cycle. However, an LFSR with a well-chosen feedback function can produce a sequence of bits which appears random and which has a very long cycle.
唯一的问题是lfsr的周期总是格式2
n
- 1。
所以,要抑制k值(k=((2
n
-1)-p){1…,2
(n-1)
-1})您可以添加一些逻辑,例如
|
![]() |
Giampaolo Levorato · 大熊猫随机分层抽样 1 年前 |
![]() |
jenstar · excel-如何使用randbetween选择整行 1 年前 |
![]() |
ssm1020 · R中循环采样中的神秘错误 1 年前 |
![]() |
C0untV · 随机数生成器返回重复值 1 年前 |
![]() |
Yago · Haskell中随机数生成的参数化界 1 年前 |
![]() |
Andrew Kornder · 选择按位操作序列 1 年前 |
|
mani ch · Python:反向猜谜游戏 1 年前 |