QB64.org Forum

Active Forums => Programs => Topic started by: STxAxTIC on January 19, 2020, 10:36:00 pm

Title: Finished study of randomness
Post by: STxAxTIC on January 19, 2020, 10:36:00 pm
Hello all,

Well, this whole randomness thing came full-circle, and I can probably say a milestone has been reached, for me at least. Thanks everyone from danilin, Fellippe, and Pete for specifically encouraging this pursuit, and thanks for everyone else - thinking of Steve, bplus, dimster, Pete again - for responding to this with your deep thoughts. Hope you got some sleep Steve. Y'all kept the fire going for sure.

So what I've done is:
i) Created a suitable notation to handle the study at the top of this post: https://www.qb64.org/forum/index.php?topic=2095.0 (https://www.qb64.org/forum/index.php?topic=2095.0)
ii) Generalized that notation to handle any kind of list with any kind of complexity.
iii) Redid the calculation from step (i) and got different numbers, beware.

... and onto the good stuff. The part that won't put you to sleep is:

iv) Cooked up a batch of pseudo-random data using an intentionally bugged RND function in QB64.
v) Without using any foreknowledge of the bug, devised a method to find non-random features in the data set.
vi) Demonstrated the method and got results using QB64 and Gnuplot.

EDIT:

Removed attachment so old notation doesn't spread, click the link below for now on:

http://barnes.x10host.com/ordo%20ab%20chao/Ordo%20Ab%20Chao.pdf (http://barnes.x10host.com/ordo%20ab%20chao/Ordo%20Ab%20Chao.pdf)
Title: Re: Finished study of randomness
Post by: romichess on January 20, 2020, 02:41:37 am
Magic bitboards in chess is the strangest randomness related topic I know of. The question is, is there some random magic number that can be multiplied by the occupancy then shifted some amount say on a rook's rank and file that will produce an index into a lookup table that will give the bitboard of possible rook moves. Here is that function from the chess programming wiki.

U64 rookAttacks(U64 occ, enumSquare sq) {
   occ &= mRookTbl[sq].mask;
   occ *= mRookTbl[sq].magic;
   occ >>= 64-13;
   return rookAttacks[occ];
}

Think of all the number of possible occupancies on a rank and file. And it does not matter what it is because there is one number out of millions that has a bit pattern that when multiplied and shifted with the occupancy produces when combined with the other magic numbers for the other 63 squares a perfect hash to lookup the moves bitboard. And that means without a single miss or collision. That might not be the type of randomness you are looking at. But it is a rather random thing nonetheless. For some of the squares it took weeks of processing to find a good number.
Title: Re: Finished study of randomness
Post by: DANILIN on January 20, 2020, 05:45:34 am

? how many numbers are there in studied sequences ?

? at least 1 thousand numbers ?
Title: Re: Finished study of randomness
Post by: STxAxTIC on January 20, 2020, 08:00:57 am
The sample case worked out takes N to be at least 10000. I tested it out for millions of numbers, it works all the same.
Title: Re: Finished study of randomness
Post by: STxAxTIC on January 22, 2020, 10:55:26 pm
Okay, I think I've decided on how the notation should look, and I also rearranged things for clarity. Shred your old copy.

Just a few comments:

1) This thing requires no foreknowledge of math whatsoever. The syntax is all invented, all explained, there are no mysteries. There's pretty much no reason to not be able to follow what's going on.
2) There are examples to go along with each concept introduced.
3) The entire argument / discovery can be boiled down to this:

If you're handed a sequence S_1 = 0 1 1 0 0 0 1 0 1 1

Define A=00, B=01, C=10, D=11 such that the sequence becomes

S_2 = B C A C D

... which lends itself to richer analysis than the raw sequence S_1.


That's it. If you can get beyond that argument, you can follow how I was able to find bits of order planted in random data and reconstruct the ordered part correctly.

No more attachments, the document is here:

http://barnes.x10host.com/ordo%20ab%20chao/Ordo%20Ab%20Chao.pdf (http://barnes.x10host.com/ordo%20ab%20chao/Ordo%20Ab%20Chao.pdf)

Title: Re: Finished study of randomness
Post by: Pete on January 22, 2020, 11:48:45 pm
Hold yar horseys thar, varmint...

S_1 = 0 1 1 0 0 0 1 0 1 1

with A=00, B=01, C=10, D=11

S_2  = B C A B D wood be 0110000111 and thatz not ther same iz  0 1 1 0 0 0 1 0 1 1 butt I gez either way yas gots three of ee kind wit one mur kard ta be delt. In meth class, I shots me way right to the top!

- Sam



Title: Re: Finished study of randomness
Post by: DANILIN on January 23, 2020, 02:25:09 am
a=00 b=01 c=10 d=11
Origin = 0110001011
Result = bdcaabcbd
Title: Re: Finished study of randomness
Post by: STxAxTIC on January 23, 2020, 05:19:30 am
Ah, thanks fellas - this is why I outsource proofreading to you guys. Its fixed now.

@danilin: the resulting sequence should contain just 5 terms
Title: Re: Finished study of randomness
Post by: DANILIN on January 23, 2020, 07:54:18 am
I have: the study offset follows the same rules

my Origin 1 = 01100011
my Result 1 = bdcaabcbd

my Origin 2 = .110001011
my Result 2 = .dcaabcbd

but according to your rules the codes will change
Title: Re: Finished study of randomness
Post by: STxAxTIC on January 23, 2020, 07:56:26 am
Correct danilin, offsets have an interesting effect. This is studied and accounted for in the linked PDF. In fact, offsets are essential to stacking the results and make the answers really pop out.
Title: Re: Finished study of randomness
Post by: Pete on January 23, 2020, 12:19:13 pm
No worries Bill. I gather we are around the same age, and I'm really impressed at your ability to stay focused with just a few "senior moments" in a long involved project. Hell, I'd like to roll the clock back a decade, to where I simply forgot where I put my car keys. Now I still have that problem, but when I find them, I forget what the hell I needed them for in the first place.

Pete
Title: Re: Finished study of randomness
Post by: STxAxTIC on January 23, 2020, 12:38:05 pm
I'm 35 fwiw. Came into Qb64 in my late 20s.
Title: Re: Finished study of randomness
Post by: Pete on January 23, 2020, 12:46:40 pm
 - OK, but what does that have to do with where I put my car keys?

Well lucky you! I'd kill to be 35 again, which reminds me, where is Clippy?

Pete
Title: Re: Finished study of randomness
Post by: DANILIN on June 03, 2020, 08:30:08 am
about articles on x10host

author would make a separate file of all contents
everyone articles even without hyperlinks

I made for myself a list of contents: very convenient
Title: Re: Finished study of randomness
Post by: STxAxTIC on June 03, 2020, 09:42:37 am
Ah, hello Danilin

So I think you're referencing my (ever-growing) personal projection on math and physics:

http://barnes.x10host.com/ (http://barnes.x10host.com/)

Thanks for reading! Some of these items may end up hosted on QB64.org, but for now it's a separate body of work. Screenshot attached if anyone's unaware.
Title: Re: Finished study of randomness
Post by: DANILIN on June 03, 2020, 12:35:15 pm
What I write about:
content of all articles only
in a single document
but without hyperlinks
in my opinion it is far-sighted

  [ This attachment cannot be displayed inline in 'Print Page' view ]