Some info dump while I try to figure out random number generations. No TOC for this page, but here is a tree -L1
.
├── Algorithms
│ ├── CSPRNG.md
│ └── Random Tree - Linear Congruential Algo.md
└── Random Number Generation.md
2 directories, 3 files
Citations for this chunk
- Handling generators based on linear congruential algorithm with random tree method
it employs two linear congruential generators
This is inline
Linear Congruential Generator generates a sequence of pseudo-random numbers using discontinuous piecewise linear equation The generator:
where
is the modulus is the multiplier is the increment is the seed
func linearCongruentialGenerator(X0, m, a, c, N int) []int { randNums := make([]int, N) randNums[0] = X0 for i := 1; i < N; i++ { randNums[i] = (a * randNums[i - 1] + c) % m } return randNums }
In this case, the left generator
When a new task is in need for random numbers, the parent generator in this case
When two starting points created between two consecutive values generated by
This is a variant of random tree method which can be guaranteed not to overlap over a certain period. If
We create
The sequence generated by
For the
The sequence generated by
This method can be called recursively. The subsequence corresponding to
can be further sub-divided by a second application of leap frog, with a outcome of the subsequence becoming shorter
When we know the max number
of random variables needed in a sub-sequence but we don't know how many subsequences are required
Here