Skip to content

Latest commit

 

History

History
55 lines (30 loc) · 2.61 KB

README.md

File metadata and controls

55 lines (30 loc) · 2.61 KB

spectral_test

This code is based in the Spectral Test algorithm on page 102 of the book "The Art of Computer Programming" by Donald Knuth.

What is the spectral test?

The spectral test is a statistical test.It evaluates the quality of the linear congregational generators (LCGs), that are a class of pseudorandom generators (PRNGs)

Algorithm S (Spectral Test)

Screen Shot 2022-06-29 at 11 13 13 AM

for 2 < t < T, given a, m, and T, where 0 < a < m and a is relatively prime to m. (The minimum is taken over all nonzero integer vectors (x 1 , ... , Xt), and the number Vt measures the t-dimensional accuracy of random number generators.

The steps performed presented in the book are the following:

Step 1

Screen Shot 2022-06-29 at 11 57 20 AM

Step 2

Screen Shot 2022-06-29 at 11 39 38 AM

Step 3

Screen Shot 2022-06-29 at 11 39 52 AM

Step 4

Screen Shot 2022-06-29 at 11 52 54 AM

Step 5

Screen Shot 2022-06-29 at 11 40 39 AM

Step 6

Screen Shot 2022-06-29 at 11 40 58 AM

Step 7

Screen Shot 2022-06-29 at 11 42 51 AM

Step 8

Screen Shot 2022-06-29 at 11 43 08 AM

Step 9

Screen Shot 2022-06-29 at 11 43 55 AM

Step 10

Screen Shot 2022-06-29 at 11 43 43 AM