Wednesday, June 12, 2019

Distances for pairs from random generation of 1,3,7,9.


Wanted to confirm nice, symmetric frequencies for random 1,3,7,9 digits. So, first created a 10k file of random 0,1,2,3. Then changed all the 0s to 7s and all the 2s to 9s to give file  called  randoms10k1379A.txt. {
https://drive.google.com/open?id=1kAbHBenOM6mSXECkgvOiqI9Ftfthrwny
https://pastebin.com/akpWhRdE
}. Then I made a TinyC program, primDist4E.c. { https://pastebin.com/archive/text } to report on  distances between any two different 1,3,7,9 digits in the list. It would output, for instance,  all the 7,x distances in file called distFile7.txt.  Here's an example of that file using just 100 prime digits.

1 2 3 4 To be read in conjunction with primdist4.c
4 2 5 1
1 2 3 5
3 1 4 2
1 2 6 3
1 2 3 4
4 2 3 1
1 7 2 3
3 5 4 1
5 1 2 4
3 1 6 2
2 3 4 1
4 2 6 1
3 1 4 2
1 2 4 11
1 2 3 7
1 5 2 4
11 3 1 2
10 2 4 1
6 1 5 2
1 6 10 2
1 2 3 4
3 5 2 1
1 3 0 2
First line goes 1 2 3 4 which means the first 7 is distance 1 away from 1, 2 away from 2, 3 away from 3 and 4 away from 4. Symetry is just a conincidence.
Note lines 18 and 19 indicate that 7 is a long way away from the first 1 after that.
Should have no zeros except in last lines where list runs out before 1,3,7,9 all found after anchor 7. What about the sum of the rows. Smallest must be like line 1 viz 1+2+3+4 = 10. Corresponds
With consecutive last prime digits of 7 1 3 7 9 (ie ..07 11 13 17 19 ...) in prime number list.

Gawk file below is doStatsOnDistFiles0.gawk  
https://pastebin.com/uFiABNwV

NPP_SAVE: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk
CD: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
Current directory: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
INPUTBOX: "enter file eg distFile1.txt"
local $(INPUT) = distFile1.txt
local $(INPUT[1]) = distFile1.txt
C:\Users\peterb\Desktop\NewSoftware\GnuWin\GetGnuWin32\gnuwin32\bin\gawk -f C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk distFile1.txt
Process started (PID=10148) >>>
Here comes the stats from doStatsOnDistFiles0.gawk
11093 10652 10775 11115
Averages below:
Number of records is 2732
4.0604  is mean of column 1
3.89898  is mean of column 2
3.944  is mean of column 3
4.06845  is mean of column 4
<<< Process finished (PID=10148). (Exit code 0)
================ READY ================

================ READY ================
NPP_SAVE: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk
CD: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
Current directory: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
INPUTBOX: "enter file eg distFile1.txt"
local $(INPUT) = distFile3.txt
local $(INPUT[1]) = distFile3.txt
C:\Users\peterb\Desktop\NewSoftware\GnuWin\GetGnuWin32\gnuwin32\bin\gawk -f C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk distFile3.txt
Process started (PID=6708) >>>
Here comes the stats from doStatsOnDistFiles0.gawk
11344 11090 11253 11104
Averages below:
Number of records is 2806
4.04277  is mean of column 1
3.95225  is mean of column 2
4.01033  is mean of column 3
3.95723  is mean of column 4
<<< Process finished (PID=6708). (Exit code 0)
================ READY ================
NPP_SAVE: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk
CD: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
Current directory: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
INPUTBOX: "enter file eg distFile1.txt"
local $(INPUT) = distFile7.txt
local $(INPUT[1]) = distFile7.txt
C:\Users\peterb\Desktop\NewSoftware\GnuWin\GetGnuWin32\gnuwin32\bin\gawk -f C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk distFile7.txt
Process started (PID=8132) >>>
Here comes the stats from doStatsOnDistFiles0.gawk
11943 10945 11083 11247
Averages below:
Number of records is 2798
4.26841  is mean of column 1
3.91172  is mean of column 2
3.96104  is mean of column 3
4.01966  is mean of column 4
<<< Process finished (PID=8132). (Exit code 0)
================ READY ================
NPP_SAVE: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk
CD: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
Current directory: C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0
INPUTBOX: "enter file eg distFile1.txt"
local $(INPUT) = distFile9.txt
local $(INPUT[1]) = distFile9.txt
C:\Users\peterb\Desktop\NewSoftware\GnuWin\GetGnuWin32\gnuwin32\bin\gawk -f C:\Users\peterb\Desktop\NewSoftware\TinyC\tcc-0.9.27-win32-bin\tcc\Primes0\doStatsOnDistFiles0.gawk distFile9.txt
Process started (PID=7832) >>>
Here comes the stats from doStatsOnDistFiles0.gawk
11161 10837 11074 11094
Averages below:
Number of records is 2757
4.04824  is mean of column 1
3.93072  is mean of column 2
4.01668  is mean of column 3
4.02394  is mean of column 4
<<< Process finished (PID=7832). (Exit code 0)
================ READY ================

The red entry above is the output when doStatsOnDistFiles0.gawk works on distFile9.txt with respect to column 3, ie the distances between 9 and 7.

Note in above all the distances 1,1 and 1,3 and 1,7 .... and 9,9 are all close to 4.0. Not sure why. Expect symmetry but can't calculate expectation.



No comments:

Post a Comment