Knowledge

Lagged Fibonacci generator

Source 📝

693:
of the generator itself, they can evidently still lead to significant errors.". This only refers to the standard LFG where each new number in the sequence depends on two previous numbers. A three-tap LFG has been shown to eliminate some statistical problems such as failing the
540:
observed very poor behavior with R(24, 55) and smaller generators, and advised against using generators of this type altogether. ... The basic problem of two-tap generators R(a, b) is that they have a built-in three-point correlation between
340:. If addition or subtraction is used, the maximum period is (2 − 1) × 2. If multiplication is used, the maximum period is (2 − 1) × 2, or 1/4 of period of the additive case. If bitwise xor is used, the maximum period is 2 − 1. 222: 536:, referring to LFGs that use the XOR operator, states that "It is now widely known that such generators, in particular with the two-tap rules such as R(103, 250), have serious deficiencies. 117: 691: 838: 632: 599: 338: 253: 566: 498:
Note that the smaller number have short periods (only a few "random" numbers are generated before the first "random" number is repeated and the sequence restarts).
907: 494:(24, 55), (38, 89), (37, 100), (30, 127), (83, 258), (107, 378), (273, 607), (1029, 2281), (576, 3217), (4187, 9689), (7083, 19937), (9739, 23209) 128: 363: 300: 842: 744: 486: 309: 267:). The theory of this type of generator is rather complex, and it may not be sufficient simply to choose random values for 751: 37: 29: 505:
values chosen to initialise the generator be odd. If multiplication is used, instead, it is required that all the first
793: 877: 808: 912: 122:
Hence, the new term is the sum of the last two terms in the sequence. This can be generalised to the sequence:
33: 57: 637: 533: 720: 48: 41: 734:
implements this generator in its DBMS_RANDOM package (available in Oracle 8 and newer versions).
260: 634:, simply given by the generator itself ... While these correlations are spread over the size 604: 571: 761: 537: 323: 305: 256: 238: 544: 731: 766: 710:
uses a lagged Fibonacci generator with {j = 24, k = 55} for its random number generator.
901: 776: 771: 714: 695: 756: 521: 320:
The maximum period of lagged Fibonacci generators depends on the binary operation
862: 781: 227:
In which case, the new term is some combination of any two previous terms.
889: 816: 289:
If the operation used is addition, then the generator is described as an
892:, Robert M. Ziff, Computers in Physics, 12(4), Jul/Aug 1998, pp. 385–392 724: 747:' lists other PRNGs including some with better statistical qualitites: 707: 217:{\displaystyle S_{n}\equiv S_{n-j}\star S_{n-k}{\pmod {m}},0<j<k} 308:
algorithm is a variation on a GFSR. The GFSR is also related to the
275:. These generators also tend to be very sensitive to initialisation. 501:
If addition is used, it is required that at least one of the first
374:
satisfying this constraint have been published in the literature.
259:. This may be either addition, subtraction, multiplication, or the 863:
Parameterizing Parallel Multiplicative Lagged-Fibonacci Generators
509:
values be odd, and further that at least one of them is ±3 mod 8.
343:
For the generator to achieve this maximum period, the polynomial:
839:"SPRNG: Scalable Parallel Pseudo-Random Number Generator Library" 264: 890:"Four-tap shift-register-sequence random-number generators" 717:
includes an implementation of a lagged Fibonacci generator.
723:, a lagged Fibonacci generator engine, is included in the 297:
or MLFG, and if the XOR operation is used, it is called a
878:"Uniform random number generators for supercomputers" 640: 607: 574: 547: 326: 241: 131: 60: 36:is aimed at being an improvement on the 'standard' 685: 626: 593: 560: 332: 247: 216: 111: 512:It has been suggested that good ratios between 47:The Fibonacci sequence may be described by the 378:Popular pairs of primitive polynomial degrees 40:. These are based on a generalisation of the 8: 293:or ALFG, if multiplication is used, it is a 794:Toward a universal random number generator 873: 871: 639: 612: 606: 579: 573: 552: 546: 325: 316:Properties of lagged Fibonacci generators 295:Multiplicative Lagged Fibonacci Generator 282:words of state (they 'remember' the last 240: 180: 168: 149: 136: 130: 97: 78: 65: 59: 532:In a paper on four-tap shift registers, 376: 800: 112:{\displaystyle S_{n}=S_{n-1}+S_{n-2}} 7: 686:{\displaystyle p=max(a,b,c,\ldots )} 476:Another list of possible values for 366:over the integers mod 2. Values of 301:generalised feedback shift register 291:Additive Lagged Fibonacci Generator 188: 14: 745:List of random number generators 487:The Art of Computer Programming 278:Generators of this type employ 181: 908:Pseudorandom number generators 698:and Generalized Triple tests. 680: 656: 310:linear-feedback shift register 192: 182: 1: 752:Linear congruential generator 484:is on page 29 of volume 2 of 38:linear congruential generator 30:pseudorandom number generator 865:, M. Mascagni, A. Srinivasan 255:operator denotes a general 929: 18:Lagged Fibonacci generator 231:is usually a power of 2 ( 235:= 2), often 2 or 2. The 627:{\displaystyle x_{n-b}} 594:{\displaystyle x_{n-a}} 263:exclusive-or operator ( 34:random number generator 796:, G.Marsaglia, A.Zaman 687: 628: 595: 562: 520:are approximately the 334: 333:{\displaystyle \star } 249: 248:{\displaystyle \star } 218: 113: 880:, Richard Brent, 1992 688: 629: 596: 563: 561:{\displaystyle x_{n}} 335: 250: 219: 114: 28:) is an example of a 638: 605: 572: 545: 324: 239: 129: 58: 721:Subtract with carry 379: 49:recurrence relation 683: 624: 591: 558: 528:Problems with LFGs 377: 330: 245: 214: 109: 42:Fibonacci sequence 913:Fibonacci numbers 696:Birthday Spacings 474: 473: 920: 893: 887: 881: 875: 866: 860: 854: 853: 851: 850: 841:. Archived from 835: 829: 828: 826: 824: 815:. Archived from 805: 762:Mersenne Twister 743:Knowledge page ' 692: 690: 689: 684: 633: 631: 630: 625: 623: 622: 600: 598: 597: 592: 590: 589: 567: 565: 564: 559: 557: 556: 380: 339: 337: 336: 331: 306:Mersenne Twister 257:binary operation 254: 252: 251: 246: 223: 221: 220: 215: 195: 179: 178: 160: 159: 141: 140: 118: 116: 115: 110: 108: 107: 89: 88: 70: 69: 32:. This class of 928: 927: 923: 922: 921: 919: 918: 917: 898: 897: 896: 888: 884: 876: 869: 861: 857: 848: 846: 837: 836: 832: 822: 820: 819:on 9 March 2004 813:www.ccs.uky.edu 807: 806: 802: 790: 757:ACORN generator 741: 732:Oracle Database 704: 636: 635: 608: 603: 602: 575: 570: 569: 548: 543: 542: 530: 519: 515: 322: 321: 318: 274: 270: 237: 236: 164: 145: 132: 127: 126: 93: 74: 61: 56: 55: 12: 11: 5: 926: 924: 916: 915: 910: 900: 899: 895: 894: 882: 867: 855: 830: 799: 798: 797: 789: 786: 785: 784: 779: 774: 769: 764: 759: 754: 740: 737: 736: 735: 728: 718: 711: 703: 700: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 621: 618: 615: 611: 588: 585: 582: 578: 555: 551: 534:Robert M. Ziff 529: 526: 517: 513: 496: 495: 472: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 426: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 360: 359: 329: 317: 314: 272: 268: 244: 225: 224: 213: 210: 207: 204: 201: 198: 194: 191: 187: 184: 177: 174: 171: 167: 163: 158: 155: 152: 148: 144: 139: 135: 120: 119: 106: 103: 100: 96: 92: 87: 84: 81: 77: 73: 68: 64: 13: 10: 9: 6: 4: 3: 2: 925: 914: 911: 909: 906: 905: 903: 891: 886: 883: 879: 874: 872: 868: 864: 859: 856: 845:on 2010-06-14 844: 840: 834: 831: 818: 814: 810: 804: 801: 795: 792: 791: 787: 783: 780: 778: 775: 773: 772:FISH (cipher) 770: 768: 767:Xoroshiro128+ 765: 763: 760: 758: 755: 753: 750: 749: 748: 746: 738: 733: 729: 726: 722: 719: 716: 715:Boost library 712: 709: 706: 705: 701: 699: 697: 677: 674: 671: 668: 665: 662: 659: 653: 650: 647: 644: 641: 619: 616: 613: 609: 586: 583: 580: 576: 553: 549: 539: 535: 527: 525: 523: 510: 508: 504: 499: 493: 492: 491: 489: 488: 483: 479: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 431: 428: 427: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 385: 382: 381: 375: 373: 369: 365: 357: 353: 349: 346: 345: 344: 341: 327: 315: 313: 311: 307: 304:or GFSR. The 303: 302: 296: 292: 287: 285: 281: 276: 266: 262: 258: 242: 234: 230: 211: 208: 205: 202: 199: 196: 189: 185: 175: 172: 169: 165: 161: 156: 153: 150: 146: 142: 137: 133: 125: 124: 123: 104: 101: 98: 94: 90: 85: 82: 79: 75: 71: 66: 62: 54: 53: 52: 50: 45: 43: 39: 35: 31: 27: 24:or sometimes 23: 19: 885: 858: 847:. Retrieved 843:the original 833: 821:. Retrieved 817:the original 812: 809:"RN Chapter" 803: 742: 531: 522:golden ratio 511: 506: 502: 500: 497: 485: 481: 477: 475: 429: 383: 371: 367: 361: 355: 351: 347: 342: 319: 298: 294: 290: 288: 283: 279: 277: 232: 228: 226: 121: 46: 25: 21: 17: 15: 312:, or LFSR. 902:Categories 849:2005-04-11 823:13 January 788:References 782:VIC cipher 678:… 617:− 584:− 538:Marsaglia 364:primitive 328:⋆ 286:values). 243:⋆ 173:− 162:⋆ 154:− 143:≡ 102:− 83:− 739:See also 727:library. 362:must be 299:Two-tap 708:Freeciv 261:bitwise 601:, and 725:C++11 702:Usage 470:1279 825:2022 777:Pike 730:The 713:The 516:and 480:and 424:418 370:and 271:and 209:< 203:< 26:LFib 467:607 464:607 461:521 458:521 455:127 446:159 421:273 418:334 415:168 412:353 400:128 358:+ 1 265:XOR 186:mod 22:LFG 904:: 870:^ 811:. 568:, 524:. 490:: 452:63 449:31 443:71 440:55 437:17 434:10 409:97 406:31 397:65 394:24 354:+ 350:= 51:: 44:. 16:A 852:. 827:. 681:) 675:, 672:c 669:, 666:b 663:, 660:a 657:( 654:x 651:a 648:m 645:= 642:p 620:b 614:n 610:x 587:a 581:n 577:x 554:n 550:x 518:k 514:j 507:k 503:k 482:k 478:j 430:k 403:6 391:5 388:7 384:j 372:k 368:j 356:x 352:x 348:y 284:k 280:k 273:k 269:j 233:m 229:m 212:k 206:j 200:0 197:, 193:) 190:m 183:( 176:k 170:n 166:S 157:j 151:n 147:S 138:n 134:S 105:2 99:n 95:S 91:+ 86:1 80:n 76:S 72:= 67:n 63:S 20:(

Index

pseudorandom number generator
random number generator
linear congruential generator
Fibonacci sequence
recurrence relation
binary operation
bitwise
XOR
generalised feedback shift register
Mersenne Twister
linear-feedback shift register
primitive
The Art of Computer Programming
golden ratio
Robert M. Ziff
Marsaglia
Birthday Spacings
Freeciv
Boost library
Subtract with carry
C++11
Oracle Database
List of random number generators
Linear congruential generator
ACORN generator
Mersenne Twister
Xoroshiro128+
FISH (cipher)
Pike
VIC cipher

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.