Details

This is the Middle-Square Method as proposed by John von Neumann in 1949. For our purposes, we are going to use the middle six digits of the seed.

As the results clearly show, this PRNG has an abymsally short period, and thus has little chance of passing any of the tests. Surprisingly enough, it does manage to pass them occasionally, such as its success with the Count the 1s test.

Pseudocode

// The current state value
state = 1138;

// random number generator
function RandomNumber() {

	// Multiply the state by itself
	tmp = state * state;

	// Add enough padding to make it at least 8 digits
	tmp.pad_left('0', 8);

	// Save the middle 6 digits
	state = tmp.substr( (tmp.length / 2) - 3 , 6 );

	// Return the new value
	return state;

}
			


Test Results

Period Length Test

SeedPeriod LengthResult
113897Failed
6553552Failed
8675309153Failed
16777216769Failed
123456789654Failed
Minimum to Pass: 64,000

Plot Test

 

Count the 1s Test

Seed% Bits that are 1sResult
11380.93%Failed
6553551.48%Passed
867530951.46%Passed
1677721649.43%Passed
12345678949.41%Passed
Minimum to Pass: 45%

Dartboard Test

SeedDarts PlacedResult
113849Failed
6553526Failed
867530977Failed
16777216662Failed
123456789613Failed
Minimum to Pass: 2,600

Crush Test

SeedCompression RateResult
11384.20%Failed
655353.30%Failed
86753095.92%Failed
1677721636.44%Failed
12345678933.68%Failed
Minimum to Pass: 95%

Unique Bytes Test

SeedUnique High BytesUnique Low BytesResult
11388382Failed
655354148Failed
8675309114116Failed
16777216163170Passed
123456789160166Passed
Minimum to Pass: 160

High/Low Byte Test

SeedHigh After HighHigh After LowLow After HighLow After LowSpreadResult
1138993520202414871Failed
6553519972336233633301661Failed
867530919972335233533321665Failed
167772162195259625962612609Failed
1234567892177259725972628645Failed
Maximum to Pass: 500

Distribution Test

Seed113865535867530916777216123456789
0.0 to 0.19914669669928931
0.1 to 0.2121330132911431138
0.2 to 0.3716671660703699
0.3 to 0.410336338785775
0.4 to 0.51433233712341233
0.5 to 0.6933534010801082
0.6 to 0.792001199510001002
0.7 to 0.8866766811031110
0.8 to 0.91323312318981986
0.9 to 1.0533334710441045
Spread178276657660312071219
ResultFailedFailedFailedFailedFailed
Maximum to Pass: 500

Sample Output

609862193165731271475727631617894003924136402734219467816576
679636190509629367610282244411973673803911627289349148190432
62643424195585422296952299729045873443688908641562846679561
1803152513493176318894591121330913955613319620215694652390
56127150251325193134692235487259327725049569605444985801165
186535479530994902982998628506501979198291931932849725203257
131340725019565255951321501164116535358040819264119350424442
151012280402002248965803712595297437851171349936047618398
241608837442130910713742942764880395509535962591658143315220
93636467775493504843147661715387782705679798285725894692209


A WFTID Website