Excel program: Onoff.xls Description and operation

Introduction and Purpose

This document describes the sheets "ON OFF", "NIST" and "Benchmark" of the Excel Program Onoff.xls .
  1. The purpose of sheet "ON OFF" is to generate random numbers by simulating an ON OFF process and a deadband. The performance is non determinstic because the simulation is influenced by the actual system load of the PC. The program is written in Visual Basic.
    For more information about "ON OFF" process See: On Off control and for more information about deadband See: Deadband
    For a copy of the program in zip format select: ONOFF.XLS
    For a listing of the program written in Visual Basic select: Listing ONOFF.XLS
    The program is an integral part about comments related two articles in Nature of 15 April 2010 Guaranteed Randomness & Random numbers certified by Bell's theorem.
  2. The purpose of sheet "NIST" is to test the generated numbers. This is done bij means of the Nist document.
    Besides the "on off" process two other random number generators are also tested. Both use the RND function. The RND function is a pseudo random number generator supplied as a standard function in Visual Basic.
    The difference between the two generators is that in the first case the operation is influenced by the actual system load of the PC while the second case this is not happening. The result is that in the first case the outcome is completely unpredictible (nondeterministic) while in the second case this not true. In fact if you test this generator again using the same input condition the result is each time the same.
  3. The purpose of sheet "Benchmark" is to perform three different methode's to generate random numbers 50 times. THe three methode's are the tests 0,-1 and -2 described in the "NIST" sheet.


Description and Operation sheet: "ON OFF" - Calculate target

Sheet "ON OFF" consists standard of 13 columns If you want to perform one experiment first select a column next select the calculate target. There is also a test target. See below.
There are two ways to execute the program.
  1. Select one of the columns 3-11. In that case you will only perform one experiment.
  2. Select column 12. In that case you will perform 10 experiments i.e. all the columns

The generic code of the program looks like this:

      
   DO
      calculate dpv            ' calculate delta pv
      if direction = "up" then 
          pv = pv + dpv
          if pv > 3 then direction = "down"
      Else 
          pv = pv - dpv
          if pv < -3 then direction = "up"
      End if
   LOOP
The two ON OFF values are 3 and -3.
Actual execution of the program looks like this:
  7                                               X
  6      X                                       . .
  5     . .                   X                 .   .
  4    .   .                 . .               .     .
  3   X     .    --------   .   .  ---------  .       .  ---------
  2  .       .             .     X           .         .    
  1 .         .           .       .         .           .
  0X           X         .         .       .             X
 -1             .       .           .     X               X 
 -2              .     .             .   .                 .  
 -3  --------     .   X    -------    . .  -------------    .
 -4                . .                 X                     .     X
 -5                 X                                         .   .
 -6                                                            . .                                  
 -7                                                             X      
     3   3   6   5    2     8   3   6    3     8     7   1   6     3
The bottom line contains the delta pv values.
At the start of the program the process value is 0 and the direction is "up".
The first two delta pv values are 3 and 3. The process value becomes 6 and the direction changes to "down"
The next two delta pv values are 6 and 5. The process value becomes -5 and the direction changes to "up"
The next two delta pv values are 2 and 8. The process value becomes 5 and the direction changes to "down"
etc. etc. The final value is -4. The final result = 1, because the direction is "up".

Comments

IMO this program generates true random numbers and any time, any where, the outcome will be different.

The first reason is because the process in order to calculate the delta pv value also is also more or less a random process. The value is initially the number of counts to detect if the timer changes with 16 ms. This value is roughly between 750 and 850 and can also be much lower depending on system load. It also depends about the PC used. If you take the mod 10 of that number (plus 1) you get a value between 1 and 10. Completely unpredictable. This whole process resembles the "Schrodinger Cat Paradox" which is nothing more than a demonstration of the half-life of a radio active element.

The second reason is because the outcome of the ON OFF process is also unpredictable. The reason is what is called deadband. In the above example example the deadband is 9 (4+4+1) and the maximum delta pv value is 8. The closer the maximum pv delta to the deadband the more the process value can change, increasing the unpredictability.

The following figure demonstrates 3 possible scenarios with total deadband of 9 and a maximum delta pv of 4. Only half of the results is shown.

  7
  6      X1                      X7                      X13
  5     Y1.                 Y5  . .             Y9      . .        Y13 
  4    Z1  .           Z3      .   .   Z5              Z7  .           Z9
  3   X0.   .         . .     x6    . . .     Y8      . .   .         . .
  2  Y0  .   X2      .   .   .       .   .           .   .   .   Y12 .   .
  1 Z0    .   .     .     . .   Y6  . .   .         .     .   .     .     .
  0.       . Y2.   .   Y4  .       .   X8  .       X12     .   X14 .       .
 -1         .   . .       . .     .     .   .     X11       .   . .         . 
 -2          .   .       X5  .   .       .   .   .     Y10   .   .           .
 -3           . . X3    .     . .         X9  . .             . . .           .    
 -4            Z2  .   .       Z4          .   Z6              Z8  X15        Z10 
 -5               Y3. .               Y7    . .           Y11        .
 -6                  X4                      X10                      X16                                   
 -7                                                             
       
The 3 scenarios are identified with the letters X, Y and Z.
  1. Scenario "X" uses small delta pv values. Average is 2
  2. Scenario "Y" uses average delta pv values. Average is 3
  3. Scenario "Z" uses large delta pv values. Average is 4
The following happens at each time increment (Initial all directions are "up"): The behaviour specific of scenarios "X" and "Z" are extreme. The "Y" scenario resembles more the average situation. The purpose is what possible can happen and to demonstrate the divergence involved.
At t1-t3 the outcome of the 3 scenarios is almost identical. At t4-t6 the 3 pv's are still close but they start to divergent. Starting after t10 each pv can have all the possible values, become random and independent from the start value.
The above figure demonstrates 3 possible scenarios with total deadband of 9 and a maximum delta pv of 4.
In the real program the total deadband is 7, the maximum delta pv is 10 and 40 time increments of 15.6 ms are used (implying that it takes less than 1 second to calculate one bit).

Comments - operation

The standard form consists of 10 columns (the columns C to L). Each column shows the result (one bit) of one experiment. In total 10 experiments.
If you want a random number with more bits that is easy. Just insert empty columns, but you should do that at least two columns before the column marked "total". If you do that than the totals are automatically updated.
If you want to calculate all bits (and calculate one random number) just select the column with is text "total" or the column one before. It will take 2 minutes to calculate a random number of 120 bits.


Description and Operation sheet: "ON OFF" - Test target

The sheet "ON OFF" includes a special feature to test the performance of the random number generator.
To perform this test select the Test target.
When you start the program you will get the question: On Value = 2.
Just press Enter.
The program will perform 10 experiments in order to calculate one bit.
However the values shown are directions not process values (i.e. counts). When the direction is "up" you will get a 1, when the direction is "down" you will get a -1.
The reason is to calculate correlations.
There are two correlations calculated.
  1. One between two adjacent experiments i.e. columns.
  2. One between two adjacent process values in the same experiment.
The mathematics to calculate correlations is simple: total = total + direction1 * direction2 and that 40 times
Because the correlation is calculated on 40 values:
The correlations:
In order to understand what is happening do the following tests:
  1. First perform the test with on "ON value" of 30 (and select the total column). After 10 seconds the whole screen will be filled with 1 and -1 values. However there is a clear pattern. The top part will be a "1". Then you get a layer of "-1's". And again a layer of "1's". etc.
    Row 41 (which contains the random number) consists of 10 "-1's" meaning the random number is 0. The total value is -10.
  2. Next perform the test with on "ON value" of 20 (and select the total column).
    Row 41 (which contains the random number) consists of 8 "1's" and 2 "-1's". The total value is 6 which is still high
  3. Next perform the test with on "ON value" of 10 (and select the total column). Row 41 (which contains the random number) consists of 6 "1's" and 4 "-1's". The total value is 2 which indicates no correlation.
  4. Next perform the test with on "ON value" of 5 (and select the total column).
    Row 41 (which contains the random number) consists of 5 "1's" and 5 "-1's". The total value is 0 which indicates no correlation.
  5. Next perform the test with on "ON value" of 2 (and select the total column).
    Row 41 (which contains the random number) consists of 2 "1's" and 8 "-1's". The total value is -6.The fact that this is a high number is not important. What is important that most totals are small meaning no correlation.
  6. When the "ON value" is 1 the average correlation factor between adjacent process values is -4
    When the "ON value" is 0 the average correlation factor between adjacent process values is -12
    When the "ON value" is -1 the average correlation factor between adjacent process values is -22

In short what does tests show is that an ON OFF value of 2 gives the best results, meaning that the final value of each experiment can be a 0 or a 1 with the same probability.


Description and Operation sheet: "NIST"

The purpose of sheet "NIST" is to test the performance of the random number generator using the guide lines described in the "Special Publication 800-22 Revision 1a" isued by the National Instutute of Standards. See Documentation
Sheet "NIST" consists of 7 targets: Nist, Norm Dist, Comp Error, Gamma, Inc Gamma, Rank and Support.


Description and Operation: sheet "Benchmark"

The purpose of sheet "Benchmark" is:
  1. To perform the test 0, -1 and -2 for 50 test strings. Each test string has the length of 2500 characters.
    In order to execute the program select the target "Benchmark". The program
    • The first question to answer is the test number. i.e. 0, -1 or -2
    One cycle of test 0 takes approximately 42 minutes.
    The Seed of test -2 (RND function) is the test counter
    For each test there are 4 lines with results.
    1. Line 1 shows the test counter.
    2. Line 2 shows for each of the 15 + 2 tests the total number times that the P-value is less than 0.01
    3. Line 3 shows for each of the 15 + 2 tests the total P-value
    4. Line 4 shows for each of the 15 + 2 tests the average P-value
    Each time when the program is executed the previous results are not cleared (initialized).
    Important: The program stops when any value is modified.
    For the latest results See here: Benchmark
  2. To convert a decimal number to a binary number.
    The first row shows the decimal number. The word End is used to terminate the string.
    The second row contains the binary number.
    In order to execute the program select the target "Convert"
    The e value comes from: http://members.home.nl/evwinsen/wiskunde/epagina.htm
    The pi value comes from: http://nl.wikipedia.org/wiki/Pi_(wiskunde)
  3. To calculate the statistics of "Test 2.5 Binary Matrix Rank Test" See page 2.10"
    In order to execute the program select the target "2.5"
    See chapter 3.5 for details. IMO chapter 3.5 does not give the statistics for a 32 by 32 matrix. Instead it gives the details for a 3 by 3 matrix.
    In the program the statistics are calculated for a 3 by 3, 4 by 4 and 5 by 5 matrix.
    There are in total 2^9 3 by 3 matrices. For each of those matrices the Rank value is calculated. The same is done for the 2^16 matrices of 4 by 4 and the 2^25 matrices of 5 by 5.
    The results show that in the case of a 3 by 3 the probability of a full rank matrix (i.e. with rank 3) is 0,1953. In the case of a 4 by 4 this is 0,1166 and in the case of a 5 by 5 this is 0,0667. Chapter 3.5 shows a different result.
  4. To calculate the statistics of "Test 2.10 Linear Complexity Test" See page 2.24
    In order to execute the program select the target "2.10"
    See chapter 3.10 for details.
    The basic string length is 13 bits. There are in total 2^13 of those bit strings. For each of those bit strings the Li value is calculated.


Nist report 800-22 Evaluation

The question can be raised how important the Nist document is. To be more specific IMO the 15 tests in the document can not be used to decide if the ON OFF process is either random or non random. IMO if one or more tests fail than that is more an indication that the tests are "wrong" than that the process is a non random process.

As already mentioned before the only thing you can show is that a sequence of bits is not random. Unfortunate the document does not demonstrate that point and IMO lacks certain rigour. The document contains 15 tests. Which each test is an example to demonstrate that the test is implemented correctly. That is okay. What it lacks is to demonstrate what its specific function is. In fact, IMO, each test services as a filter, to capture non random bit patterns. That means for example that with test 5 you need an specific non random test pattern which at least fails at test 5 implying that the pattern is non random. For test 6 you need a different non random pattern which fails specific at test 6 etc etc.
In the paragraphs: 2.5.8, 2.8.8, 2.10.8, 2.11.8, 2.13.8, 2.15.8 the test string consists of the “the first 1,000,000 binary digits in the expansion of e”. The conclusion of those 6 tests is that the sequence was random. IMO that conclusion is not appropriate and conceptual wrong. What is more important the expansion of e should not be used in order to validate or calibrate the 15 tests.

In paragraph 2.14.8 also the expansion of "e" was tested. At page 2-37 we read:

However, for one state of x (x = -1), the P-value is < 0.01, so the conclusion would be that the sequence is non-random. When contradictions arise, further sequences should be examined to determine whether or not this behavior is typical of the generator.
Again this line of reasoning is conceptual wrong. In order to fine tune the 15 tests you should use physical systems and not pseudo random number generators.

In paragraph 2.7.8 and 2.9.8 the test consists of the "2^20 bits produced by the G-SHA-1 generator". Also here the conclusion is that the sequence was random. Again IMO the same conclusion holds: The methodology used is wrong. Physical systems should be used.

In test 31 the expansion e is tested and in test 32 the expansion of pi is tested. Test 32 fails at test 3 and test 32 fails in test 2.10 and test 2.14.

At page 1.1 of the NIST document we read:

Obviously, the use of unbiased coins for cryptographic purposes is impractical. Nonetheless, the hypothetical output of such an idealized generator of a true random sequence serves as a benchmark for the evaluation of random and pseudorandom number generators
IMO the document does not support that concept. It should not.
  1. First it should clearly state that the output of an experiment with coins represents a trully random process.
  2. Secondly it should show the results of such an experiment compared with the 15 tests in order to fine tune (validate) the 15 tests. The results of the 15 tests should be qualified as 100% random.
  3. After this fine tuning the 15 tests should be compared with the output of a pseudo random number generator. The result should be that the pseudo random number generator should be qaulified as not 100% random.
Unfortunate the document does not support this methodology.

At page 1.2 of the NIST document we read:

Ironically, pseudorandom numbers often appear to be more random than random numbers obtained from physical sources.
If that is the case there is something terific wrong with the methodolgy followed.
  1. As explained above random numbers obtained from physical sources should be qualified as 100% random and the 15 tests should
  2. Secondly the results of pseudorandom number generators should be less random. If they don't the 15 tests should be better calibrated against the results of physical processes
Why the words "Ironically" and "appear"?


Nist report 800-22 Evaluation - part 2

Reading and studying the document it tries to cover two areas:
  1. Pseudo random number generators. i.e computer programs which exucute an algorithm and which bassically each time gives the same result. No human intervention is assumed. Those programs are clearly deterministic. The test -2 falls in this category.
  2. Numbers (measurements) generated by physical processes. The tests 0 and -1 fall in this category.
What the document should do is only discuss the second type of generators and try to clarify what to do in order to clasify those as non random. That means to specify a certain number of tests that if one fails the number is non random.


Benchmark Evaluation

There are 5 Benchmarks performed in sheet "Benchmark" identified as Test 0, Test -1, Test -2, Test -3 and Test -4
For the latest results See here:
Benchmark
Each of these Benchmarks produces multiple a string of 0's and 1's with a fixed length of 2500 bits.

The idea behind the Benchmark is mathematical to unravel this difference by investigating the strings using the 15 tests explained in the Nist document. These 3 and 3.1 are special tests develloped by the author.

The results of the 3 Benchmarks Test 0, Test -1 and Test -2 using 100 strings for each (50 for test 0) show no significant differences. That means that the tests are not accurate enough to make a distinction between a sequence of numbers generated by a process versus by a pseudo random number generator.

The accuracy of the RND function consists of 2^24 numbers. The purpose of Test -3 and Test -4 is to see what happens when you decrease this number. The accuracy of Test -3 is 2^14 and of test -4 is 2^12.
The biggest differences are in Test 2.6 and Test 3.

The results of Benchmark tests -3 and -4 are very important.

  1. First if the length of your test string = 2500 and the accuracy of your Pseudo Random number generator is 4096 (Roughly the same or slightly larger) then you will be able to detect that.
  2. Secondly if the accuracy of your Pseudo Random Number generator is 16777216 then you need a test string of similar size in order to detect this.
  3. The vacuum chambers experiment used 3016 events to produce 42 new random bits. IMO those numbers are much too small to mathematically exclude that those numbers are not generated by a Pseudo Random Number Generator.

Documentation


Feedback

No


Created: 24 April 2010
Updated: 15 Mai 2010

Back to the start page: Index of this Document
Back to Nature comment page: Nature Articles index