Java Randomness Test Suite

JRandTest at SourceForge

com.fasteasytrade.JRandTest.Tests
Class Squeeze

java.lang.Object
  extended bycom.fasteasytrade.JRandTest.Tests.Base
      extended bycom.fasteasytrade.JRandTest.Tests.Squeeze

public class Squeeze
extends Base

Squeeze from DieHard

SQUEEZE TEST: How many iterations of k=k*uni()+1 are required to squeeze k down to 1, starting with k=2147483647=2^31-1.

The exact distribution of the required j is used, with a chi-square test based on no_trials=100,000 tries.

The mean of j is 23.064779, with variance 23.70971151.

Author:
Zur Aougav

Nested Class Summary
 
Nested classes inherited from class com.fasteasytrade.JRandTest.Tests.Base
Base.point
 
Field Summary
(package private)  double chsq
           
(package private)  double[] Ef
           
(package private)  int[] f
           
(package private)  int i
           
(package private)  int j
           
(package private)  long k
           
(package private)  int no_trials
           
(package private)  double ratio
           
(package private)  double std
           
(package private)  double tmp
           
 
Fields inherited from class com.fasteasytrade.JRandTest.Tests.Base
df, DIM, PI, rs, UNIMAX, vecOutputDestinations
 
Constructor Summary
Squeeze()
           
 
Method Summary
 void help()
          help method to be implemented by each test class.
 void test(String filename)
          test method to be implemented by each test class.
 
Methods inherited from class com.fasteasytrade.JRandTest.Tests.Base
ABS, ABS, addOutputDestination, avg, chisq, Chisq, chitest, closeInputStream, d4, d4d_d, d4d, exp, exp, G, isOpen, KStest, log, MAX, MAX, MIN, MIN, openInputStream, phi, Phi, Poisson_fit, Poisson, pow, printf, puts, qsort, qsort, qsort, r2_double, read32BitsAsDouble, readByte, readInt, readLong, registerInput, removeOutputDestination, showbit, SIGN, SIGN, sqrt, sqrt, stdev, uni
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

no_trials

final int no_trials
See Also:
Constant Field Values

ratio

final double ratio
See Also:
Constant Field Values

std

final double std

i

int i

k

long k

j

int j

f

int[] f

Ef

double[] Ef

tmp

double tmp

chsq

double chsq
Constructor Detail

Squeeze

public Squeeze()
Method Detail

help

public void help()
Description copied from class: Base
help method to be implemented by each test class.

Overrides:
help in class Base
See Also:
Base.help()

test

public void test(String filename)
          throws Exception
Description copied from class: Base
test method to be implemented by each test class.

Overrides:
test in class Base
Parameters:
filename - is the filename to be read or the algorithm name.
Throws:
Exception
See Also:
Base.test(java.lang.String)

Java Randomness Test Suite

JRandTest at SourceForge

JRandTest at SourceForge
Copyright © 2005 Zur Aougav. All Rights Reserved.