A Horadam-Based Pseudo-Random Number Generator

A Horadam-Based Pseudo-Random Number Generator

View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by UDORA - University of Derby Online Research Archive A Horadam-based Pseudo-random Number Generator Ovidiu D. Bagdasar Minsi Chen School of Computing and Mathematics School of Computing and Mathematics University of Derby University of Derby Derby, UK Derby, UK Email: [email protected] Email: [email protected] 1 Abstract—Uniformly distributed pseudo-random number The Horadam sequence fwngn=0 is a natural extension of generators are commonly used in certain numerical algorithms the Fibonacci sequence [7], defined by the recurrence and simulations. In this article a random number generation algorithm based on the geometric properties of complex Ho- radam sequences was investigated. For certain parameters, the wn+2 = pwn+1 + qwn; w0 = a; w1 = b; (2) sequence exhibited uniformity in the distribution of arguments. This feature was exploited to design a pseudo-random number where the parameters a; b; p and q are complex numbers (an generator which was evaluated using Monte Carlo π estima- important property of the Horadam sequence is therefore tions, and found to perform comparatively with commonly that its terms can be actually visualized in the complex used generators like Multiplicative Lagged Fibonacci and the a; b; p ’twister’ Mersenne. plane). For particular values of the parameters and q one obtains the Fibonacci sequence for (a; b) = (0; 1) and Keywords-Random number generation; Horadam sequence; (p; q) = (1; −1) and the Lucas sequence for (a; b) = (0; 1) simulation; Monte Carlo methods; linear recurrence and (p; q) = (1; 1). Some results related to Horadam se- quences are given in the survey of Larcombe et al. [9]. I. INTRODUCTION The characterization of periodic Horadam sequences was A random number generator is a core component of done in [1], the results being formulated in terms of the initial numerical algorithms based on simulation and statistical conditions a; b and the generators z1 and z2 representing sampling. For example, Monte Carlo methods are widely the roots (distinct or equal) of the quadratic characteristic used for numerically solving integrals. In such applications, polynomial of the recurrence (2) it is desirable to have a random sequence that closely resembles the underlying differential equations. The current P (x) = x2 − px + q: (3) implementations of pseudo-random number generator are based on classical methods including Linear Congruences Vieta’s relations for the polynomial P give and Lagged Fibonacci Sequences [12]. In this paper, we will discuss and evaluate the properties p = z1 + z2; q = z1z2; (4) of a random generator based on Horadam sequences. Our examination focused on the following requirements [11]: showing that the recurrence (2) defined for the coefficients p; q may alternately be defined through the solutions z ; z • Period 1 2 of the characteristic polynomial, referred to as generators. • Uniformity The periodicity of the Horadam sequence is equivalent • Correlation with z and z being distinct roots of unity, denoted by The Fibonacci numbers are the members of the integer 1 2 z = e2πip1=k1 and z = e2πip2=k2 where p ; p ; k ; k are sequence 1; 1; 2; 3; 5; 8; 13; 21; 34; ::: obeying the rule that 1 2 1 2 1 2 natural numbers. A classification of the geometric patterns each subsequent element is the sum of the previous two. produced by periodic Horadam sequences was proposed These numbers are ubiquitous in nature (flower and fruit in [2]. The Horadam sequences with a given period have patterns or bee crawling) and play a role arts, science been enumerated in [3], which gave the first enumerative or...stock exchange [8, Chapter 3]. The Fibonacci numbers context and asymptotic analysis for the O.E.I.S. sequence can be defined by the recurrence no. A102309. Fn+2 = Fn+1 + Fn;F0 = 1;F1 = 1; (1) In this paper, aperiodic Horadam sequences will be shown p to densely cover prescribed regions in the complex plane, n −n and the generalp term is given by Fn = (φ − φ )= 5, while producing a uniform distribution of the arguments in 1+ 5 where φ = 2 ≈ 1:61803 39887 ··· is the golden ratio the interval [−π; π]. This property is used to evaluate π, along (sequence A001622 in OEIS). with classical pseudo-random number generators. II. METHODOLOGY 5 In this section are presented the formulae for the general 4 term wn of the complex Horadam sequence having the 3 characteristic polynomial (3), inner and outer boundaries of 2 periodic or stable orbits, as well as the structure of degenerate 1 0 orbits. The computations and graphs in this paper were Im z −1 realized using Matlabr. −2 A. Properties of general Horadam sequences −3 −4 For distinct roots z1 6= z2 of (3), the general term of −5 1 Horadam’s sequence fw g is given by [5, Chapter 1] −5 0 5 n n=0 Re z n n wn = Az1 + Bz2 ; (5) 1 Fig. 1. First 1000 terms of the sequence fwngn=0 obtained from (5). Stars where the constants A and B can be obtained from the initial represent the initial conditions w0; w1; squares the generators z1; z2 and the dotted line the unit circle. The dotted circles represent the boundaries conditions w0 = a and w1 = b. of the annulus U(0; j jAj − jBj j; jAj + jBj): Geometric boundaries for the periodic Horadam sequences are specified in [1, Theorem 4.1], in terms of the generators z ,z and the parameters 1 2 2 az − b b − az 1.5 A = 2 ;B = 1 : (6) z2 − z1 z2 − z1 1 The periodic orbit is located inside the annulus 0.5 0 fz 2 : j jAj − jBj j ≤ jzj ≤ jAj + jBjg: (7) Im z C −0.5 The notations S = S(0; 1), U = U(0; 1) and U(0; r1; r2) −1 are used for the unit circle, unit disc, and annulus of radii −1.5 r1 and r2 centered in the origin. −2 2πix n 1 For z = re and r = 1, the orbit of fz g is a −2 −1 0 1 2 n=0 Re z regular k-gon if x = j=k 2 Q, gcd(j; k) = 1, or a dense (and uniformly distributed) subset of S, if x 2 RnQ. For r < 1 or 500 fw g1 r > 1, one obtains inward, or outward spirals, respectively. Fig. 2. First terms of sequence n n=0 from (5). Stars represent the initial conditions w0; w1; squares the generators z1; z2 and the dotted The orbits of Horadam sequences given by (5), are linear line the unit circle. The dotted circle is U(0; 2jAj): n 1 n 1 combinations of the sequences fz1 gn=0 and fz2 gn=0 for certain generators z1; z2 and coefficients A and B [1]. In Figs 2, 3, 4, the parameters are r = r = 1, B. Dense Horadam orbits 1 2 x1 = exp(1)=2; x2 = exp(2)=4 and a = 1 + 1=3i, Certain bounded orbits are dense within a circle or an b = 1:5a exp(π(x1 + x2)). annulus centered in the origin. Specifically, if r1 = r2 = 1 It is known that for an irrational number θ, the sequence 2πix1 2πix2 1 and the generators z1 = e 6= z2 = e satisfy the fnθg1 is equidistributed mod 1 (Weyl’s criterion). This relation x2 = x1q with x1; x2; q 2 R n Q, then the orbit property represents the basis for a novel random number 1 of the Horadam sequence fwngn=0 is dense in the annulus generator, which is used to evaluate the value of π. U(0; j jAj − jBj j; jAj + jBj), as one can seep in Fig.p 1. 2 5 The parameters are r1 = r2 = 1; x1 = 3 ; x2 = 15 and A. Argument of Horadam sequence terms a = 2 + 2 i, b = 3 + i. These types of dense orbits are here 3 If A = R eiφ1 ;B = R eiφ2 ; z = e2πix1 ; z = e2πix2 , the examined and used to design a random number generator. 1 2 1 2 nth Horadam term wn in polar form is given by III. RESULTS AND DISCUSSION iθ n n i(φ1+2πnx1) i(φ2+2πnx2) re = Az1 + Bz2 = R1e + R2e : Below we examine the periodicity, uniformity and auto- (8) 1 correlation for the arguments of terms of sequence fwngn=0 defined by (5) for initial conditions w0 = a; w1 = b, in the Denoting θ1 = φ1 + nx2; θ2 = φ2 + nx2, one can write particular case jAj = jBj. In this instance, sequence terms iθ iθ1 iθ2 are all located within a circle of radius 2jAj, as in Fig. 2. re = R1e + R2e ; θ1; θ2 2 R;R1;R2 > 0; (9) where R1;R2 are positive and θ1 and θ2 are real numbers. 1 For R = R1 = R2, the formula for θ gives 0.9 1 0.8 θ = (θ + θ ): (10) 2 1 2 0.7 0.6 B. Periodicity of arguments 0.5 From (10), the sequence of arguments for wn is 0.4 0.3 φ + φ 1 2 0.2 θn = + 2πn(x1 + x2): (11) 2 0.1 0 For irrational and algebraically uncorrelated values x1, x2, 0 0.2 0.4 0.6 0.8 1 x1 + x2 is also irrational, so the sequence of arguments θn is aperiodic. This property is also valid for the sequence of normalised arguments (θn + π)=(2π). Fig. 4. Normalized angle correlations: (Arg(wn); Arg(wn+1)). C. Uniform distribution of arguments E. Mixed arguments and Monte Carlo based methods The sequence of arguments produced by certain Horadam sequences is uniformly distributed in the interval [−π; π].

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us