Implementation
In 1993, George Marsaglia and Stephen Sullivan wrote papers critical of Park and Miller's 1988 implementation of the
Lehmer Generator, prompting the pair to publish a reply suggesting that the
a constant should be updated. The new recommendation is for
a to be set at 48271.
Currently, C++11's minstd_rand function uses this revised constant.
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 | 6999 | PASS |
65535 | 6950 | PASS |
8675309 | 7021 | PASS |
16777216 | 7001 | PASS |
123456789 | 7001 | 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. |
6529574 | 1656454092 | 1436846181 | 722655892 | 1745684511 | 826205848 | 863680371 | 1615149330 | 479504095 | 563422379 | 1228751101 | 1693549878 | 1086170589 | 1874743761 | 795202651 | 1104459943 | 2104371778 | 2006109091 | 411837490 | 551359511 |
910118210 | 1243148231 | 872710480 | 1568360528 | 1090039397 | 1794897440 | 1266588025 | 611124685 | 1764294443 | 1498068974 | 1070598523 | 1814822325 | 988038004 | 118174861 | 702148899 | 1842586675 | 1171181126 | 1577125871 | 1147632891 | 899123449 |
943500809 | 2041849310 | 1198580298 | 1312630931 | 502665566 | 1899292580 | 380271456 | 1540721667 | 521924853 | 1703916206 | 1115499726 | 282308868 | 1547627013 | 989916334 | 592729117 | 702577726 | 1067658322 | 1622300556 | 2078950821 | 1124256181 |
2058353361 | 1149193082 | 1049175565 | 646850914 | 1875725961 | 962338617 | 828612950 | 1092784075 | 1139263064 | 606129968 | 1182478600 | 1456646987 | 897139403 | 1808380458 | 1417804862 | 702147359 | 1768249335 | 1278616123 | 1398858553 | 972899242 |
1646917986 | 680973913 | 1907053441 | 1342638209 | 1580003826 | 482961641 | 2106384526 | 379220037 | 179798999 | 1096063202 | 512212603 | 1035331502 | 247500058 | 623771457 | 203786260 | 1491453200 | 1695635172 | 813665854 | 1136018451 | 751722076 |
345147237 | 424143801 | 1883811220 | 403852052 | 1633338273 | 157160025 | 1359325571 | 1789287303 | 1042604420 | 1278690375 | 688109551 | 606568172 | 860187414 | 510346449 | 1148524942 | 1009644330 | 1547568412 | 308671110 | 621607924 | 994583520 |
396681588 | 1252737696 | 2056791390 | 913218586 | 577542837 | 2085063120 | 1965781571 | 1529787399 | 994851387 | 441987663 | 2083931375 | 1022409851 | 1424225914 | 1415103283 | 1290729917 | 2028256743 | 54290976 | 749653156 | 1408041326 | 1852903443 |
955683150 | 1685112443 | 1824638634 | 237203756 | 1827183719 | 684433912 | 1420940704 | 1748521251 | 319528980 | 755840826 | 1592832963 | 1282943432 | 1976477533 | 291010174 | 661574127 | 1762853527 | 663089442 | 1894179894 | 546424955 | 1084850351 |
422561026 | 643606840 | 2047336138 | 1912766105 | 73251690 | 1174245028 | 1298367670 | 1343044522 | 1865785826 | 30935313 | 777359158 | 922151787 | 147875261 | 1998564750 | 1311173069 | 997169315 | 661540507 | 139982507 | 1112041935 | 875003973 |
608411487 | 1792016252 | 1775199132 | 1744818178 | 1957118545 | 2116170518 | 312437529 | 2041793125 | 633957810 | 135476760 | 510976845 | 1513599200 | 1258344966 | 2142382038 | 700851366 | 1486396995 | 293215728 | 1899172558 | 1029140435 | 2046215481 |
1504623233 | 1771138603 | 1160034696 | 398715091 | 627713247 | 1499370414 | 1615383000 | 1021570430 | 1706724116 | 1364653575 | 1279330747 | 1534735305 | 1464537096 | 1655985423 | 288561352 | 566087950 | 1049510022 | 1759039232 | 1226849139 | 78255350 |
40264777 | 148350032 | 1293915574 | 1184283206 | 519953686 | 1042994417 | 776882739 | 1547250355 | 2135610839 | 265818781 | 123586826 | 2097590127 | 1066548014 | 1713714263 | 1631106833 | 1964985782 | 1770962226 | 1236075117 | 896324459 | 1124924280 |
2095905485 | 1351572618 | 1208647618 | 1940930429 | 236186943 | 2136727277 | 470306304 | 1105967947 | 1882788864 | 445829457 | 700092260 | 1350813268 | 1061285767 | 1102859672 | 19617982 | 2086804442 | 121789953 | 1260079424 | 2114541923 | 1155423223 |
1136601196 | 964118560 | 848895623 | 905149426 | 1913144231 | 1145902660 | 1131005081 | 1416990917 | 66913910 | 185944522 | 1393860649 | 237243722 | 1608898858 | 1558164410 | 686982582 | 2041222395 | 1001537391 | 1059539697 | 570176935 | 860409433 |
490007363 | 760531315 | 374160900 | 783332630 | 1504810001 | 49198496 | 1891170481 | 1307938028 | 1604811435 | 1822664301 | 1570939628 | 1031723971 | 54546564 | 202239622 | 1995617947 | 799966158 | 1262956111 | 1388663045 | 599287737 | 1613627637 |
40305290 | 2103953055 | 1121283981 | 321207863 | 192823533 | 590635345 | 565840923 | 2010171587 | 1091570029 | 518107067 | 2099161842 | 1772875134 | 1232260364 | 1437976038 | 1574891964 | 688890444 | 1793832176 | 1384837009 | 596297623 | 1159239092 |
648820053 | 291270515 | 343592656 | 544891995 | 101782189 | 1832944530 | 1739151230 | 1138294806 | 1111988284 | 432700199 | 445355207 | 1429890627 | 2126041337 | 45371844 | 1858445431 | 37530023 | 1283025812 | 1658075219 | 233372659 | 1579894074 |
1627573790 | 1072675242 | 1128393765 | 2067691454 | 936714415 | 873338880 | 1837085870 | 1929795199 | 1745895010 | 249784842 | 1390913924 | 1877285596 | 1085552057 | 2082356647 | 170642208 | 1470236123 | 1875810924 | 768620296 | 2142822644 | 494507122 |
1072549657 | 1508731171 | 349434630 | 1222461192 | 868546766 | 297701205 | 1521784478 | 1232908256 | 500116065 | 1238897688 | 1853179439 | 1393384184 | 860121824 | 1639218853 | 550795801 | 1616560211 | 2012147789 | 1995536303 | 1153895928 | 426988249 |
1749207220 | 1219683874 | 2096099349 | 2119647174 | 630374839 | 1128059026 | 941890714 | 1630364857 | 508800638 | 1692609806 | 805111664 | 533573185 | 1339834664 | 1541552892 | 1991281182 | 1913380249 | 1801309303 | 1535981730 | 1501176155 | 733477284 |