Implementation
Java is a popular programming language, and its java.util.Random package contains a special class for generating random numbers using a modified
Linear Congruential Generator.
What makes this class different than a typical LCG is what it does after the number is generated: the result is shifted right 16 places and then masked to return a 31-bit number.
This generator uses the following constants:
- M = 248
- a = 25214903917
- c = 11
Test Results
SEED | Number indicates how many results could be obtained before the generator fell into a loop. |
1138 | - | PASS |
65535 | - | PASS |
8675309 | - | PASS |
16777216 | - | PASS |
123456789 | - | PASS |
|
This generator produced an ideal distribution of outcomes. |
SEED | Minimum of 6,000 darts placed needed to pass. |
1138 | 6944 | PASS |
65535 | 6973 | PASS |
8675309 | 6990 | PASS |
16777216 | 6975 | PASS |
123456789 | 6964 | PASS |
SEED | 70% or higher required to pass. |
1138 | 101% | PASS |
65535 | 101% | PASS |
8675309 | 101% | PASS |
16777216 | 101% | PASS |
123456789 | 101% | PASS |
|
An ideal result for this test. |
626006791 | 570200856 | 63161241 | 626017252 | 48796590 | 522097234 | 144223405 | 325754240 | 965328081 | 914130530 | 383250543 | 9962753 | 550220949 | 1071650461 | 5034289 | 127062977 | 926511382 | 920447111 | 384096410 | 823436958 |
873357227 | 810846158 | 623825541 | 427821329 | 244855918 | 624712057 | 689181224 | 454114686 | 241675771 | 401804897 | 419325305 | 803387084 | 954421622 | 475416799 | 568285900 | 247928632 | 947610323 | 278948294 | 749976768 | 331597926 |
133078353 | 421640339 | 241723484 | 504660153 | 620982342 | 577198819 | 733208948 | 324094435 | 974242850 | 798347045 | 365578577 | 517332159 | 955616173 | 618913423 | 453483408 | 388130397 | 1019389331 | 461257301 | 33969482 | 232458846 |
639029794 | 468400152 | 341240437 | 596424322 | 7258449 | 294216092 | 309243273 | 196287359 | 296713475 | 205179838 | 447417702 | 417652500 | 6665101 | 268069028 | 330321268 | 432560988 | 89171573 | 339200309 | 87628811 | 113540967 |
702988668 | 833159628 | 467577621 | 327591174 | 870194655 | 201958951 | 582430450 | 263155686 | 497251800 | 825823397 | 857925531 | 478546399 | 827214954 | 261712048 | 100538377 | 733106318 | 524897630 | 498343031 | 602968023 | 569624608 |
399649160 | 473940448 | 49916710 | 299132784 | 652505934 | 1022268093 | 669117632 | 447975764 | 962019178 | 455866429 | 19502719 | 829869876 | 808291822 | 996333988 | 681436143 | 653467867 | 680902536 | 147694142 | 791989042 | 771421585 |
336894727 | 342635153 | 376006692 | 220865129 | 421308190 | 684404945 | 290551230 | 4876758 | 823843942 | 285961368 | 675707327 | 398485636 | 302904233 | 491735510 | 444827272 | 991558501 | 659412061 | 379545349 | 868398919 | 64254729 |
863823725 | 129430177 | 1056164440 | 805447730 | 888492607 | 37446615 | 752319975 | 115099047 | 446717426 | 267029116 | 870421209 | 482794312 | 289836775 | 948251200 | 142449132 | 773492322 | 88813699 | 250320162 | 535883548 | 426277700 |
984504626 | 625277222 | 785811272 | 2235410 | 828156590 | 543249734 | 349664277 | 953698520 | 243552896 | 554781093 | 604848658 | 367109345 | 421203654 | 237909770 | 162108701 | 795479369 | 674839351 | 381706635 | 290498308 | 368172241 |
430582372 | 542640776 | 860523630 | 459086066 | 911363904 | 227128795 | 562652156 | 438295604 | 84933346 | 449646157 | 113300394 | 1024889279 | 734245512 | 805379403 | 934115451 | 208524850 | 494494175 | 433048025 | 661728341 | 99029427 |
880536960 | 55956165 | 517162537 | 906239814 | 1001449918 | 219396128 | 25311318 | 628462946 | 473069982 | 92227562 | 912666959 | 265061313 | 788109862 | 148161036 | 384475770 | 657046135 | 650862042 | 339855242 | 119460187 | 565308998 |
952097923 | 57903352 | 334223089 | 36654640 | 836885298 | 305457197 | 530624864 | 582901324 | 584216708 | 492863798 | 368790479 | 938290141 | 390867238 | 976604813 | 299868307 | 428945056 | 320172187 | 6282379 | 777804172 | 1040804708 |
816464444 | 888094746 | 749638351 | 837266400 | 736192128 | 980436142 | 267166597 | 978640832 | 206684285 | 258049397 | 387584274 | 422705920 | 1015050158 | 937321932 | 98898041 | 137880957 | 472435190 | 613686517 | 91240958 | 963530697 |
24867301 | 659507463 | 126964492 | 410681662 | 658640185 | 668679461 | 437801561 | 381973333 | 950624166 | 566984434 | 994050631 | 1031917112 | 256626137 | 5973827 | 647751053 | 698063509 | 422743226 | 672471574 | 15548950 | 526171316 |
186908913 | 296962499 | 730035752 | 203721931 | 335155884 | 634550641 | 728366025 | 607789201 | 270760350 | 553333451 | 669564509 | 932321808 | 488588618 | 844620530 | 620865171 | 320999359 | 66200960 | 8082100 | 65044610 | 444195279 |
596195112 | 907668990 | 450928654 | 403476677 | 955668797 | 264998543 | 589162384 | 118974792 | 128863772 | 856866286 | 817697974 | 430938427 | 665922815 | 692167326 | 930183078 | 359367182 | 386525123 | 765725839 | 746879081 | 43932753 |
261744881 | 148460758 | 1023774343 | 443678857 | 233967099 | 448791712 | 1019629 | 949217607 | 709525957 | 335574884 | 612004887 | 48743029 | 633289575 | 123923543 | 354354282 | 1040390643 | 604972337 | 753974053 | 289667809 | 895157602 |
24653806 | 614965213 | 102929900 | 591778110 | 489346669 | 662786604 | 1022013588 | 478154034 | 527684924 | 50387917 | 1015859682 | 1040550311 | 258153142 | 144335424 | 34774657 | 537139869 | 312685376 | 241260473 | 62208162 | 381105086 |
329561551 | 884229979 | 208247327 | 525906352 | 712340652 | 207401125 | 1032545507 | 491021482 | 735278715 | 353150508 | 752821640 | 925970505 | 478673785 | 881533834 | 211559489 | 1060885668 | 622269188 | 108744342 | 466083833 | 934065309 |
932480352 | 985274324 | 892049340 | 723725690 | 523703735 | 403762735 | 80643670 | 912675763 | 592404577 | 162757093 | 761639993 | 633612557 | 98031974 | 988385986 | 315917219 | 350592999 | 891793216 | 1017505168 | 317152000 | 395247571 |