Pages: 1
  Print  
Author Topic: These numbers took 1.3 gigs of RAM to generate  (Read 2367 times)
Offline (Unknown gender) ludamad
Posted on: February 20, 2009, 11:01:45 AM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
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.
« Last Edit: February 20, 2009, 11:11:40 AM by ludamad » Logged
Offline (Male) RetroX
Reply #1 Posted on: February 20, 2009, 12:09:21 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
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.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) ludamad
Reply #2 Posted on: February 20, 2009, 12:13:07 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
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.
Logged
Offline (Unknown gender) score_under
Reply #3 Posted on: February 20, 2009, 12:23:37 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
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.
Logged
Offline (Unknown gender) ludamad
Reply #4 Posted on: February 20, 2009, 12:34:39 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
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.
« Last Edit: February 20, 2009, 12:36:53 PM by ludamad » Logged
Offline (Male) RetroX
Reply #5 Posted on: February 20, 2009, 03:31:09 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
if !(keyboard_check(vk_left) xor keyboard_check(vk_right)) { moving=false; }
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #6 Posted on: February 20, 2009, 05:44:03 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
yup, that's cool
Logged
Pages: 1
  Print