Pages: 1
Author Topic: These numbers took 1.3 gigs of RAM to generate  (50,061 Views)
Offline (Unknown gender) ludamad

Developer
Joined: May 2008
Posts: 1,256
View profile
Posted on: February 20, 2009, 04:01:45 PM
Probably because my implementation was suspect, but still. Big calculation.
ChIkEn's computer ran the calculation, the best computer in my house only had a gig of ram.

They consist of 640 keys, of which every combination of 3 keys has a unique XOR. As well, every combination of 2 keys also has a unique XOR. Essentially what this means is that if you take Elements A, B, C and xor them, they will never equal Elements D, E, F xor'd. (unless the keys in A B C are the exact same as in D E F).

The numbers (in the form of a C++ array):
http://willhostforfood.com/users/C/ChIkEn/results.txt

One of the 11 arrays is completely blank, because its just there for spacing reasons.

Now, practical reasons for this? I thought they'd be good for Zobrist hashing (which forms hashes based on xor combinations of preset keys).

Ensuring every xor combination of 4 elements is unique is probably possible, but would take about 320 times as much RAM, and thousand-folds more running time.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #1 Posted on: February 20, 2009, 05:09:21 PM
Wow, your computers suck.  Mine does too, but still.

And also, you could have just written down every number in a text file from start, instead of tossing it into a giant array and sucking up all of your RAM.
Offline (Unknown gender) ludamad

Developer
Joined: May 2008
Posts: 1,256
View profile
Reply #2 Posted on: February 20, 2009, 05:13:07 PM
I didn't toss it into a giant array. I tossed it into a giant C++ set. Also, a harddrive based version of the algorithm would be harder to design, and take quite a bit longer. This way it took minutes to code, and I just had to find someone with monstrous RAM.
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Reply #3 Posted on: February 20, 2009, 05:23:37 PM
Excuse me for being unappreciative, but what was the whole point (not theoretically, but practically) in that huge calculation?

Also, you could run it on a computer with only 256MB of RAM, it'd just write it to disk instead (pagefile laaaaag imminent, of course) and therefore be slower.
Offline (Unknown gender) ludamad

Developer
Joined: May 2008
Posts: 1,256
View profile
Reply #4 Posted on: February 20, 2009, 05:34:39 PM
I already explained the small practical application in the first post. Any two Zobrist hashes differing by 3 or less keys used to hash them are guaranteed to be different. So my board game hashes are less collision prone.

Also, anything to do with XOR is automatically cool.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #5 Posted on: February 20, 2009, 08:31:09 PM
if !(keyboard_check(vk_left) xor keyboard_check(vk_right)) { moving=false; }
Offline (Unknown gender) Rusky

Resident Troll
Joined: Feb 2008
Posts: 954
View profile WWW
Reply #6 Posted on: February 20, 2009, 10:44:03 PM
yup, that's cool
Pages: 1