algorithm that can distinguish between a sequence of pi digits and e (natural log) digits!!

Hi,

Continuing my irrational? quest of compressing and then comparing irrational numbers, I have found a clear bias in the compressed sequences of pi and e.

The simple test:

  1. black box compression algorithm (well not so black box as I posted the C# code for it in a previous thread)

  1. two sequences: a. 160million digits of e (natural log) ascii text base10 sequence b. 160million digits of pi ascii text base10 sequence

  2. script to compress digits from the 160million sequences in this format:

a. break the 160million digit sequence into 1600 consecutive chunks, each of 100,000 digits b. compress each of the 100,000 digit chunks c. make a list of the "compressed lines" output for each of the 1600 compressed sequences (compressed lines is the output of the compression algorithm) d. sort the list of 1600 compressed sequences in ascending order from lowest compressed lines to highest. e. compare the sorted 1600 compressed sequences of pi to the sorted

1600 compressed sequences of e (natural log) by subtracting to find the difference in compressed lines for each of the 1600 sorted compressed sequences. f.graph the difference

  1. success! There is an obvious bias in the vast majority of the 1600 compressed sequences, showing that e has slightly more compressed lines per compressed sequence than pi does.

The bias is a small one, but it exists, and the bias between e and pi is not the biggest one either, out of the four sequences I tested, e, golden ratio, pi, and sqrt2, golden ratio had a larger bias than e to pi:

100000 sequence length compressed averages (1600 samples per up to 160million)

compressed lines: e 1202.123 golden ratio 1203.872 pi 1200.819 sqrt2 1202.009

formatting link

This bias is seen in other ways too, but I think this comparison really is hard to refute statistically.

More comparisons of sequences are in here if interested:

formatting link

I have reached the limit of my sequence digits (160million) but am trying to get ones up to 10billion digits!

cheers, Jamie

Reply to
Jamie M
Loading thread data ...

You should submit your findings to the Math Institute of the World (MIW) and have it publicised.

Reply to
John S

I'm not sure exactly what Jamie is doing, but whatever it is, I don't think it's a viable method for comparing the correlation between sequences of "random" numbers...

Reply to
bitrex

Maybe it is a mathematical game he dreamed up to amuse himself? That's okay, but it might be better answered on a math forum. They are available.

Reply to
John S

I think one of them, pi or e, has a very slight periodicity so I am not comparing correlations between random numbers but instead trying to find the non random part. Most likely e has a very small bias in non randomness, at least compared to pi, in that it has slightly more equal interval repeating pairs of digits, ie 3,4,x,y,z,3,4,a,b,c within the vast majority of any 100,000 digit block of the sequence.

Not sure exactly but I'm trying to figure out what the exact difference in periodicity is, and then it should be easy to just look at any random 100,000 digit block of pi or e and compare if the vast majority of them do have the same small bias. I don't know if it qualifies as random or non random if there is a detectable bias like this, but I think it should be *theoretically* to "reverse engineer" a transcendental sequence back to the formula(s) that were used to create it maybe eventually.

cheers, Jamie

Reply to
Jamie M

But your code is always looking at a finite sample of a countably infinite set. How do you propose to extrapolate any bias you find in a finite sequence to the whole?

Your sample set might as well be a single point.

Reply to
bitrex

Hi,

I am looking for a pattern of digits to explain the bias I found, something like a difference in the number of periodic repeating pairs of digits, ie 3,4,(x digits),3,4, which my compression algorithm identifies for any repeating digits a,b (ie 3,4) and any number of equal gaps x.

If some simple pattern like that occurs slightly more in e than pi in general consistently over any range of digits checked, then the question becomes why, which is beyond me, but probably something to do with pi digits being more random than e.. I am just looking for the initial reason why there is a bias :D

cheers, Jamie

Reply to
Jamie M

I think I've narrowed the identified bias down to blocks of 1000 digits making it easier to identify any patterns.

I compressed 1000 digit blocks up to 160million digits of pi and e using the sequences available here:

formatting link

This created 160,000 compressed sequences for e and pi each.

I compared the ouput "compressed lines" from the compression algorithm for e and pi for all of these 160,000 compressed sequences, and sorted them from fewest compressed lines to most compressed lines.

For the sorted compressed sequences, there are 99 occurances where the compressed lines vary between pi and e out of the 160,000 compressed sequences, and for 97 of them e has one more compressed line than pi, and for 2 of them pi has one more compressed line than e. So the compression is almost identical for the vast majority of the sequences, however the small amount, 99, that aren't equal, there is a large bias towards e having more compressed lines than pi (97 vs 2). This pattern of pi tending to have fewer compressed lines has been observed by me all over the place so it isn't surprising to me, but I'm trying to figure out why pi sometimes compresses to fewer lines.

Here is a small spreadsheet showing the 97 occurrences where e compresses to one more line than pi and the 2 occurrences where pi compresses to more lines than e:

formatting link

e (natural log) data is column A to K and pi data is column P to AA

The column B (for e) and column Q (for pi) are the digit start points for the 1000 digit blocks that have the compression difference.

ie for row 3: e digits from 0 to 1000 compress to one more line than row3: pi digits from 158292000 to 158293000

This test has showed how uneven the distribution of compression differences is, ie there are many compression difference near the end of the sequence of 160million digits of pi, so I think the pi digits from

formatting link
may be incorrect but really not sure.

More testing required!

cheers, Jamie

Reply to
Jamie M

Hi,

Here is some more data showing the actual output of the compression algorithm to show the details of how the sequence e has more compressed lines for the same sequence length than pi sometimes:

sequence input e (natural log)

1000 compressed digits starting digit (from sequence of e digits) 76522000

C0(null)[2,3,6,6,8,7,9,5,9,9,9,5] C3(3,5)[3,14,166,30,107,67,8,187,26,137,13,19,102,43,54] C11(0,8)[6,217,24,78,13,248,138,91,19,27] C2(2,3)[31,2,201,94,41,13,75,198,49,15,11,62,187] C0(3,2)[34,88,74,181,23,60,34,232,67,2,19,105,55] C19(8,3)[18,178,100,113,308,207] C14(3,1)[24,126,152,15,9,21,4,64,111,167,15,31,107] C44(6,4)[4,68,11,18,82,141,271,46,44,95,63,45] C45(4,6)[4,38,28,10,19,4,162,53,300,3,120,21,31,148] C32(0,2)[19,3,18,129,5,46,259,89,82,38,62,180] C31(7,0)[22,8,20,119,105,43,39,18,289,282] C52(2,7)[3,120,221,40,21,326,192] C15(1,9)[43,38,45,115,86,130,108,128,104,80] C30(8,7)[34,3,13,89,30,152,5,84,253,123,4,29,118] C40(7,3)[25,202,8,77,45,264,39,55,5,224] C36(3,8)[30,89,59,7,47,424,64,188] C63(7,8)[5,25,83,108,143,291] C9(1,0)[61,59,22,166,126,38,55,8,137,93,70,85] C50(6,0)[24,305,72,288,39,26,66,44] C60(9,7)[17,36,313,6,2,39,198,234,50,28] C29(9,8)[50,59,317,295] C75(0,6)[7,37,100,20,167,73,80,136,45] C76(6,9)[14,141,9,5,373,16,198] C39(1,7)[53,73,239,41,71,2,5,192,2,37] C46(6,1)[49,326,28,20,11,35,28,17,7] C23(9,6)[74,132,13,6,220,102,67,275] C78(7,9)[21,60,274,4,17,13,7,13,3,34,145,102,135,10,40,12] C86(9,4)[14,2,22,48,480,181,4,132,24] C4(5,9)[101,48,483,39,49,25,48,43,61,3,56] C91(9,1)[15,36,251,45,141,46,148,38,18,14,31] C101(4,9)[11,25,91,52,289,36,4,324] C111(7,4)[3,18,147,22,140,68,10,2,190,74] C83(6,5)[37,169,212,47,193,98] C85(2,9)[38,48,52,208,46,323,10,18,8,156] C62(0,7)[69,147,47,48,13,23,43,93,114,256] C128(4,1)[5,56,3,19,91,101,39,80,52,31,143,63] C9(2,67)[2] C10(67,2)[2] C47(1,6)[87,78,14,35,42,43,104,167,38] C24(6,2)[111,436,23,62,49,60,3,41,128] C69(8,1)[71,10,29,292,25,38,357,6,102] C5(9,3)[149,337,36,2,81,68,47,88,68,37,60] C22(8,9)[134,226,10,31,175,26,25,224,81] C157(9,5)[3,64,8,243,13,68,63,16,74,93,62,29,10,4,34,18] C158(5,7)[3,105,17,182,24,13,208,49,3] C104(2,5)[63,15,90,10,9,156,66,82,88,44,31,38,104] C21(5,8)[147,19,204,24,2,116,332,77,24] C166(7,2)[4,80,63,61,61,11,12,45,85,143,91,28,140] C84(5,2)[90,116,186,136,8,83,86,58,36,11,32,54] C12(8,4)[165,11,81,133,16,67,306] C117(4,8)[61,177,198,70,7,368] C143(1,4)[37,11,171,32,174,5,2,31,206] C6(2,67)[3] C103(4,2)[78,28,61,24,76,25,252,188] C13(4,3)[171,608,93,38] C121(5,3)[74,139,5,60,140,53,36,231,18,31] C73(2,6)[124,170,11,164,162,62,57,72] C149(6,8)[49,209,4,485] C27(2,0)[178,46,253,117,230,76,11] C136(2,4)[72,2,89,470,115,79] C163(6,3)[50,7,42,49,47,6,129,171,3,23,7,182,94] C183(5,4)[34,56,13,6,121,443,141] C146(4,0)[72,46,246,143,33,139,122] C7(5,1)[218,30,72,491,131] C222(8,2)[13,62,32,127,6,295,70] C16(9,0)[230,11,86,81,54,105,16,7,70,258,23,4] C28(0,9)[219,178,130,122,186,76,19,19] C98(6,7)[151,55,43,240,45,155,81,119,2] C202(2,1)[51,122,197,17,12,13,2,304] C193(1,5)[61,79,257,37,96,152] C118(8,0)[141,78,71,146,49,116,32,194] C108(3,4)[155,267,34,65,221,63] C4(33,3)[2] C152(0,5)[113,41,32,349,168,75,5,13] C109(4,7)[165,26,119,67,34,120,59,31,40,194,6] C238(3,0)[39,58,18,6,13,13,177,96,76,120,8] C173(4,5)[114,127,117,7,27,137,74,82,136] C233(5,0)[74,17,227,7,38,146,39] C147(0,4)[161,46,183,15,52,3,15,153,31,140] C295(2,8)[19,87,60,2,32,153,142,25,33] C312(3,7)[7,187,162,11] C57(7,1)[264,196,124,39,36] C107(1,3)[215,54,185,16,169,107,8,60] C260(0,1)[84,36,64,38,172,89,109,76] C162(7,6)[195,53,10,213,130,106,119] C318(0,3)[42,29,116,58,21,168,27] C203(1,2)[163,64,111,74,284] C328(1,8)[53,41,17,31,13,14,105,217,11,59,64] C281(9,2)[102,416] C285(8,5)[127,4,48,382] C288(5,6)[160,66,33,19,20,98,5,39,49,26,128,5,36] C43(3,6)[449,101,144,141,8] C94(8,6)[406,131,200,35] C326(7,5)[220,127,115,29,148,6] C528(3,9)[50,302,30,72]

That is 95 lines, more than any other of the 160,000 compressed sequences of e digits from the first 160million digits of e, the next closest had 94 lines.

The extra lines are coming from the indented (tabbed) lines, there are four of them above:

C9(2,67)[2] C10(67,2)[2] C6(2,67)[3] C4(33,3)[2]

The bias I've detected in pi, is that there are fewer of these indented lines created than for other sequences ie e (natural log).

These tabbed lines are "second order chirplets" and are created when the original sequence has a pattern like this:

....,a,b,(gap1),a,b,(gap2),a,b,(gap1),a,b,(gap2),a,b.....

so for example: a=3 b=4 gap1=random number of random digits (ie 3 random digits 5,7,1 and 6,2,8) gap2=random number of random digits (ie 2 random digits 8,8 and 0,9 and 7,2)

So this example sequence could look like:

3,4, 5,7,1, 3,4, 8,8, 3,4, 6,2,8, 3,4, 7,2, 3,4

or

3,4,5,7,1,3,4,8,8,3,4,6,2,8,3,4,7,2,3,4

The above sequence has only one consecutive pair of digits that exist at least twice: 3,4. And the gaps between each occurrence of where 3,4 occurs are the digits counted from each occurance of 3,4, so for the first 3,4 set it to 0 the second 3,4 count 5 digits from the first 3,4 the third 3,4 count 4 digits from the second 3,4 the fourth 3,4 count 5 digits from the third 3,4 the fifth 3,4 count 4 digits from the fourth 3,4

This gives a new sequence:

5,4,5,4

My compression algorithm recursively looks for the same patterns in this second order sequence to identify consecutive pairs of digits that exist at least twice, so since this sequence has 5,4 that meet this criteria, it makes a "second order chirplet" in the output compressed file (the indented one above that occurs more in the e sequence than pi!)

So from this example, that is a small difference I identified in e (natural log) compared to pi, ie pi will have a very small extra chance that a second order chirplet won't get created, ie instead of the 5,4,5,4 sequence, it may be 5,4,5,3 etc which would not create a second order chirplet.

So therefore I would say that pi is slightly less periodic, and slightly more random than e! At least to the 160million digits I tested.

There are fewer of these types of second order structures in pi than there are in e, just a very small amount fewer though.

My compression algorithm works up to n-order periodic structuring, but I have only compressed up to 10million digits at once in a single sequence and didn't see any chirplets past second order, in these very random sequences, but in more periodic sequences, there are lots of high order (ie 7th level chirplets, ie in a quantized sine wave)

cheers, Jamie

Reply to
Jamie M

}snip{

The details of what you are doing are way over my head and/or available time, but isn't it possible (and maybe you've mentioned this already before) that the bias you find is caused by taking a finite number of digits from an infinite sequence? Would this implicate that if this is true, the bias would reduce in sequences with progressive lengths?

My 0.0001 cts :)

joe

Reply to
Joe Hey

Hi,

I've been working on that most of the time to try to figure it out :D

One interesting thing though is that the "local" bias seems to be maintained no matter where in the sequence the local sample of digits comes from. At least up to my 160million available digits sampled, there is still some bias when the 1000 digit or 10,000 or 100,000 etc individual compressed samples are averaged together.

Here is a graph of the bias I detected versus sequence length for various constants averaged up to 160million digits at several different input digit lengths:

1000, 10000, 20000,30000,80000,100000,200000

1000 digits is average of 160000 sequences (160million total)

10000 digits is average of 16000 sequences (160million total) 20000 digits is average of 8000 sequences (160million total) 30000 digits is average of 5333 sequences (160million total) 80000 digits is average of 2000 sequences (160million total) 100000 digits is average of 1600 sequences (160million total) 200000 digits is average of 800 sequences (160million total)

formatting link

more detailed info:

formatting link

I need to add 100digit compressed samples to it still, I compressed the 100 digit input sequences, which was 1.6million different compressed sequences for each of pi, e, golden ratio, sqrt2 (took over

24hours on my PC I think to run) and generated 6.4million total compressed sequences, with just the basic statistics file being over 850MB, I didn't sort it all out to see what kind of bias there is for this compressed digit length yet but here are some preliminary results that are interesting and help explain how the compression algorithm works by using the simpler example of compressing just 100 digits, to get an idea of what the "bias" I'm finding actually is.

Out of the above 6.4million compressed sequences, 6 stand out, the only ones that have more than one "level2 chirplet" (a second order pattern of digits). These 6 100digit sequences occurred at widely spread out locations in the 160million digit sequence and here they all are: (extracted from the 850MB+ stats file)

sequenceRowStart= 48490900 variable= sqrt(2) digitsCompressed= 100 compressedOutput= 25 FirstLevelChirplets= 22 SecondAndDeeperLevelChirplets= 2

sequenceRowStart= 50144700 variable= Golden digitsCompressed= 100 compressedOutput= 26 FirstLevelChirplets= 23 SecondAndDeeperLevelChirplets= 2

sequenceRowStart= 53942100 variable= Golden digitsCompressed= 100 compressedOutput= 28 FirstLevelChirplets= 25 SecondAndDeeperLevelChirplets= 2

sequenceRowStart= 62731400 variable= E digitsCompressed= 100 compressedOutput= 26 FirstLevelChirplets= 23 SecondAndDeeperLevelChirplets= 2

sequenceRowStart= 86952400 variable= sqrt(2) digitsCompressed= 100 compressedOutput= 24 FirstLevelChirplets= 21 SecondAndDeeperLevelChirplets= 2

sequenceRowStart= 123790000 variable= Pi digitsCompressed= 100 compressedOutput= 28 FirstLevelChirplets= 25 SecondAndDeeperLevelChirplets= 2

Using pi as an example, I took the sequence row starting point above for pi in the 160million digits of pi sequence, and re-ran the compression algorithm for 100 digits to regenerate the compressed sequence that has 2 second level chirplets identified, so I could see how it looks:

Here it is (the 100digit compressed pi sequence from start digit

123790000):

C0(null)[7,5,4,3,2,9,7,6,1,1,0,0,9,9,1,8,4] C5(0,7)[] C0(6,23)[2] C1(23,6)[2] C0(3,1)[15] C6(7,8)[19,39] C2(9,6)[28] C22(2,9)[10] C12(7,3)[25] C13(3,6)[25] C39(6,0)[10] C44(4,7)[11] C42(2,4)[17] C48(8,6)[17,30] C14(6,3)[52] C28(3,5)[39] C57(7,9)[13] C58(9,2)[14] C27(5,3)[47] C62(3,0)[14] C21(1,2)[59] C26(8,5)[56] C29(5,9)[54] C18(9,8)[67] C78(5,7)[10] C45(7,4)[44,4] C81(2,8)[17] C7(8,4)[92]

That's it..

The level2 chirplets are the lines:

C0(6,23)[2] C1(23,6)[2]

These are indented, and are members of the level1 chirplet C5(0,7)[] (see above)

Now the way it works if interested!

The 100digit corresponding input sequence of the pi sequence from start digit 123790000):

3,1,9,6,7,0,7,8,4,5,4,0,7,3,6,3,1,3,9,8,2,1,2,9,9,7,8,5,3,5,9,6,2,9, 0,7,7,7,3,6,0,7,2,4,4,7,4,6,8,6,0,1,1,0,0,4,7,7,9,2,4,9,3,0,7,8,6,3, 5,0,7,9,9,2,5,3,3,0,5,7,1,2,8,5,9,9,8,9,5,7,4,1,8,7,4,8,6,4,2,8,4

or in a format with commas:

31967078454073631398212997853596290777360724474686 011004779249307863507992533057128599895741874864284

..actually 101 digits I'll look into that maybe, but doesn't really change how it works for this example.. :D

So the reason that is a very "unique" sequence out of all the

1.6million 100digit sequences I compressed in the first 160million digits of pi, is that it is the only one with more than 1 level2 chirplet.. The level2 chirplets are 6,23 and 23,6, and if you look at that sequence you can see how there is a pattern in the occurances of the level1 chirplet C5(0,7) or just 0,7, that is the parent of the level2 indented chirplets that is statistically low probability, ie there are equally spaced gaps of digits between occurances of 0,7, here is how the algorithm detects those:

list of subsequences from above sequence showing gaps between 0,7 chirplet:

07845407 0736313982129978535962907 07773607 0724474686011004779249307 07863507

Those are just cut and pasted right from that sequence of 100 pi digits.

07845407 has a gap of 6 from the first 07 to the second 07, as in the number of single digit shifts that would be required to move the first 07 to the place of the second 07 (gap of 6 corresponds to 4 random digits between the two 07's)

So the full list of gaps for all 5 of those:

07845407 (6) 0736313982129978535962907 (23) 07773607 (6) 0724474686011004779249307 (23) 07863507 (6)

The algorithm takes these gaps and creates a new sequence and if any chirplets are found it recursively recompresses it too, looking for n-order periodicity.

So this new gap sequence is: 6,23,6,23,6, which according to my own definition of chirplets, which requires that two consecutive digits have to occur in the sequence twice in order to be called a chirplet, then there are two consecutive digits that meet this definition, 6,23 and 23,6, and they luckily are the second order chirplets above that I was talking about, so that is basically a big chunk of how the compression algorithm works..

Things to note:

first thing to note:

pi sequences seem to create fewer level2 chirplets than other sequences I tested, implying that these types of patterns:

07845407 (6) 0736313982129978535962907 (23) 07773607 (6) 0724474686011004779249307 (23) 07863507 (6)

exist a tiny bit less than in other irrational number sequences of digits, and instead there would be unmatched gaps more often in pi, like this perhaps:

07845407 (6) 072447468601100249307 (18) 07773607 (6) 0724474686011004779249307 (23) 07863507 (6)

which would explain why slightly fewer level2 chirplets are created in compressed pi sequences, since no level2 chirplets would be found in the sequence: 6,18,6,23,6 since there need to be at least two 6,23's etc to be defined as a chirplet..

(from way above, there are two 100digit sequences of the golden ratio, and sqrt2 that have two level2 chirplets, and one 100digit sequence of e that has a level2 chirplet (in the first 160million digits of the sequences)

I hope that can kind of explain what I'm doing, anyway the spreadsheet shows the statistical differences I am trying to find and I think this is an explanation of what the difference is, which is that pi has slightly lower second order periodicity I think.

Here's one last one to show the bias:

formatting link

That one was done with 100,000 digit compressed sequences (1600 sequences up to 160million digits) for pi and e, and it shows the bias that e has an excess of level2 chirplets quite consistently.

cheers, Jamie

Reply to
Jamie M

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.