draft
play

Draft Multiple Streams of Random Numbers for Parallel Computers: - PowerPoint PPT Presentation

1 Draft Multiple Streams of Random Numbers for Parallel Computers: Design and Implementation Pierre LEcuyer Universit e de Montr eal, Canada and InriaRennes, France CEA, Saclay, June 2014 2 Draft What do we want? Sequences


  1. 12 Draft 1. Computer games for kids: the “look” suffices. 2. Stochastic simulation (Monte Carlo): Simulate a mathematical model of the behavior of a complex system (hospital, call center, logistic system, financial market, etc.). Must reproduce the relevant statistical properties of the mathematical model. Algorithmic generators. 3. Lotteries , casino machines, Internet gambling, etc. It should not be possible (or practical) to make an inference that provides an advantage in guessing the next numbers. Stronger requirements than for simulation. Algorithmic generators + physical noise.

  2. 12 Draft 1. Computer games for kids: the “look” suffices. 2. Stochastic simulation (Monte Carlo): Simulate a mathematical model of the behavior of a complex system (hospital, call center, logistic system, financial market, etc.). Must reproduce the relevant statistical properties of the mathematical model. Algorithmic generators. 3. Lotteries , casino machines, Internet gambling, etc. It should not be possible (or practical) to make an inference that provides an advantage in guessing the next numbers. Stronger requirements than for simulation. Algorithmic generators + physical noise. 4. Cryptology : Even stronger requirements. Observing any part the output should not help guessing (with reasonable effort) any other part. Often: very limited computational power and memory. Nonlinear algorithmic generators with random parameters.

  3. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. s 0

  4. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. s 0   g � u 0

  5. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. f − − − − → s 1 s 0   g � u 0

  6. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. f − − − − → s 1 s 0     g g � � u 0 u 1

  7. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. f f f f − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1 s 0         g g g g � � � � u 0 u 1 · · · u n u n +1

  8. 13 Draft Algorithmic generator S , finite state space; s 0 , germe (´ etat initial); f : S → S , transition function; g : S → [0 , 1], output function. f f f f f f · · · − − − − → s ρ − 1 − − − − → s 0 − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1           g g g g g � � � � � · · · u ρ − 1 u 0 u 1 · · · u n u n +1 Period of { s n , n ≥ 0 } : ρ ≤ cardinality of S .

  9. 14 Draft f f f f f f · · · − − − − → s ρ − 1 − − − − → s 0 − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1 −           g g g g g � � � � � · · · u ρ − 1 u 0 u 1 · · · u n u n +1 Goal: if we observe only ( u 0 , u 1 , . . . ), difficult to distinguish from a sequence of independant random variables over (0 , 1).

  10. 14 Draft f f f f f f · · · − − − − → s ρ − 1 − − − − → s 0 − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1 −           g g g g g � � � � � · · · u ρ − 1 u 0 u 1 · · · u n u n +1 Goal: if we observe only ( u 0 , u 1 , . . . ), difficult to distinguish from a sequence of independant random variables over (0 , 1). Utopia: passes all statistical tests. Impossible! Compromise between speed / good statistical behavior / predictability.

  11. 14 Draft f f f f f f · · · − − − − → s ρ − 1 − − − − → s 0 − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1 −           g g g g g � � � � � · · · u ρ − 1 u 0 u 1 · · · u n u n +1 Goal: if we observe only ( u 0 , u 1 , . . . ), difficult to distinguish from a sequence of independant random variables over (0 , 1). Utopia: passes all statistical tests. Impossible! Compromise between speed / good statistical behavior / predictability. With random seed s 0 , an RNG is a gigantic roulette wheel. Selecting s 0 at random and generating s random numbers means spinning the wheel and taking u = ( u 0 , . . . , u s − 1 ). Number of possibilities cannot exceed card ( S ). Ex.: shuffling 52 cards. Lottery machines: modify the state s n frequently.

  12. 14 Draft f f f f f f · · · − − − − → s ρ − 1 − − − − → s 0 − − − − → s 1 − − − − → · · · − − − − → s n − − − − → s n +1 −           g g g g g � � � � � · · · u ρ − 1 u 0 u 1 · · · u n u n +1 Goal: if we observe only ( u 0 , u 1 , . . . ), difficult to distinguish from a sequence of independant random variables over (0 , 1). Utopia: passes all statistical tests. Impossible! Compromise between speed / good statistical behavior / predictability. With random seed s 0 , an RNG is a gigantic roulette wheel. Selecting s 0 at random and generating s random numbers means spinning the wheel and taking u = ( u 0 , . . . , u s − 1 ). Number of possibilities cannot exceed card ( S ). Ex.: shuffling 52 cards. Lottery machines: modify the state s n frequently.

  13. 15 Draft Uniform distribution over [0 , 1] s . If we choose s 0 randomly in S and we generate s numbers, this corresponds to choosing a random point in the finite set Ψ s = { u = ( u 0 , . . . , u s − 1 ) = ( g ( s 0 ) , . . . , g ( s s − 1 )) , s 0 ∈ S} . We want to approximate “ u has the uniform distribution over [0 , 1] s .”

  14. 15 Draft Uniform distribution over [0 , 1] s . If we choose s 0 randomly in S and we generate s numbers, this corresponds to choosing a random point in the finite set Ψ s = { u = ( u 0 , . . . , u s − 1 ) = ( g ( s 0 ) , . . . , g ( s s − 1 )) , s 0 ∈ S} . We want to approximate “ u has the uniform distribution over [0 , 1] s .” Measure of quality: Ψ s must cover [0 , 1] s very evenly.

  15. 15 Draft Uniform distribution over [0 , 1] s . If we choose s 0 randomly in S and we generate s numbers, this corresponds to choosing a random point in the finite set Ψ s = { u = ( u 0 , . . . , u s − 1 ) = ( g ( s 0 ) , . . . , g ( s s − 1 )) , s 0 ∈ S} . We want to approximate “ u has the uniform distribution over [0 , 1] s .” Measure of quality: Ψ s must cover [0 , 1] s very evenly. Design and analysis: 1. Define a uniformity measure for Ψ s , computable without generating the points explicitly. Linear RNGs. 2. Choose a parameterized family (fast, long period, etc.) and search for parameters that “optimize” this measure.

  16. 16 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  17. 17 Draft 0.005 u n u n − 1 0 0.005 x n = 4809922 x n − 1 mod 60466169 and u n = x n / 60466169

  18. 18 Draft 1 u n u n − 1 0 1 x n = 51 x n − 1 mod 101; u n = x n / 101. Good uniformity in one dimension, but not in two!

  19. 19 Draft Myth 1. After 60 years of study and thousands of articles, this problem is certainly solved and RNGs available in popular software must be reliable.

  20. 19 Draft Myth 1. After 60 years of study and thousands of articles, this problem is certainly solved and RNGs available in popular software must be reliable. No. Myth 2. I use a fast RNG with period length > 2 1000 , so it is certainly excellent!

  21. 19 Draft Myth 1. After 60 years of study and thousands of articles, this problem is certainly solved and RNGs available in popular software must be reliable. No. Myth 2. I use a fast RNG with period length > 2 1000 , so it is certainly excellent! No. Example 1. u n = ( n / 2 1000 ) mod 1 for n = 0 , 1 , 2 , ... . Exemple 2. Subtract-with-borrow.

  22. 20 Draft A single RNG does not suffice. One often needs several independent streams of random numbers, e.g., to: ◮ Run a simulation on parallel processors. ◮ Compare similar systems with well synchronized common random numbers (for sensitivity analysis, derivative estimation, optimization). The idea is to simulate the two configurations with the same uniform random numbers U j used at the same places, as much as possible. This requires good synchronization of the random numbers. Can be complicated to implement and manage when the two configurations do not need the same number of U j ’s.

  23. A solution : RNG with multiple streams and substreams. 21 Draft Can create RandomStream objects at will, behave as “independent’ streams viewed as virtual RNGs. Can be further partitioned in substreams. Example: With MRG32k3a generator, streams start 2 127 values apart, and each stream is partitioned into 2 51 substreams of length 2 76 . Current state ⇓ . . . . . . . . start start next stream substream substream

  24. A solution : RNG with multiple streams and substreams. 21 Draft Can create RandomStream objects at will, behave as “independent’ streams viewed as virtual RNGs. Can be further partitioned in substreams. Example: With MRG32k3a generator, streams start 2 127 values apart, and each stream is partitioned into 2 51 substreams of length 2 76 . RandomStream stream1 = new MRG32k3a(); RandomStream stream2 = new MRG32k3a(); double u = stream1.nextDouble(); .... double z = NormalGen.nextDouble (stream1, 0.0, 1.0); stream1.resetNextSubstream(); .... stream1.resetStartStream(); Current state ⇓ . . . . . . . . start start next stream substream substream

  25. 22 Draft Example of “poor” multiple streams (visible dependence): Image synthesis on GPUs. (Thanks to Steve Worley, from Worley Laboratories) .

  26. Draft 23

  27. Draft 24

  28. 25 Draft Linear multiple recursive generator (MRG) x n = ( a 1 x n − 1 + · · · + a k x n − k ) mod m , u n = x n / m . State: s n = ( x n − k +1 , . . . , x n ). Max. period: ρ = m k − 1.

  29. 25 Draft Linear multiple recursive generator (MRG) x n = ( a 1 x n − 1 + · · · + a k x n − k ) mod m , u n = x n / m . State: s n = ( x n − k +1 , . . . , x n ). Max. period: ρ = m k − 1. Numerous variants and implementations. For k = 1: classical linear congruential generator (LCG). Structure of the points Ψ s : x 0 , . . . , x k − 1 can take any value from 0 to m − 1, then x k , x k +1 , . . . are determined by the linear recurrence. Thus, ( x 0 , . . . , x k − 1 ) �→ ( x 0 , . . . , x k − 1 , x k , . . . , x s − 1 ) is a linear mapping. It follows that Ψ s is a linear space; it is the intersection of a lattice with the unit cube.

  30. 26 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  31. 26 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  32. 26 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  33. 26 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  34. 26 Draft 1 u n u n − 1 0 1 x n = 12 x n − 1 mod 101; u n = x n / 101

  35. 27 Draft 0.005 u n u n − 1 0 0.005 x n = 4809922 x n − 1 mod 60466169 and u n = x n / 60466169

  36. 28 Draft 1 u n u n − 1 0 1 x n = 51 x n − 1 mod 101; u n = x n / 101. Good uniformity in one dimension, but not in two!

  37. 29 Draft Example: lagged-Fibonacci x n = ( x n − r + x n − k ) mod m .

  38. 29 Draft Example: lagged-Fibonacci x n = ( x n − r + x n − k ) mod m . Very fast, but bad. All points ( u n , u n + k − r , u n + k ) belong to only two parallel planes in [0 , 1) 3 .

  39. 30 Draft Example: subtract-with-borrow (SWB) State ( x n − 48 , . . . , x n − 1 , c n − 1 ) where x n ∈ { 0 , . . . , 2 31 − 1 } and c n ∈ { 0 , 1 } : ( x n − 8 − x n − 48 − c n − 1 ) mod 2 31 , = x n c n = 1 if x n − 8 − x n − 48 − c n − 1 < 0 , c n = 0 otherwise , x n / 2 31 , = u n Period ρ ≈ 2 1479 ≈ 1 . 67 × 10 445 .

  40. 30 Draft Example: subtract-with-borrow (SWB) State ( x n − 48 , . . . , x n − 1 , c n − 1 ) where x n ∈ { 0 , . . . , 2 31 − 1 } and c n ∈ { 0 , 1 } : ( x n − 8 − x n − 48 − c n − 1 ) mod 2 31 , = x n c n = 1 if x n − 8 − x n − 48 − c n − 1 < 0 , c n = 0 otherwise , x n / 2 31 , = u n Period ρ ≈ 2 1479 ≈ 1 . 67 × 10 445 . In Mathematica versions ≤ 5 . 2: u n = x 2 n / 2 62 + x 2 n +1 / 2 31 . modified SWB with output ˜ Great generator?

  41. 30 Draft Example: subtract-with-borrow (SWB) State ( x n − 48 , . . . , x n − 1 , c n − 1 ) where x n ∈ { 0 , . . . , 2 31 − 1 } and c n ∈ { 0 , 1 } : ( x n − 8 − x n − 48 − c n − 1 ) mod 2 31 , = x n c n = 1 if x n − 8 − x n − 48 − c n − 1 < 0 , c n = 0 otherwise , x n / 2 31 , = u n Period ρ ≈ 2 1479 ≈ 1 . 67 × 10 445 . In Mathematica versions ≤ 5 . 2: u n = x 2 n / 2 62 + x 2 n +1 / 2 31 . modified SWB with output ˜ Great generator? No, not at all; very bad...

  42. 31 Draft All points ( u n , u n +40 , u n +48 ) belong to only two parallel planes in [0 , 1) 3 . Ferrenberg et Landau (1991). “Critical behavior of the three-dimensional Ising model: A high-resolution Monte Carlo study.” Ferrenberg, Landau et Wong (1992). “Monte Carlo simulations: Hidden errors from “good” random number generators.”

  43. 31 Draft All points ( u n , u n +40 , u n +48 ) belong to only two parallel planes in [0 , 1) 3 . Ferrenberg et Landau (1991). “Critical behavior of the three-dimensional Ising model: A high-resolution Monte Carlo study.” Ferrenberg, Landau et Wong (1992). “Monte Carlo simulations: Hidden errors from “good” random number generators.” Tezuka, L’Ecuyer, and Couture (1993). “On the Add-with-Carry and Subtract-with-Borrow Random Number Generators.” Couture and L’Ecuyer (1994) “On the Lattice Structure of Certain Linear Congruential Sequences Related to AWC/SWB Generators.”

  44. 32 Draft Combined. Two [or more] MRGs in parallel: x 1 , n = ( a 1 , 1 x 1 , n − 1 + · · · + a 1 , k x 1 , n − k ) mod m 1 , = ( a 2 , 1 x 2 , n − 1 + · · · + a 2 , k x 2 , n − k ) mod m 2 . x 2 , n One possible combinaison: := ( x 1 , n − x 2 , n ) mod m 1 ; := z n / m 1 ; z n u n

  45. 32 Draft Combined. Two [or more] MRGs in parallel: x 1 , n = ( a 1 , 1 x 1 , n − 1 + · · · + a 1 , k x 1 , n − k ) mod m 1 , = ( a 2 , 1 x 2 , n − 1 + · · · + a 2 , k x 2 , n − k ) mod m 2 . x 2 , n One possible combinaison: := ( x 1 , n − x 2 , n ) mod m 1 ; := z n / m 1 ; z n u n L’Ecuyer (1996): the sequence { u n , n ≥ 0 } is also the output of an MRG of modulus m = m 1 m 2 , with small added “noise”. The period can reach ( m k 1 − 1)( m k 2 − 1) / 2. Permits one to implement efficiently an MRG with large m and several large nonzero coefficients. Parameters: L’Ecuyer (1999); L’Ecuyer et Touzin (2000). Implementations with multiple streams.

  46. 33 Draft A recommended generator: MRG32k3a Choose 6 integers: x − 2 , x − 1 , x 0 in { 0 , 1 , . . . , 4294967086 } (not all 0) and y − 2 , y − 1 , y 0 in { 0 , 1 , . . . , 4294944442 } (not all 0). For n = 1 , 2 , . . . , let x n = (1403580 x n − 2 − 810728 x n − 3 ) mod 4294967087 , = (527612 y n − 1 − 1370589 y n − 3 ) mod 4294944443 , y n u n = [( x n − y n ) mod 4294967087] / 4294967087 .

  47. 33 Draft A recommended generator: MRG32k3a Choose 6 integers: x − 2 , x − 1 , x 0 in { 0 , 1 , . . . , 4294967086 } (not all 0) and y − 2 , y − 1 , y 0 in { 0 , 1 , . . . , 4294944442 } (not all 0). For n = 1 , 2 , . . . , let x n = (1403580 x n − 2 − 810728 x n − 3 ) mod 4294967087 , = (527612 y n − 1 − 1370589 y n − 3 ) mod 4294944443 , y n u n = [( x n − y n ) mod 4294967087] / 4294967087 . ( x n − 2 , x n − 1 , x n ) visits each of the 4294967087 3 − 1 possible values. ( y n − 2 , y n − 1 , y n ) visits each of the 4294944443 3 − 1 possible values. The sequence u 0 , u 1 , u 2 , . . . is periodic, with 2 cycles of period ≈ 2 191 ≈ 3 . 1 × 10 57 .

  48. 33 Draft A recommended generator: MRG32k3a Choose 6 integers: x − 2 , x − 1 , x 0 in { 0 , 1 , . . . , 4294967086 } (not all 0) and y − 2 , y − 1 , y 0 in { 0 , 1 , . . . , 4294944442 } (not all 0). For n = 1 , 2 , . . . , let x n = (1403580 x n − 2 − 810728 x n − 3 ) mod 4294967087 , = (527612 y n − 1 − 1370589 y n − 3 ) mod 4294944443 , y n u n = [( x n − y n ) mod 4294967087] / 4294967087 . ( x n − 2 , x n − 1 , x n ) visits each of the 4294967087 3 − 1 possible values. ( y n − 2 , y n − 1 , y n ) visits each of the 4294944443 3 − 1 possible values. The sequence u 0 , u 1 , u 2 , . . . is periodic, with 2 cycles of period ≈ 2 191 ≈ 3 . 1 × 10 57 . Robust and reliable generator for simulation. Used by SAS, R, MATLAB, Arena, Automod, Witness, Spielo gaming, ...

  49. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: x n − 1 = 00010100101001101100110110100101

  50. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: ( x n − 1 ≪ 6) XOR x n − 1 x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101

  51. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: = (( x n − 1 ≪ 6) XOR x n − 1 ) ≫ 13 B x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101 B = 00111101000101011010010011100101

  52. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: = (( x n − 1 ≪ 6) XOR x n − 1 ) ≫ 13 B x n = ((( x n − 1 with last bit at 0) ≪ 18) XOR B ) . x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101 B = 00111101000101011010010011100101 x n − 1 00010100101001101100110110100100 00010100101001101100110110100100

  53. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: = (( x n − 1 ≪ 6) XOR x n − 1 ) ≫ 13 B x n = ((( x n − 1 with last bit at 0) ≪ 18) XOR B ) . x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101 B = 00111101000101011010010011100101 x n − 1 00010100101001101100110110100100 00010100101001101100110110100100 x n = 00110110100100011110100010101101

  54. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: = (( x n − 1 ≪ 6) XOR x n − 1 ) ≫ 13 B x n = ((( x n − 1 with last bit at 0) ≪ 18) XOR B ) . x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101 B = 00111101000101011010010011100101 x n − 1 00010100101001101100110110100100 00010100101001101100110110100100 x n = 00110110100100011110100010101101 The first 31 bits of x 1 , x 2 , x 3 , . . . , visit all integers from 1 to 2147483647 (= 2 31 − 1) exactly once before returning to x 0 .

  55. 34 Draft Faster RNG: operations on blocks of bits. Example: Choose x 0 ∈ { 2 , . . . , 2 32 − 1 } (32 bits). Evolution: = (( x n − 1 ≪ 6) XOR x n − 1 ) ≫ 13 B x n = ((( x n − 1 with last bit at 0) ≪ 18) XOR B ) . x n − 1 = 00010100101001101100110110100101 10010100101001101100110110100101 00111101000101011010010011100101 B = 00111101000101011010010011100101 x n − 1 00010100101001101100110110100100 00010100101001101100110110100100 x n = 00110110100100011110100010101101 The first 31 bits of x 1 , x 2 , x 3 , . . . , visit all integers from 1 to 2147483647 (= 2 31 − 1) exactly once before returning to x 0 . For real numbers in (0 , 1): u n = x n / (2 32 + 1) .

  56. 35 Draft More realistic: LFSR113 Take 4 recurrences on blocks of 32 bits, in parallel. The periods are 2 31 − 1, 2 29 − 1, 2 28 − 1, 2 25 − 1. We add these 4 states by a XOR, then we divide by 2 32 + 1. The output has period ≈ 2 113 ≈ 10 34 . Good generator, faster than MRG32k3a, although successive values of bit i of the output obey a linear relationship or order 113, for each i .

  57. 36 Draft 1 u n u n − 1 0 1 1000 points generated by LFSR113

  58. 37 Draft 1 u n u n − 1 0 1 1000 points generated by MRG32k3a + LFSR113 (add mod 1)

  59. 38 Draft General linear recurrences modulo 2 ( x n , 0 , . . . , x n , k − 1 ) t , x n = A x n − 1 mod 2 = (state, k bits) ( y n , 0 , . . . , y n , w − 1 ) t , y n = B x n mod 2 = ( w bits) � w j =1 y n , j − 1 2 − j = = . y n , 0 y n , 1 y n , 2 · · · , (output) u n

  60. 38 Draft General linear recurrences modulo 2 ( x n , 0 , . . . , x n , k − 1 ) t , x n = A x n − 1 mod 2 = (state, k bits) ( y n , 0 , . . . , y n , w − 1 ) t , y n = B x n mod 2 = ( w bits) � w j =1 y n , j − 1 2 − j = = . y n , 0 y n , 1 y n , 2 · · · , (output) u n Clever choice of A : transition via shifts, XOR, AND, masks, etc., on blocks of bits. Very fast. Special cases: Tausworthe, LFSR, GFSR, twisted GFSR, Mersenne twister, WELL, xorshift, etc.

  61. 38 Draft General linear recurrences modulo 2 ( x n , 0 , . . . , x n , k − 1 ) t , x n = A x n − 1 mod 2 = (state, k bits) ( y n , 0 , . . . , y n , w − 1 ) t , y n = B x n mod 2 = ( w bits) � w j =1 y n , j − 1 2 − j = = . y n , 0 y n , 1 y n , 2 · · · , (output) u n Clever choice of A : transition via shifts, XOR, AND, masks, etc., on blocks of bits. Very fast. Special cases: Tausworthe, LFSR, GFSR, twisted GFSR, Mersenne twister, WELL, xorshift, etc. Each coordinate of x n and of y n follows the recurrence x n , j = ( α 1 x n − 1 , j + · · · + α k x n − k , j ) , with characteristic polynomial P ( z ) = z k − α 1 z k − 1 − · · · − α k − 1 z − α k = det( A − z I ) . Max. period: ρ = 2 k − 1 reached iff P ( z ) is primitive.

  62. Uniformity measures. Example: k = 10 , 2 10 = 1024 points 39 Draft 1 u n +1 0 1 u n

  63. Uniformity measures. Example: k = 10 , 2 10 = 1024 points 39 Draft 1 u n +1 0 1 u n

  64. Uniformity measures. Example: k = 10 , 2 10 = 1024 points 39 Draft 1 u n +1 0 1 u n

  65. 40 Draft Uniformity measures based on equidistribution. Example: we partition [0 , 1) s in 2 ℓ equal intervals. Gives 2 s ℓ cubic boxes. For each s and ℓ , the s ℓ bits that determine the box can be written as M x 0 . Each box contains 2 k − s ℓ points of Ψ s iff M has (full) rank s ℓ . We then say that those points are equidistributed for ℓ bits in s dimensions.

  66. 40 Draft Uniformity measures based on equidistribution. Example: we partition [0 , 1) s in 2 ℓ equal intervals. Gives 2 s ℓ cubic boxes. For each s and ℓ , the s ℓ bits that determine the box can be written as M x 0 . Each box contains 2 k − s ℓ points of Ψ s iff M has (full) rank s ℓ . We then say that those points are equidistributed for ℓ bits in s dimensions. If this holds for all s and ℓ such that s ℓ ≤ k , the RNG is called maximally equidistributed.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend