Period of the d-Sequence Based Random Number Generator

This paper presents an expression to compute the exact period of a recursive random number generator based on d-sequences. Using the multi-recursive version of this generator we can produce large number of pseudorandom sequences.

Authors: Suresh Thippireddy, S, eep Chalasani

Period of the d-Sequence Based Random Number Generator
1 Period of the d-Sequence B ased Ra ndom Nu mber Gener ator Suresh Babu Thippireddy and Sandeep Chala sani Abstract : This paper presents an ex pression to compute the exact period of a recursive random number generator based on d -sequences. Using the multi-recursive version of this generator we can produc e large number of pseudorandom sequences. Introduction Random num ber generators (RNGs) are of utmos t importance in man y co mputer science applications [ 4-9]. One would li ke the period of the r andom sequ ence to be as large as possible, and also want it to h ave excellent autocorrelation properties [9] . Parakh h as st udied some properties of a recursive random number generat or based on d- sequences [ 1,6] with the obj ective of havin g long periods. In this paper, we examine such RNGs afresh and provide some ne w results. For a back ground of d-seque nces, see [2-4 and 9] and for approa ches t o the stud y of rando mness in sequences, s ee [10]. Binary d- sequences ma y be easily generated using the form ula [4]: a (i) = 2 i mod p mod 2 where p is a prime. Recursive d-Sequence Generator The recursive d-sequence based RNG that we use is given b elow: (S i mod p 11 +S i mod p 12 +…S i mod p 1n ) k[i] mod p 21 mod2 (S i mod p 11 +S i modp 12 +… S i mod p 1n) k[i] mod p 22 mod 2 ….. (S i mod p 11 +S i mod p 12 +…S i mod p 1n ) k[i] mod p 2m mod 2 (1) This is different from the one used b y Parakh in as much as that “k” is r eplaced by “k[i]” which has a bearing on th e calculation of the period of the random sequ ence. The sequence ma y be generated b y the algorithm given below: Algorithm: 1) Select the seed element S to be a primi tive element of all the primes (p 11 ,p 12 …p 1n ). 2) Calculate the period of (S i mod p 11 + S i mod p 12 +…+S i mod p 1n ),let us assume it to be ‘ t ’. Find the second l evel seeds S 1 ,S 2 ,…S t ,using the above formula 3) Select the second level pri mes as( p 21 , p 22 , p 23 ,..., p 2m ) 2 4) Calculate the period for each of the s econd level seeds with each second le vel primes i.e., from i =1 to t and store it in k[i] . 5) for i =1 to t Generate a sequence wit h a period k[i ] , using the formula (S i mod p 11 + S i mod p 12 + ………+ S i mod p 1n ) k[i] mod p 21 mod 2 (S i mod p 11 + S i mod p 12 +………+ S i mod p 1n ) k[i] mod p 22 mod 2 … (S i mod p 11 + S i mod p 12 +……… + S i mod p 1n ) k[i] mod p 2m mod2. 6) We then would be able to generate a sequence of period ‘L’. where L = Σ k[i] , where i=1 to t Calculation of the period at first level: 1) Calculate the exact period all of th e primes p 11 ,p 12 ,….p 1n with the seed S. let the periods be r 1 , r 2 ,… .r n . 2) Find the LCM of all the above periods and t hen store it in‘t’. t = LCM (r 1 , r 2 … r n ). Calculation of periods at the second level and length of the sequence: 1) Calculate t he ex act pe riod of each s econd lev el p rimes wi th the second le vel seed and find the LCM of the above p eriod ,store it in k[i] . i.e., k [i] =L CM(period(p 21 ,S i ),period(p 22 ,S i ), …..,period(p 2m ,S i )). Then the period of the sequen ce ‘L’ is found b y the Summation of the above periods. L = Σ k[i],where i=1 to t In the examples below w e confine ourselves to simple cases dealing with just a few primes. It can be readil y extended to cases where t he number of primes is man y and where the size of the pri mes is large. Examples: 1) Let us assume that S=2 , p 11 =3, p 12 =5, p 21 =7, p 22 =11 We get the second level seeds as S 1 =4 , S 2 =5 , S 3 =5, S 4 =2. Then for the above seeds with the second level primes we get periods as, 3 k[1]=15, k[2] =30, k[3]=30, k[4]=30 Then calculate the summation of above pe riods to get the length of the sequence whi ch is same as the period of the s equence. Here we get it as L=105. 2) If S=2 , P 11 = 23, P 12 =29, P 21 =47, P 22 =53 We have 308 number of second level seeds, then for the above seeds we get 308 periods. By summation of the above periods we will get the period of the entire sequence as 253253 Multi-recursive random number generator An expression for a multi-recursiv e RNG is given below: ((S i mod p 11 +S i mod p 12 +…S i mod p 1n ) k[i] mod p 21 + (S i mod p 11 +S i modp 12 +… S i mod p 1n) k[i] mod p 22 …..+ (S i mod p 11 +S i mod p 12 +…S i mod p 1n ) k[i] mod 2m ) v[i] mod p 3 mod2 (2) The algorithm for this same as the above wit h an additional step for calcul ating the period of the t hird level seeds with th e third level prime and storing it in an arra y v[i] , here i=1 to L. The operation is replaced by the ‘+’ operation. The length of the sequen ce obtained here is Σ v[i], where i=1 to L, but the period remains same as the period o f the recursive d-sequence. The RNG obtained usin g equation (2) may be further generalized b y adding further nested layers of the mod ulus operation. Examples : 1) Let p 11 = 11, p 12 =13 ,p 21 =5 , p 22 =7 for p 3 =7 we get the period= 367 and t he length of the sequence =1059 for p 3 =13 we get the period= 367 and t he length of the sequence =2066 for p 3 =19 we get the period=367 and th e length of the sequence =3373 for p 3 =31 we get the period=367 and th e length of the sequence =4398 2) Let p 11 =17, p 12 =19 ,p 21 =7, p 22 =11 for p 3 = 5 we get the period= 855 and t he length of the sequence =2531 4 for p 3 =11 we get the period=855 and th e length of the sequence =5323 for p 3 =19 we get the period=885 and th e length of the sequence =8995 for p 3 =31 we get the period=885 and the length of the sequence =10296 3) Let p 11 = 3, p 12 =5, p 21 =7, p 22 =11 for p 3 = 7 we get the period=105 and th e length of the sequence =412 for p 3 =11 we get the period=105 and th e length of the sequence =729 for p 3 =17 we get the period=105 and th e length of the sequence =1332 for p 3 =23 we get the period= 105 and the length of the sequence = 1672 The measure of randomness of a discr ete sequence x is R(x) given b y the ex pression below: n k C x R n k ∑ = − = 1 ) ( 1 ) ( where C(k) is the autocor relation value for k and n is the period of sequence . The value of the autocorrelation is defi ned as in the equation below: k j n j j a a n k C + = ∑ = 0 1 ) ( Here are some Tables and graphs for recursive random number generator with seed =2 and the primes and perio d labeled. 5 Table 1: Randomness m easure of different recursive sequences Here in each table the initial prim es are kept same and the second level pri mes are changed. The seed value i s Seed=2. Table 2: Var y ing period b y changing second-level p rimes Seed P 11 P 12 P 21 P 22 Period Randomness 2 3 5 19 17 396 0.953015 2 3 5 23 29 770 0.976219 2 5 7 19 17 1056 0.972376 2 11 13 29 3 1 9625 0. 990949 2 3 5 7 1 1 105 0. 872200 2 23 29 7 11 4112 0.984785 P 11 P 12 P 21 P 22 Period 3 5 7 11 105 3 5 19 17 396 3 5 23 29 770 3 5 31 37 342 3 5 41 43 1050 3 3 47 53 4186 3 5 71 73 1350 3 5 79 83 11193 3 5 101 103 12750 3 5 107 109 8586 3 5 113 127 714 3 5 131 137 24310 3 5 139 149 20424 3 5 163 167 29133 6 -0 .8 -0 .6 -0 .4 -0 .2 0 0 .2 0 .4 0 .6 0 .8 1 1 .2 1 2 1 4 1 6 1 8 1 1 0 1 1 2 1 1 4 1 1 6 1 1 8 1 2 0 1 2 2 1 2 4 1 2 6 1 2 8 1 3 0 1 3 2 1 3 4 1 3 6 1 3 8 1 Figure 1: Autocorrelatio n graph for primes 3-5-17-19 Figure 2 : Autocorrelation graph for 3 -5-23-29 7 Figure 3 : Autocorrelation graph for 3 -5-131-137 Table 3: Var y ing period b y changing second-level p rimes P 11 P 12 P 21 P 22 Period 23 29 7 11 4112 23 29 19 17 17706 23 29 31 37 21093 23 29 41 43 84595 23 29 47 53 253253 Figure 4 : Autocorrelation graph for Primes 23 -29-19-17 8 From the above tables we can sa y that b y keeping the second level p rimes p 21, p 22 constant and increasing the initi al primes p 11 , p 12 the period can be increased Conclusion We have provided an expressi on for computing the period of the d-sequenc e based recursive RNG, which is somewhat different from that of Parakh. We hav e presented results summarizin g the proper ties of such an RN G. The multi-recursive RNG described in this paper can provide us a flexi ble approach to generating random sequences with var ying and large periods. Extensi ons of this work will be to investigate recursive versions of the cubic transformation [ 8] and the application of one-wa y transformations to ea ch step of the recursive mapping [7] . References 1. A. Parakh , A d-Sequence based Recursive Random Number Generator , 2 006; arXiv: cs/0603029 2. S. Kak and A. Chatterjee, On de cimal sequences. IEEE Transacti ons on Information Theory , IT-27: 647 – 652, 1981. 3. S. Kak, Encr y ption and error-correction codin g using d-sequences. IEEE Transactions on C omputers , C-34: 803-809, 1985. 4. S. Kak, New results on d-sequenc es. Electronics Letters , 23: 61 7, 1987. 5. N. Mandhani and S. Kak. W atermarking using decimal sequences. C ryptologia, 29: 50-58, 2005; arXiv: cs.C R/0602003 6. S. Kak, A new random number generator, 2006. http://www.ece.lsu.edu/k ak/RNG.pdf 7. L. Blum, M. Blum, M. , and M. Shub, A simple unpredictable ps eudorandom number generator. SIAM J. Comput. , 15: 364-383, 1986. 8. S. Kak, The cubic publi c key transformation. Circuits, S y stems and Signal Processing, vol. 26, pp. 353-359, 2007 ; arXiv: cs.CR/0 602097 9. S.K.R. Gangasani, Test ing d-sequences for their randomness, 2007;

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment