text: For the data run that I did, it was 204,800 bytes. One would expect to see approximately 800 of each valued byte. This was not the case. The lower 128 values had a mean of 999. The upper 128 had a mean of 600. This is clearly not random.
  Chi square distribution for 204800 samples is 12954.37, and randomly would exceed this value 0.01 percent of the times.
  The low 8 bits of rand() is very non-random:
  Chi square distribution for 500000 samples is 0.01, and randomly would exceed this value 99.99 percent of the times.
  A truly random source of numbers looks like (this example is from radioactive decay):
  Chi square distribution for 32768 samples is 237.05, and randomly would exceed this value 75.00 percent of the times.
  As you can probably guess, the mean of this entire value is on the low side:
  Arithmetic mean value of data bytes is 111.5296 (127.5 = random).
  For a truly random source generated by radioactive delay, a 32768 byte file approximates:
  Monte Carlo value for Pi is 3.139648438 (error 0.06 percent).
  #include <stdlib.h>
  #include <stdio.h>
  main()
  {
  int i,r;
  srand(1);
  for(i = 0; i < 512000; i++)
  {
  r = rand();
  printf("%c%c%c%c",
  (r & 0xff000000) >> 24,
  (r & 0x00ff0000) >> 16,
  (r & 0x0000ff00) >> 8,
  r & 0x000000ff);
  }
  }
  Log in or registerto write something here or to contact authors.
  Need help? accounthelp@everything2.com