GenerateRandom - Generating Pseudo-Random Numbers How...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Generating Pseudo-Random Numbers - How computers generate "random" numbers Inputs X0 seed 123,457 LCG Method for Generating Pseudo-Random Numbers a constant multiplier 16,807 c increment 0 m modulus 2,147,483,647 <- the max number inter can be 32 bit i Xi Random # aX+c 0 123,457 2074941799 1 2,074,941,799 0.9662201 34873546815793 From 2 559,872,160 0.2607108 9409771393120 Sample Theoretical Diff % Diff 3 1,645,535,613 0.7662622 27656517047691 Mean 0.5080 0.5000 0.0080 1.60% 4 1,222,641,625 0.5693369 20548937791375 Minimum 0.0039 0.0000 0.0039 5 1,814,256,879 0.8448292 30492215365353 Maximum 0.9992 1.0000 -0.0008 -0.08% 6 95,061,600 0.0442665 1597700311200 Standard Devia 0.2961 0.2887 0.0074 2.58% 7 2,119,961,479 0.9871840 35630192577553 8 1,291,390,176 0.6013504 21704394688032 9 1,924,951,450 0.8963754 32352659020150 10 817,878,095 0.3808542 13746077142665 11 34,318,218 0.0159807 576786289926 12 1,260,672,530 0.5870464 21188123211710 13 1,049,550,408 0.4887350 17639793707256 14 363,030,798 0.1690494 6101458621986 15 457,580,859 0.2130777 7690561497213 16 422,557,306 0.1967686 7101920641942 17 192,221,313 0.0895100 3230663607591 18 848,202,503 0.3949751 14255739467921 19 743,019,135 0.3459952 12487922601945 20 305,194,640 0.1421173 5129406314480 21 1,215,365,444 0.5659486 20426647017308 22 1,930,050,691 0.8987499 32438361963637 23 621,475,702 0.2893972 10445142123514 24 1,929,148,153 0.8983296 32423193007471 25 484,905,065 0.2258015 8149799427455 26 98,987,090 0.0460945 1663676021630 27 1,523,678,852 0.7095183 25608470465564 28 1,875,458,736 0.8733285 31520834975952 29 70,005,286 0.0325988 1176578841802 30 1,905,286,893 0.8872183 32022156810651 31 1,028,150,234 0.4787698 17280120982838 32 1,467,559,076 0.6833854 24665265390332 33 1,415,704,537 0.6592388 23793746153359 34 1,774,828,246 0.8264688 29829538330522 35 990,473,692 0.4612253 16646891341444 36 1,745,593,547 0.8128553 29338190744429 37 1,416,642,762 0.6596757 23809514900934 38 363,706,645 0.1693641 6112817582515 39 1,079,123,153 0.5025059 18136822832471 40 1,323,433,556 0.6162718 22242947775692 41 1,459,643,713 0.6796996 24532231884391 42 1,526,184,710 0.7106851 25650586420970 43 1,041,741,202 0.4850985 17508544382014 44 110,208,023 0.0513196 1852266242561 45 1,135,338,847 0.5286833 19081640001529 46 1,247,797,934 0.5810512 20971739876738 47 1,562,063,783 0.7273926 26253606000881 48 618,416,306 0.2879725 10393722854942 49 2,049,487,109 0.9543668 34445729840963 50 92,143,083 0.0429075 1548648795981 51 313,086,494 0.1457923 5262044704658 52 709,769,508 0.3305122 11929096120956 53 1,971,945,518 0.9182587 33142488321026 54 373,196,875 0.1737833 6272319878125 55 1,667,628,885 0.7765502 28027838670195 56 1,029,593,198 0.4794417 17304372878786 57 2,097,134,907 0.9765545 35246546381949 58 2,044,767,385 0.9521690 34366405439695 59 224,636,754 0.1046046 3775469924478 60 193,673,052 0.0901860 3255062984964 61 1,625,259,759 0.7568206 27315740769513 62 1,896,263,320 0.8830164 31870497619240 63 1,840,297,760 0.8569554 30929884452320 64 1,824,968,226 0.8498171 30672240974382 65 1,879,527,928 0.8752234 31589225885896 66 1,888,922,173 0.8795979 31747114961611 67 864,208,010 0.4024282 14524744024070 68 1,312,119,409 0.6110032 22052790907063 69 281,336,020 0.1310073 4728414488140 70 1,802,981,093 0.8395785 30302703230051 71 1,708,970,881 0.7958016 28722673596967 72 79,818,342 0.0371683 1341506873994 73 1,477,078,266 0.6878182 24825254416662 74 343,457,342 0.1599348 5772487546994 75 51,503,858 0.0239834 865625341406 76 189,431,665 0.0882110 3183777993655 77 1,207,228,801 0.5621597 20289894458407 78 468,961,551 0.2183772 7881836787657 79 571,803,167 0.2662666 9610295827769 80 306,507,444 0.1427287 5151470611308 81 1,804,825,802 0.8404375 30333707254214 82 500,740,339 0.2331754 8415942877573 83 2,101,948,627 0.9787961 35327450573989 84 1,344,580,839 0.6261192 22598370161073 85 399,743,692 0.1861452 6718492231444 86 1,163,383,628 0.5417427 19552988635796 87 150,029,861 0.0698631 2521551873827 88 406,072,249 0.1890921 6824856288943 89 153,258,777 0.0713667 2575820265039 90 987,372,286 0.4597810 16594766010802 91 1,159,870,433 0.5401068 19493942367431 92 1,233,303,612 0.5743017 20728133806884 93 621,646,040 0.2894765 10448004994280 94 497,051,625 0.2314577 8353946661375 95 235,274,545 0.1095582 3954259277815 96 741,883,688 0.3454665 12468839144216 97 549,089,734 0.2556898 9228551159338 98 813,928,179 0.3790148 13679690904453 99 220,073,063 0.1024795 3698767969841 100 801,129,707 0.3730551 13464586985549 101 2,012,002,506 0.9369117 33815726118342 102 1,448,612,680 0.6745628 24346833312760 103 811,206,721 0.3777476 13633951359847 104 1,725,168,691 0.8033443 28994910189637 105 1,733,471,490 0.8072106 29134455332430 106 1,692,177,228 0.7879814 28440422670996 107 1,296,733,775 0.6038387 21794204556425 108 1,540,506,669 0.7173543 25891295585883 109 1,232,737,651 0.5740382 20718621700357 110 1,846,957,748 0.8600567 31041818870636 111 2,090,236,898 0.9733424 35130611544686 112 2,074,047,060 0.9658034 34858508937420 113 554,379,316 0.2581530 9317453164012 114 1,669,103,326 0.7772368 28052619600082 115 40,719,321 0.0189614 684369628047 116 1,469,828,301 0.6844421 24703404254907 117 899,863,466 0.4190316 15124005273062 118 1,425,430,888 0.6637680 23957216934616 119 2,036,852,331 0.9484833 34233377127117 120 340,310,290 0.1584693 5719595044030 121 846,092,069 0.3939923 14220269403683 122 1,780,176,896 0.8289595 29919433091072 123 690,921,068 0.3217352 11612310389876 124 866,310,547 0.4034073 14560081363429 125 142,236,769 0.0662342 2390573376583 126 424,077,472 0.1974765 7127470071904 127 2,119,331,158 0.9868905 35619598772506 128 1,435,003,364 0.6682255 24118101538748 129 1,860,182,938 0.8662152 31264094638966 130 1,027,705,940 0.4785629 17272653733580 131 442,760,759 0.2061765 7441480076513 132 449,239,658 0.2091935 7550370932006 133 1,965,912,801 0.9154495 33041096446407 134 2,060,537,312 0.9595125 34631450602784 135 1,129,311,262 0.5258765 18980334380434 136 873,908,248 0.4069452 14687775924136 137 1,135,262,303 0.5286477 19080353526521 138 2,108,806,573 0.9819896 35442712072411 139 641,962,323 0.2989370 10789460762661 140 502,920,133 0.2341904 8452578675331 141 83,040,739 0.0386689 1395665700373 142 1,948,813,470 0.9074870 32753707990290 143 287,406,246 0.1338340 4830436776522 144 746,054,419 0.3474087 12538936620133 145 1,927,088,947 0.8973707 32388583932229 146 235,568,175 0.1096950 3959194317225 147 1,381,955,804 0.6435233 23226531197828 148 1,495,555,523 0.6964223 25135801675061 149 1,653,070,573 0.7697710 27783157120411 150 1,161,179,172 0.5407162 19515938343804 151 1,754,443,515 0.8169764 29486932156605 152 1,981,683,295 0.9227932 33306151139065 153 827,257,742 0.3852219 13903720869794 154 911,739,116 0.4245616 15323599322612 155 1,303,501,267 0.6069901 21907945794469 156 1,465,111,422 0.6822457 24624127669554 157 1,080,173,052 0.5029948 18154468484964 158 1,789,216,873 0.8331690 30071367984511 159 154,475,570 0.0719333 2596270904990 160 2,110,659,414 0.9828524 35473852771098 161 1,717,889,952 0.7999548 28872576423264 162 1,806,272,996 0.8411114 30358030243772 163 1,201,409,780 0.5594500 20192094172460 164 1,452,923,366 0.6765702 24419283012362 165 246,462,325 0.1147680 4142292296275 166 1,943,824,859 0.9051640 32669864405213 167 195,683,402 0.0911222 3288850937414 168 1,053,473,857 0.4905620 17705735114599 169 1,879,928,731 0.8754100 31595962181917 170 35,283,606 0.0164302 593011566042 171 306,079,470 0.1425294 5144277652290 172 1,054,317,725 0.4909549 17719918004075 173 1,030,432,678 0.4798326 17318482019146 174 1,173,889,738 0.5466350 19729564826566 175 632,561,577 0.2945594 10631462424639 176 1,418,371,989 0.6604809 23838578019123 177 1,509,537,423 0.7029331 25370795468361 178 423,662,703 0.1972833 7120499049321 179 1,590,759,516 0.7407551 26735895185412 180 1,871,263,909 0.8713752 31450332518563 181 434,508,248 0.2023337 7302780124136 182 1,335,724,336 0.6219951 22449518915152 183 1,872,353,061 0.8718823 31468637896227 184 1,560,016,736 0.7264394 26219201281952 185 573,435,729 0.2670268 9637734297303 186 1,975,173,214 0.9197617 33196736207698 187 933,992,372 0.4349241 15697609796204 188 1,651,820,281 0.7691888 27762143462767 189 1,622,357,998 0.7554693 27266970872386 190 371,006,427 0.1727633 6235505018589 191 1,359,991,348 0.6332953 22857374585836 192 1,706,130,815 0.7944791 28674940607705 193 1,738,952,961 0.8097631 29226582415527 194 1,477,463,504 0.6879976 24831729111728 195 375,701,467 0.1749496 6314414555869 196 812,633,689 0.3784120 13657934411023 197 2,085,899,750 0.9713228 35057717098250 198 46,560,975 0.0216816 782550306825 199 866,259,317 0.4033834 14559220340819 200 1,428,697,806 0.6652893 24012124025442 201 1,109,368,335 0.5165899 18645153606345 202 700,583,091 0.3262344 11774700010437 203 47,173,936 0.0219671 792852342352 204 430,876,609 0.2006426 7241743167463 205 428,309,779 0.1994473 7198602455653 206 237,270,909 0.1104879 3987812167563 207 2,082,518,731 0.9697484 35000892311917 208 1,203,833,111 0.5605785 20232823096577 209 1,379,658,190 0.6424534 23187915199330 210 1,534,262,671 0.7144467 25786352711497 211 1,516,561,968 0.7062042 25488856996176 212 373,589,933 0.1739664 6278926003931 213 1,831,303,750 0.8527673 30778722126250 214 986,497,446 0.4593737 16580062574922 215 1,488,820,082 0.6932859 25022599118174 216 119,663,330 0.0557226 2011181587310 217 1,136,893,718 0.5294074 19107772718426 218 1,610,711,067 0.7500458 27071220903069 219 42,048,987 0.0195806 706717324509 220 195,204,646 0.0908992 3280804485322 221 1,596,956,353 0.7436408 26840045424871 222 794,804,665 0.3701098 13358282004655 223 933,720,315 0.4347974 15693037334205 224 1,374,325,576 0.6399702 23098289955832 225 2,103,332,347 0.9794404 35350706756029 226 978,442,762 0.4556229 16444687500934 227 1,405,215,855 0.6543546 23617462874985 228 1,585,208,926 0.7381704 26642606419282 229
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern