Test Results: Java's java.util.Random



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:



Test Results

Period Length Test
SEEDNumber indicates how many results could be obtained before the generator fell into a loop.
1138-PASS
65535-PASS
8675309-PASS
16777216-PASS
123456789-PASS


Dice Roll Test
This generator produced an ideal distribution of outcomes.


Dartboard Test
SEEDMinimum of 6,000 darts placed needed to pass.
11386944PASS
655356973PASS
86753096990PASS
167772166975PASS
1234567896964PASS


Crush Test
SEED70% or higher required to pass.
1138101%PASS
65535101%PASS
8675309101%PASS
16777216101%PASS
123456789101%PASS


Plot Test
An ideal result for this test.


Example Output
6260067915702008566316124162601725248796590522097234144223405325754240965328081914130530383250543996275355022094910716504615034289127062977926511382920447111384096410823436958
873357227810846158623825541427821329244855918624712057689181224454114686241675771401804897419325305803387084954421622475416799568285900247928632947610323278948294749976768331597926
133078353421640339241723484504660153620982342577198819733208948324094435974242850798347045365578577517332159955616173618913423453483408388130397101938933146125730133969482232458846
639029794468400152341240437596424322725844929421609230924327319628735929671347520517983844741770241765250066651012680690283303212684325609888917157333920030987628811113540967
702988668833159628467577621327591174870194655201958951582430450263155686497251800825823397857925531478546399827214954261712048100538377733106318524897630498343031602968023569624608
39964916047394044849916710299132784652505934102226809366911763244797576496201917845586642919502719829869876808291822996333988681436143653467867680902536147694142791989042771421585
336894727342635153376006692220865129421308190684404945290551230487675882384394228596136867570732739848563630290423349173551044482727299155850165941206137954534986839891964254729
86382372512943017710561644408054477308884926073744661575231997511509904744671742626702911687042120948279431228983677594825120014244913277349232288813699250320162535883548426277700
9845046266252772227858112722235410828156590543249734349664277953698520243552896554781093604848658367109345421203654237909770162108701795479369674839351381706635290498308368172241
43058237254264077686052363045908606691136390422712879556265215643829560484933346449646157113300394102488927973424551280537940393411545120852485049449417543304802566172834199029427
8805369605595616551716253790623981410014499182193961282531131862846294647306998292227562912666959265061313788109862148161036384475770657046135650862042339855242119460187565308998
952097923579033523342230893665464083688529830545719753062486458290132458421670849286379836879047993829014139086723897660481329986830742894505632017218762823797778041721040804708
81646444488809474674963835183726640073619212898043614226716659797864083220668428525804939738758427442270592010150501589373219329889804113788095747243519061368651791240958963530697
248673016595074631269644924106816626586401856686794614378015613819733339506241665669844349940506311031917112256626137597382764775105369806350942274322667247157415548950526171316
18690891329696249973003575220372193133515588463455064172836602560778920127076035055333345166956450993232180848858861884462053062086517132099935966200960808210065044610444195279
59619511290766899045092865440347667795566879726499854358916238411897479212886377285686628681769797443093842766592281569216732693018307835936718238652512376572583974687908143932753
26174488114846075810237743434436788572339670994487917121019629949217607709525957335574884612004887487430296332895751239235433543542821040390643604972337753974053289667809895157602
24653806614965213102929900591778110489346669662786604102201358847815403452768492450387917101585968210405503112581531421443354243477465753713986931268537624126047362208162381105086
32956155188422997920824732752590635271234065220740112510325455074910214827352787153531505087528216409259705054786737858815338342115594891060885668622269188108744342466083833934065309
93248035298527432489204934072372569052370373540376273580643670912675763592404577162757093761639993633612557980319749883859863159172193505929998917932161017505168317152000395247571


A WFTID Website