Zobrist key random numbers

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: Zobrist key random numbers

Post by Greg Strong »

Here's another "random" idea ...

Don't use pseudo-random numbers at all. Use actual random numbers, and the odds of getting any bad cross-key interactions should be incredibly small.

random.org will generate truly random bitmaps which could fairly easily be turned into random 64-bit numbers.
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Zobrist key random numbers

Post by hgm »

Zach Wegner wrote:Random idea:

zobrist[piece][square] = rotate_left(deBruijn[piece], square);
This is not such a crazy idea, and in fact you don't even need a DeBruijn number for it.

To save cache space I rotate the Zobrist keys bytewise in my engines. So in stead of taking 768 random long long ints, (6KB) I have a 675-byte table of random chars. Something like:

Code: Select all

char Zobrist[12][64];

hashKey ^= *(long long int*) &Zobrist[pieceType][squareNr];
I measured the effect on collision rate compared to the traditional method, and there is none. My guess is that it would even work if the randoms overlap 63 out of 64 bits, rather than 56 out of 64. But this would make them more expensive to read, and the table is now already so small that further reduction is not worth it anyway.
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Zobrist key random numbers

Post by Gerd Isenberg »

bob wrote: (1) does anyone know how to compute the theoretical minimum hamming distance in a set of 788 64 bit numbers that can be produced? In my case, can this be raised to 24 or beyond? (I have the test set to stop when the PRNG starts to "cycle".
No idea without further studying some papers ;-)

Two posts by Gunnar Farnebäck from the computer-go message list might be interesting:
Sharing Secrets
Zobrist hashing and linear codes

BCH-codes, as used by Wendroff/Warnock and Feldmann, provide a systematic way to construct linear codes with high minimum Hamming distance.
Feldmann's Ph.D. Thesis as pdf: Game Tree Search on Massively Parallel Systems
steffan
Posts: 28
Joined: Sun Mar 12, 2006 12:08 am
Location: Midlands, England

Re: Zobrist key random numbers

Post by steffan »

Zach Wegner wrote:Random idea:

zobrist[piece][square] = rotate_left(deBruijn[piece], square);
I've used rotated numbers too and this appears to work well. Very useful for designs that demand minimal memory or lookup tables.

Cheers,
Steffan
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Zobrist key random numbers

Post by bob »

hgm wrote:
bob wrote:
hgm wrote:... With 12-bit keys 0xFF0, 0xF0F and 0x0FF all have hamming distance 8, which is pretty good for 12-bit keys, and they also all have distance 8 to 0x000. Nevertheless they are dependent, and would spoil any set that containst them.
Actually that is not possible, and the "why" is trivial to see. You have 785 _other_ numbers that have to have 32 different bits from all 3 of the above keys, which is not possible at all...
I don't understand what you are saying here. What exactly do you consider to be impossible? It can't be that the keys I gave are dependent (because they obviously are). And if three keys are dependent, thety do spoil the entire set, no matter how large the set is. But a 12-bit example can of course not be projected to a real chess board needing 788 keys.
What is not possible is to use the values you gave, upper half ones, lower half ones, and all ones, and then generate other numbers that only have a hamming distance of 32 or higher, including those three, to fill the 788 element array. I've tried way over 4,000,000,000 64 bit random numbers and have only gotten to 23 as the min between any pair. 24 might be possible, and perhaps 25 or 26. But 32 seems well out of reach

So to not discuss too much in abstracto, let me revise the example to 64-bit:

Having keys

Code: Select all

k1 = 0xFFFFFFFFFFC00000
k2 = 0xFFFFF800003FFFFF
k3 = 0x000007FFFFFFFFFF
In terms of hamming distance, we have

d(k1,k2) = 42
d(k2,k3) = 42
d(k1,k3) = 43
d(k1,0) = 42
d(k2,0) = 43
d(k3,0) = 43

Furthermore, each of the keys would have a hamming distance of on the average 32 to any random 64-bit number drawn from a homogeneous distribution. So in terms of hamming distance, they don't spoil anything, and are in fact very likely to drive up the average, despite the effort you take to maximize the distance within the remaining 785 keys.
But that is overlooking my original constraint that _all_ pairs of numbers in the set have to have a hamming distance >= N. So far N is at least 23...


But they would make the set totally useless if they were used such that they could appear together in a key, such as Pawn keys for f2, g2, h2. No matter what the other 785 keys are, positions with a full Pawn shield for the King on g1 would be constantly confused with those where the king is totally bare, all other pieces being positioned identically.
I don't disagree. But purely random numbers with no checks at all offer plenty of room for that or worse. When I first looked at this, a classic PRNG produced two numbers that were the _same_ in these numbers, and they just happened to cause an odd book move to be played that lost a game instantly.

The search is less likely since the depth is more limited, to find enough random numbers to cancel each other out and produce a collision. But for a game history that can go 200 moves or longer, it can happen (and did in fact).

I started testing the numbers initially because of that specific book error, after re-reading Wendroff's paper where he discussed how much "protection" a set of numbers would offer in terms of consecutive moves with random numbers comprising the signature.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Zobrist key random numbers

Post by Dann Corbit »

There is an exponential slowdown with my method. For 26 bits, I have more or less frozen on 347 distinct values (so I will have to try for a smaller set):

Code: Select all

7266447313870364031,
4946485549665804864,
16945909448695747420,
16394063075524226720,
4873882236456199058,
14877448043947020171,
13857871200353263164,
5249110015610582907,
1235879089597390050,
17320312680810499042,
8942268601720066061,
14226945236717732373,
9383926873555417063,
11510704754157191257,
6489677788245343319,
236502320419669032,
13670483975188204088,
8904234204977263924,
17251681303478610375,
13075804672185204371,
10831805955733617705,
1074659097419704618,
17119870085051257224,
10949279256701751503,
17618792803942051220,
957923366004347591,
1012818702180800310,
974125122787311712,
1861591264068118966,
3809841506498447207,
13408683141069553686,
13900005529547645957,
16475327524349230602,
13554353441017344755,
4738086532119935073,
6788940719869959076,
11670856244972073775,
2488756775360218862,
11016608897122070904,
13978444093099579683,
11628184459157386459,
4249175367970221090,
7306216312942796257,
2889379661594013754,
17310575136995821873,
3435082195390932486,
7444710627467609883,
11216615872596820107,
5770016989916553752,
1845293119018433391,
1259990987526807294,
15531278677382192198,
16317667579273275294,
9134927878875794005,
9030000260502624168,
3115849849651526279,
10637177623943913351,
16428252083632828910,
15722061259110909195,
1524477318846038424,
3443401252003315103,
9689406052675046032,
3609534220891499022,
9281161952002617309,
147649915388326849,
10131486500045494660,
8517521928922081563,
2836463788873877488,
9570032848237657586,
10863668391515109722,
1552803150609742001,
2790375502200557313,
9038024825497430573,
91888768090624853,
18145740993490813283,
12654149022202498759,
4206418103243872757,
7233523623977397383,
16215672393055652545,
10738887894178969425,
18204068107936511697,
14383128117587060157,
15849831596023436356,
17675390291979846750,
2977578850677699908,
4893323648315952120,
1286466090879300568,
9888911152046881084,
3183884142852054126,
13772224761560358678,
9094920381744576493,
16129742540997802980,
16945398958854163835,
17650197551112766205,
4852422776459831315,
9362357443732597760,
2374087830147132659,
15000861190071109560,
2902081674035190433,
15810933559568492050,
12678167969995957047,
1798389442866720091,
14599659047605763816,
17782026137486407602,
3027116614594121997,
6496187495111652573,
9859717582333494749,
5930885232297252456,
4061277839767617930,
12035499765197893420,
4370560942875640999,
5634383789002676726,
8907175724738102010,
16593287713411177161,
3325238609365118367,
17125462708636491154,
10188578131352743024,
15161949016576385831,
6657699133553403854,
2352226978179009098,
3859532089524191730,
17631674258545638758,
17581014988572303447,
7458819045178438285,
5488240155574034654,
7788457792396395633,
1234217808918573134,
10045923023026503261,
2803693151878023143,
15042951576086758915,
1809970995609003345,
6472832596573079460,
10531013421297635766,
9687689322966646953,
5309220766259687196,
16099895359080387221,
15463291357721078947,
14892243053368326929,
15913028219213787856,
17114854711077298999,
6881183452302138939,
9743703211409053724,
6120184892838179370,
4488025338083630045,
6932643716586102064,
7085729815153112724,
2577286319771781656,
3212578193372804795,
7140055923216537951,
11545784650358033961,
15097420044622846756,
9577429288174440901,
1651506457155992685,
17206783877956047023,
4977537220776361209,
16799175153209517804,
17623046094747753280,
16695848152965592420,
807005292018537624,
5694219642130963465,
17782774995076800672,
5025236171457631467,
11601588411391151733,
13800826249802546619,
8320715347883164621,
15765965395656039061,
9783656346475123313,
15660593116602060011,
12686638988178810220,
4601829680043422926,
13649469918759116343,
11072681934824066811,
3484285465118294452,
5250162757012130834,
11822278712571422607,
16820676274862823347,
2258483262623939360,
18059638503665417019,
4038533795659869059,
9217581272623145121,
10474525469047663535,
1704011107366220345,
15761773994985082820,
1396662462031085091,
11499399103501446733,
8253913244279442889,
18014518805502248392,
10766750626076003259,
13347551569433141972,
12285514714001968960,
12601751059746685848,
4088019966658540820,
7550841428494759028,
14457212971848820997,
16415384305117522006,
3274893893751255634,
10659638677637579954,
6338371175383690179,
18162230369769586150,
428321177825102899,
15817001710821818046,
12235635129931490851,
13527122555395203005,
2178128838908381672,
14367385536076681562,
12915933956577960132,
4652351249928028414,
4951391482976146214,
7296771005593252278,
14127467184305310300,
16956161371242220606,
2288730399829329044,
10224299563023357164,
15302392990651373659,
5732367270286632815,
7889985811968217208,
5521408468444455621,
3010954896914979971,
14717388125128732814,
17543622707664214218,
16699503790769821674,
5300069125018992847,
4491717662350224528,
6179887503359229642,
10444048407325898982,
12310419282952883445,
9615039512616912255,
8912906368760218223,
2736639230152280465,
1466229153547721039,
2954109638740141000,
11746874332443504878,
10637552291778782845,
17962194647643634986,
7190730870912935711,
15378933026600388229,
7415343666878271746,
4247889442676475641,
17929428741300739597,
6205303292541642307,
11123091740953949733,
784117286214737662,
11137709922435249100,
14725228923085766997,
10386402860586212951,
13143405698908382732,
196620903144528027,
10705589578384286810,
13817879522456382188,
9229688921939842696,
16633756859233364337,
1032072982178823495,
6370454774064667856,
12850106475877076817,
12267618954701302483,
8145470530489095863,
1814673802044807488,
9225545243819924881,
14884320946805680190,
7015855463293451660,
15665030223840195079,
17002420156823161993,
3049382545994967746,
17417472035022723033,
12396544237084354931,
6725541218060571039,
9710463154252506414,
9950389178902628715,
2371212431907900846,
18374266211527465082,
14109608474880409885,
10041272077912916256,
5726527053967358581,
11966583246028264826,
16565423595231842294,
4787603906131836800,
2358971807316617129,
701848729445873300,
7462412777600825764,
17256139670461659054,
18098924730684751225,
503596689135387308,
17615667363549849844,
3787023102090135939,
10889153560001930160,
9630600983458854043,
14840676362451429709,
15285971904287568249,
760130182760799549,
18273147886613016929,
17988260782976079957,
10576771164953308062,
1374404921073484550,
5711543178872819554,
7267384182398429791,
3847053869966350600,
11350390488874863454,
18034667604288436754,
15728235335976939570,
1690501778949613150,
10549826829132374141,
8187654266517442902,
14570575066764711251,
8330819712241433781,
17436220147483706956,
1259157189813452226,
13025642373655069123,
14356472637065835570,
16222490068333456653,
2485152632185027389,
2742816983698754277,
2661133492768338581,
2301215659926313223,
13233097894633159274,
12656717602888925661,
10165318829475529952,
17104609321564382922,
10325932561555029770,
6413244029449044455,
8191767193394389622,
10270929734388613920,
12291445944674790578,
10802320535004165936,
3928453647719019674,
10318533838179330761,
18290228294878833931,
17117845830988322373,
12942239967337847160,
11380882416157141219,
13460991881535950924,
3587389546577196427,
5111810686918228644,
4114159579120732836,
8946597124993059928,
5207951741791249331,
1411671654137597246,
7702399104537211022,
4568625842739988035,
563893241007464401,
17187067130913047100,
11828988545797689038,
11702908455376917457,
8794147767634410081,
10079173818009207539,
125881399269187320,
5230839931433374219,
1531203087033921236,
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Zobrist key random numbers

Post by hgm »

bob wrote:What is not possible is to use the values you gave, upper half ones, lower half ones, and all ones, and then generate other numbers that only have a hamming distance of 32 or higher, including those three, to fill the 788 element array. I've tried way over 4,000,000,000 64 bit random numbers and have only gotten to 23 as the min between any pair. 24 might be possible, and perhaps 25 or 26. But 32 seems well out of reach
But that is overlooking my original constraint that _all_ pairs of numbers in the set have to have a hamming distance >= N. So far N is at least 23...
I never said that it was possible to give all keys a distance of 32, nor is this needed. I only wanted to point out that a set of keys with a very good hamming distance can easily hide dependincies of the worst possible kind. (Well, perhaps except having two equal keys, which would be worse.) And the offending keys could be amongst those with the best hamming distance to all other keys, and each other.

Try the following:

Take the "best" set of 788 you were able to generate, and select the three keys from it that had the largest minimum hamming distance to all others. I.e., if the keys are k_i {0<i<=778}, define the "isolation" of a key i as min(d(k_i,k_j) over all j != i, and d(x,y) the hamming distance between x and y, and pick the three keys with the largest isolation. Call these k_a, k_b and k_c.

Now calculate M = k_a ^ k_b ^ k_c.

Then transform all keys in the set to K_i = M^k_i. This transformation leaves the hamming distance invariant, as x^y = (M^x)^(M^y). So the transformed set is just as "optimal" with respect to minimum hamming distance as your original one.

But

K_a^K_b^K_c = (M^k_a) ^ (M^k_b) ^ (M^k^c) = (M^M^M) ^ (k_a^k_b^k_c)
= (M) ^ (M) = 0.

So your "best" three keys in terms of hamming distance w.r.t. all other keys are now in fact the worst 3 keys, causing collisions between boards with just 3 mutations between them, and rendering the set with this large minimal hamming distance totally useless.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Zobrist key random numbers

Post by Dann Corbit »

For 23 or more on Hamming distance, it is very easy by brute force to collect a set in just a few minutes.

Using this code:

Code: Select all

/*
   A C-program for MT19937-64 &#40;2004/9/29 version&#41;.
   Coded by Takuji Nishimura and Makoto Matsumoto.

   This is a 64-bit version of Mersenne Twister pseudorandom number
   generator.

   Before using, initialize the state by using init_genrand64&#40;seed&#41;
   or init_by_array64&#40;init_key, key_length&#41;.

   Copyright &#40;C&#41; 2004, Makoto Matsumoto and Takuji Nishimura,
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met&#58;

     1. Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.

     2. Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.

     3. The names of its contributors may not be used to endorse or promote
        products derived from this software without specific prior written
        permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   EXEMPLARY, OR CONSEQUENTIAL DAMAGES &#40;INCLUDING, BUT NOT LIMITED TO,
   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   PROFITS; OR BUSINESS INTERRUPTION&#41; HOWEVER CAUSED AND ON ANY THEORY OF
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT &#40;INCLUDING
   NEGLIGENCE OR OTHERWISE&#41; ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

   References&#58;
   T. Nishimura, ``Tables of 64-bit Mersenne Twisters''
     ACM Transactions on Modeling and
     Computer Simulation 10. &#40;2000&#41; 348--357.
   M. Matsumoto and T. Nishimura,
     ``Mersenne Twister&#58; a 623-dimensionally equidistributed
       uniform pseudorandom number generator''
     ACM Transactions on Modeling and
     Computer Simulation 8. &#40;Jan. 1998&#41; 3--30.

   Any feedback is very welcome.
   http&#58;//www.math.hiroshima-u.ac.jp/~m-mat/MT/emt.html
   email&#58; m-mat @ math.sci.hiroshima-u.ac.jp &#40;remove spaces&#41;
*/


#include <stdlib.h>
#include <stdio.h>

#define NN 312
#define MM 156
#define MATRIX_A 0xB5026F5AA96619E9ULL
#define UM 0xFFFFFFFF80000000ULL/* Most significant 33 bits */
#define LM 0x7FFFFFFFULL        /* Least significant 31 bits */


/* The array for the state vector */
static unsigned long long mt&#91;NN&#93;;
/* mti==NN+1 means mt&#91;NN&#93; is not initialized */
static int      mti = NN + 1;

/* initializes mt&#91;NN&#93; with a seed */
void            init_genrand64&#40;unsigned long long seed&#41;
&#123;
    mt&#91;0&#93; = seed;
    for &#40;mti = 1; mti < NN; mti++)
        mt&#91;mti&#93; = &#40;6364136223846793005ULL * &#40;mt&#91;mti - 1&#93; ^ &#40;mt&#91;mti - 1&#93; >> 62&#41;) + mti&#41;;
&#125;

/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
void            init_by_array64&#40;unsigned long long init_key&#91;&#93;,
                                              unsigned long long key_length&#41;
&#123;
    unsigned long long i,
                    j,
                    k;
    init_genrand64&#40;19650218ULL&#41;;
    i = 1;
    j = 0;
    k = &#40;NN > key_length ? NN &#58; key_length&#41;;
    for (; k; k--) &#123;
        mt&#91;i&#93; = &#40;mt&#91;i&#93; ^ (&#40;mt&#91;i - 1&#93; ^ &#40;mt&#91;i - 1&#93; >> 62&#41;) * 3935559000370003845ULL&#41;)
            + init_key&#91;j&#93; + j;  /* non linear */
        i++;
        j++;
        if &#40;i >= NN&#41; &#123;
            mt&#91;0&#93; = mt&#91;NN - 1&#93;;
            i = 1;
        &#125;
        if &#40;j >= key_length&#41;
            j = 0;
    &#125;
    for &#40;k = NN - 1; k; k--) &#123;
        mt&#91;i&#93; = &#40;mt&#91;i&#93; ^ (&#40;mt&#91;i - 1&#93; ^ &#40;mt&#91;i - 1&#93; >> 62&#41;) * 2862933555777941757ULL&#41;)
            - i;                /* non linear */
        i++;
        if &#40;i >= NN&#41; &#123;
            mt&#91;0&#93; = mt&#91;NN - 1&#93;;
            i = 1;
        &#125;
    &#125;

    mt&#91;0&#93; = 1ULL << 63;        /* MSB is 1; assuring non-zero initial array */
&#125;

/* generates a random number on &#91;0, 2^64-1&#93;-interval */
unsigned long long genrand64_int64&#40;void&#41;
&#123;
    int             i;
    unsigned long long x;
    static unsigned long long mag01&#91;2&#93; = &#123;0ULL, MATRIX_A&#125;;

    if &#40;mti >= NN&#41; &#123;            /* generate NN words at one time */

        /* if init_genrand64&#40;) has not been called, */
        /* a default initial seed is used     */
        if &#40;mti == NN + 1&#41;
            init_genrand64&#40;5489ULL&#41;;

        for &#40;i = 0; i < NN - MM; i++) &#123;
            x = &#40;mt&#91;i&#93; & UM&#41; | &#40;mt&#91;i + 1&#93; & LM&#41;;
            mt&#91;i&#93; = mt&#91;i + MM&#93; ^ &#40;x >> 1&#41; ^ mag01&#91;&#40;int&#41; &#40;x & 1ULL&#41;&#93;;
        &#125;
        for (; i < NN - 1; i++) &#123;
            x = &#40;mt&#91;i&#93; & UM&#41; | &#40;mt&#91;i + 1&#93; & LM&#41;;
            mt&#91;i&#93; = mt&#91;i + &#40;MM - NN&#41;&#93; ^ &#40;x >> 1&#41; ^ mag01&#91;&#40;int&#41; &#40;x & 1ULL&#41;&#93;;
        &#125;
        x = &#40;mt&#91;NN - 1&#93; & UM&#41; | &#40;mt&#91;0&#93; & LM&#41;;
        mt&#91;NN - 1&#93; = mt&#91;MM - 1&#93; ^ &#40;x >> 1&#41; ^ mag01&#91;&#40;int&#41; &#40;x & 1ULL&#41;&#93;;

        mti = 0;
    &#125;
    x = mt&#91;mti++&#93;;

    x ^= &#40;x >> 29&#41; & 0x5555555555555555ULL;
    x ^= &#40;x << 17&#41; & 0x71D67FFFEDA60000ULL;
    x ^= &#40;x << 37&#41; & 0xFFF7EEE000000000ULL;
    x ^= &#40;x >> 43&#41;;

    return x;
&#125;

/* generates a random number on &#91;0, 2^63-1&#93;-interval */
long long       genrand64_int63&#40;void&#41;
&#123;
    return &#40;long long&#41; &#40;genrand64_int64&#40;) >> 1&#41;;
&#125;

/* generates a random number on &#91;0,1&#93;-real-interval */
double          genrand64_real1&#40;void&#41;
&#123;
    return &#40;genrand64_int64&#40;) >> 11&#41; * &#40;1.0 / 9007199254740991.0&#41;;
&#125;

/* generates a random number on &#91;0,1&#41;-real-interval */
double          genrand64_real2&#40;void&#41;
&#123;
    return &#40;genrand64_int64&#40;) >> 11&#41; * &#40;1.0 / 9007199254740992.0&#41;;
&#125;

/* generates a random number on &#40;0,1&#41;-real-interval */
double          genrand64_real3&#40;void&#41;
&#123;
    return (&#40;genrand64_int64&#40;) >> 12&#41; + 0.5&#41; * &#40;1.0 / 4503599627370496.0&#41;;
&#125;

unsigned long long hamdist&#40;unsigned long long x, unsigned long long y&#41;
&#123;
    unsigned long long dist = 0,
                    val = x ^ y;
    while &#40;val&#41; &#123;
        ++dist;
        val &= val - 1;
    &#125;
    return dist;
&#125;

unsigned long long ullData&#91;1001&#93; = &#123;0x7d497d2f7a15eaf8&#125;;
unsigned long long dist_distrib&#91;64&#93;;
unsigned long long bigdiff&#91;1360070 * 2 + 1&#93;;
int             main&#40;void&#41;
&#123;
    size_t          i;
    size_t          nsofar = 0;
    size_t          ulldatadim = sizeof ullData / sizeof ullData&#91;0&#93;;
    unsigned long long init&#91;4&#93; = &#123;0x12345ULL, 0x23456ULL, 0x34567ULL, 0x45678ULL&#125;, length = 4;
    unsigned long long total = 0;
    unsigned long long hdmin = 64;
    unsigned long long hdmax = 0;
    unsigned long long popsize = 1;
    unsigned        oksofar = 1;
    init_by_array64&#40;init, length&#41;;
    while &#40;popsize < 1000&#41; &#123;
        unsigned long long q = genrand64_int64&#40;);
		 oksofar = 1;
        for &#40;i = 0; i < popsize; i++) &#123;
			unsigned long long h;
            if (&#40;h=hamdist&#40;q, ullData&#91;i&#93;)) < 24&#41; &#123;
                oksofar = 0;
                break;
            &#125;
        &#125;
        if &#40;oksofar&#41; &#123;
            ullData&#91;popsize++&#93; = q;
            printf&#40;"%llu,\n", q&#41;;
        &#125;
    &#125;
&#125;
I quickly generated this set of numbers:

Code: Select all

7266447313870364031,
4946485549665804864,
16945909448695747420,
16394063075524226720,
4873882236456199058,
14877448043947020171,
6740343660852211943,
13857871200353263164,
5249110015610582907,
1235879089597390050,
17320312680810499042,
16489141110565194782,
13520575722002588570,
14226945236717732373,
9383926873555417063,
11510704754157191257,
15864264574919463609,
6489677788245343319,
5112602299894754389,
10828930062652518694,
15942305434158995996,
236502320419669032,
14931360615268175698,
8904234204977263924,
12836915408046564963,
12120302420213647524,
15755110976537356441,
17251681303478610375,
18286145806977825275,
13075804672185204371,
12903857913610213846,
560691676108914154,
1074659097419704618,
14266121283820281686,
11696403736022963346,
12893913769120703138,
2511068401785704737,
3774730664208216065,
5083371700846102796,
9583498264570933637,
17119870085051257224,
5217910858257235075,
10949279256701751503,
15596196964072664893,
14097948002655599357,
5636498760852923045,
17618792803942051220,
13212228678420887626,
6210242862396777185,
1012818702180800310,
15299383925974515757,
974125122787311712,
1861591264068118966,
997568339582634050,
17981867688435687790,
9460108917638135678,
16172980638639374310,
15773550354402817866,
16475327524349230602,
13554353441017344755,
6788940719869959076,
11670856244972073775,
2488756775360218862,
2061695363573180185,
3566345954323888697,
6864898938209826895,
7198730565322227090,
10827695224855383989,
11016608897122070904,
3956319990205097495,
5804870313319323478,
8017203611194497730,
3310931575584983808,
5009341981771541845,
14415278059151389495,
6715939435439735925,
411419160297131328,
4522402260441335284,
3381955501804126859,
9219789505504949817,
11628184459157386459,
7242398879359936370,
13965005347172621081,
5806488997649497146,
10724207982663648949,
957364844878149318,
8197027112357634782,
12052913535387714920,
2889379661594013754,
10511508162402504492,
6801855569284252424,
16465954421598296115,
5975570403614438776,
3688303938005101774,
2210483654336887556,
6558785204455557683,
16822351800343061990,
7444710627467609883,
3200233909833521327,
3612068790453735040,
18266943104929747076,
1620389818516182276,
3906668377244742888,
5770016989916553752,
6384853777489155236,
10311708346636548706,
17771199061862790062,
12121348462972638971,
1257976447679270605,
3664184785462160180,
10718876134480663664,
3611366553819264523,
14492630642488100979,
2903980458593894032,
12026985381690317404,
15535375191850690266,
10333316143274529509,
16565481511572123421,
14237704570091006662,
6454343485137106900,
18107191819981188154,
3559348759319842667,
18059264986425101074,
3139684427605102737,
4715785502295754870,
11077531235278014145,
10637177623943913351,
10137911902863059694,
13719113891065284171,
13776316799690285717,
8687650838094264665,
3028124591188972359,
3982930188609442149,
13815150225221307677,
16924127046922196149,
5437280487207382147,
10760687291786964354,
216630713752669403,
10655207865433859491,
1524477318846038424,
3443401252003315103,
16860120454903458341,
15362920279125264094,
14358245326238118181,
4224273587485638227,
13919998707305829132,
14473305049457001422,
12955027028676000544,
17930425515478182741,
7466411836095405617,
10879629128927506091,
11502219301371200635,
4978473890680876319,
845759387067546611,
9092379465737744314,
7562781050481886043,
3514744284158856431,
14980707022065991200,
18294903201142729875,
8979482998667235743,
16495638000603654629,
17504300515449231559,
1406052433297386355,
3296968762229741153,
6214378374180465222,
11439178472613251620,
10972816599561388940,
10020049344596426576,
9381977959648494876,
15282520250746126790,
4891472444796201742,
4564628942836375772,
12627401038822728242,
8515217303152165705,
2836463788873877488,
5327734953288310341,
4193447453292207765,
8727015815475533844,
1794828640516310551,
839109216263472222,
11003569267662299508,
14818712892121773001,
11341937060697364828,
16294497818497013091,
7938847863410484112,
12460847944021797729,
8608832166868962581,
17282690963297781165,
5236305832299547005,
13653613720566641032,
12795694179935286147,
3619745730869440312,
7023474619158759074,
6411707388950674382,
11610566205662556902,
12720426256176311341,
963006111335524252,
12602026180005991793,
10977961698003017025,
14314905386630121264,
593861932304949197,
1759320944513001478,
9844433545111928009,
7516448510961597387,
6979677882708694852,
2623982553786190271,
10956409229583802704,
10773480483945135813,
15589196139318714477,
13992302356379003709,
4144556090023237143,
2683982833995814204,
14174237260119144415,
5498804830346368935,
10015422821119519276,
14006884420982275271,
15325155849418805462,
2337041946913300563,
17100624240218191776,
9703324598394127586,
17019689424591946956,
5780649476454802027,
14414929270030064142,
18404798721277276349,
13727527782081926783,
14049840052842737870,
13090081540345862947,
9489259826421593604,
11339178955354061847,
2431380992571392509,
13011028955371218345,
17577910823749512297,
6646205212361830820,
6563389574948647110,
5615534989929158531,
5753528745081333993,
1974805642753365513,
2848156987029842825,
17613615095014857579,
2011506583012245120,
2444313452813434980,
295943014965754495,
9882162289524262117,
12675922461078850762,
3834401558737001127,
866051294803417039,
2724626095286417021,
18307426813116457025,
17948009628770529172,
6685233615168851649,
13500066391123604136,
12479713940936428223,
9424117665582424405,
6039353791193701794,
6601976231243625663,
15224447585169584601,
2728973181524205713,
3462528993083828381,
11340412255977527276,
16097257884801829806,
15873188707503643756,
13772224761560358678,
13111754990776650992,
96905898085114986,
11176895769597467160,
600926880159025491,
17204915804540124261,
1144214061925539673,
6442316514250842898,
12890767762330780561,
1678595440397729949,
17555837092409264409,
11850798096946224952,
18347395534780169545,
2902301657143828160,
4513207106323818436,
7208587791955414370,
14036122687726750680,
5845312298939252013,
8658865064369425702,
17865168032283289844,
4257028217766215264,
6122026574733783975,
9170295234685582608,
4625842927060587645,
10364408876534383966,
3160614275850263182,
4048844641307615001,
9202228564570972667,
10244349660455576579,
4365624743606344104,
7914034060710558862,
14082118313143494030,
13893540545824007220,
12557303001492689466,
18034204128425921887,
340230915844217824,
13885363215660853141,
182790206115731779,
10275690770029126957,
2207732794522698303,
4015366832566852941,
3344126814245426647,
3418909431246792130,
18170060564269107324,
16825303559054309655,
3076199647024046233,
8592572442492131294,
13847613594546126389,
8025098507225669679,
9851016542364179299,
10069389887474709588,
6112305132354510512,
18059298976380052840,
6186105518604848851,
2104877594513762728,
3056571032953733,
1344029458328294184,
11681380657174477138,
5579944120707736744,
38527987932692056,
5019284574311325165,
11861800887103445942,
17678318898574268818,
17331386544906712071,
14625477349934894239,
9197216899815357998,
15895416949726083115,
1591794355990697234,
11846598379562363642,
1968673912932124150,
7694531300856204513,
12056737119287626344,
16294510520227781408,
1849214443991414572,
5204647870090191978,
14004367337513854673,
5094632487920517113,
6933045759333815331,
14735964389804262666,
1431787135216247150,
3027992589588197224,
15666375125344846699,
4967011828356632134,
9679911049165960321,
5759747806256240828,
3841970197407798734,
538876215104951112,
16738327113730050814,
4796759719169426917,
17526144157780855210,
4406271885088510609,
272679168754122071,
14117891565238258794,
6239715909555052601,
7331448258562910929,
11606443195551224899,
8233214365892470430,
3170421326472746759,
2532665202646579370,
5465487865142825507,
4288533736509213790,
11640137442758811293,
16473912850801955436,
1612487638443769146,
15199712313667690185,
15106844553931914257,
6143426764259491757,
972664709081254460,
8017518460018236671,
11529724129963821248,
13568352186393728922,
13655575427028990950,
9369396776556321785,
6740149707310754612,
12655055223902686386,
316739669461445705,
6378569413102905018,
3632760136062488749,
8236711185392647459,
14695725533898965208,
2917914788653649637,
14904065006021498857,
266141044306879911,
7789385148154111845,
9276496317333538947,
3649103956926581942,
8720151215550917497,
4068307906424987783,
15743036865071709307,
899343666030374137,
12803792226239136366,
8248569087391634204,
14570577633538746290,
18024782582587949048,
17994440334793743113,
6447785911588669456,
3796105823204027729,
7666445045503776980,
12454886681445086127,
1412939819494326923,
17743268430580248211,
12945634703337535830,
5730300706238953677,
17663059373094704715,
2805561707037079926,
376290161476154776,
18122210988913566163,
10080823601656395959,
14090238559147233762,
17941097701698322371,
15544416989640379719,
14256466529909301342,
13476108746956868517,
560073126797980624,
15840078975005802326,
17723856983309373632,
10960957671863881057,
14715668988943444743,
14853791396081808224,
18103339564082223846,
8695438280450667241,
14502185569048036116,
6773610541650113645,
9345536836128693432,
16870200170094625047,
9948947958385916645,
7609902932318462874,
10560240575947025563,
11912847058379669493,
11032566756363179838,
7150777503809066368,
1113352174879837739,
16433621322552428267,
1932875827204412222,
10122216141432847859,
15200026780478921060,
955438079876855847,
4390726732378888763,
4448489696876757548,
10483378997497959924,
12895655159111645470,
15055313665129522508,
9746481362587815484,
15593856518331513408,
12024766416872403891,
13319421147871442929,
7593615777716483669,
1316310554514291685,
6300303343646765998,
14990138932076746755,
12575731278303794469,
8616043469741522133,
5832251812528047834,
93558474256533534,
18067818861367010250,
14797889806118094651,
415543360438799158,
8194481953080600754,
5680356099160703410,
17502533412824746877,
6100828799957981067,
7168482564972963076,
3466436653047686102,
5424122980892706297,
3984433389958159180,
15910815059630032243,
8181619872058048777,
1661718840207068211,
13411569453877055172,
10911778211788973168,
6523296957524480156,
8757115845172666540,
15662809124003336360,
7090540720100204813,
7444425877460386815,
4829814737671235249,
13798208304107335546,
7007177217067526641,
14204094315557980993,
7739365733068891583,
10243365164320531876,
14898424495793766951,
11356786232039989287,
14252160528052174991,
9160514444749429801,
5414672451498595302,
7065189374087547575,
795488996564666104,
10198305958935766197,
10668714513951143326,
3419453460176799224,
9568203776865882506,
3384466374186365972,
1737271475564685705,
500593126082111186,
7660625790259624634,
11640848311215376089,
6537455579313128620,
142340399285261373,
11134370432859116258,
8842208967633864131,
7808693772246775283,
11818747394676272348,
13562795926694249981,
5093343192598484846,
6570900311512235738,
13122173297186705187,
4860828980266768693,
10983886834137974504,
8274301297846729936,
1797959588777595638,
375263153417117750,
16808921818031018405,
12622248215401065289,
13577234596739432319,
2424796270238574506,
13125995887770919878,
2977392890624223832,
4093525481259338150,
16298403536256340045,
15427825321755958043,
15494035220426340476,
17147049047817936382,
1979110379897059036,
11000661401608450307,
6611566949761648413,
3401463964417309033,
4369308028240848393,
4629081379435499768,
8990137430054332707,
15390525649802769016,
8074132056979870755,
1502161945191883513,
15167823569568572156,
1452783030375940330,
7909335555924414126,
11228236778200373849,
333233094234370048,
3318643278058236428,
7350236101554952157,
2658937705804712956,
9157021194503811342,
4635767814692501546,
9472003490482701807,
14356234451316843385,
5666566728962373778,
6240960044712709557,
4853952732146413086,
12952526968311338701,
3753748956078835983,
3872709083526657846,
13018369927512579537,
16928459174379279888,
12522125007431924253,
3383918517187096671,
2391045522916219463,
7748575613834223204,
4875548245595043864,
7270052715795133625,
6639863592001348421,
2012415473511352736,
11510402350156337009,
5789823010686330324,
18432989548752008190,
12284635513482943602,
16410340887848707921,
15553439284678492869,
13581209645191346986,
4096124489634445925,
8883900193884873096,
8246194633265787216,
17378232394989440181,
10543506148110863377,
6755989823836673353,
3854356919633216030,
10224221529230178237,
14956254920679686223,
11801122998951810396,
3832732292965167475,
3707192126699181012,
6952415589146728859,
8750388019701674489,
17530209217594959360,
14341608797835247858,
10249335584835312966,
15866751467596828883,
7845691477505129009,
15107198132661562823,
5600819723908136519,
14302607041357787669,
12592339570245237590,
556013807694270877,
531019300009435734,
17405486901069728290,
10665301228830556232,
16596696244711642791,
2214265345799230874,
8211244747951370630,
1322702445802452360,
713957012861037567,
10160909976287599756,
7473839231027950791,
12009676050495040019,
17652896452431720200,
10012325529988667694,
17960546758549620300,
8618667949242292449,
9887427400366272555,
12810530938231017467,
16984140304864748092,
3849244442929899044,
9046295126901750094,
13058665224411221464,
10218436031304141519,
1280781496668643066,
13488117173221050851,
1839141432307921563,
7973005670583750543,
14198182450678473889,
7206447910448861965,
4583829617955212159,
1589777889987744679,
313752729175327821,
7334685460893112382,
8598844999483354885,
3148068724384283718,
13335650041995798543,
1567783345244299062,
14203279090208532847,
12790517611662709259,
11976962690517602127,
4240796256825381958,
16602097298936107154,
15325889890686687508,
5069060527078086642,
13186007042316633541,
11582242001616736704,
12352777335890633799,
18351815285787232877,
7546946471898304015,
12095073432274003250,
8944390674545152846,
12109793112259472258,
9364617114955433729,
6010702723051052021,
13930995795140946314,
3167987672766580849,
632596638386808620,
7779860973604876093,
7947654306390904990,
1675030658236680377,
11624999461433824079,
13440803808148012466,
7751032689193916523,
17117428786174840120,
6319126687835161224,
10826961732146985546,
11748002111746880620,
12131345684254666224,
9875426906550439942,
2333163570371212717,
12969390694073338316,
9212931111128487440,
15835166439425734989,
17508316415391944531,
7381706450201278935,
12470544854420395865,
12090754068074150285,
2191357356032384464,
17645697804267529825,
1816601009880919192,
4561120550537314832,
13507503391516994871,
2660396017750569835,
17755187334285783028,
2646529208403087750,
10388257665652935600,
14453582192751123442,
18110353644471153527,
3716954225262189308,
1686024430943572105,
5702968287454907620,
1956902727697937167,
17133775405710140992,
1068264636956363649,
6478024642121015779,
16238687947785625011,
9037794509879725763,
9492872233752812516,
3013075772257500841,
17861131227795523840,
3207568859556488759,
12647523883169324699,
2138904502201427544,
3275011697176927090,
15358214018396172571,
12992112402073705045,
16845554512649653215,
18742449639875519,
13596859891559196740,
13426075886730108038,
11498193401679392747,
16554918849778015914,
6693259110504680952,
11068007414114481498,
15031600615271110846,
16915039384378332941,
16965971652048442808,
2805228884283956864,
13266457154030204801,
9113356832988394628,
4752139457708102565,
9374187400479837644,
7987308013595423555,
11335557882091649491,
6564107756504388667,
16676671079038635603,
14389610754465776508,
12208907610723030280,
1404207627336892455,
18129093985541615599,
3011957003813591363,
5103731539216620120,
11985408831071816364,
8886212782077038379,
15499287571778887269,
6115644674788544842,
6940921379544017100,
12008303302613859394,
4327726256281669977,
17396637511609480109,
17522490609682186116,
10764289495492126947,
15846495635508069559,
4006579737119843560,
8501453419409626034,
14902345471454293510,
8209387058803615393,
5879028109713426756,
14379486780292781325,
3662741253618663411,
15089075459218275296,
8982422692653457875,
15825534325394635716,
4160847737723961071,
7522695362760546344,
6944892085190875384,
9006190430756193652,
16537475877644756205,
10391543545289139615,
9468957811727775505,
2874535243372953467,
16610417466473455962,
5432043386984263822,
11300736915872747595,
11175465018812210620,
5346505397788459142,
17382992222512285672,
18416667481474744028,
15729805885816281093,
528619548661104339,
4193727026216190840,
8540759065024435797,
12809588388077246964,
4157381666307796279,
13439545384268686349,
10476601131560645152,
14635021400113324010,
7385869810852767216,
17489804380727317749,
473178655303644430,
6824661581052651634,
14493986231731557855,
17888886488826311210,
14413582266175909482,
2437572569965628929,
12774941764325664375,
11201369941043626547,
11495541249571049899,
12839439816503949388,
14846618736338472665,
16650820008437737103,
9948580981250172830,
5184041577668404165,
10379222904510705383,
13832791432129388436,
12276909775202651292,
7410127810410338732,
12130683480226924607,
14017496135319544031,
6860653085190953429,
3443041819506891188,
693572503710819543,
3531472405562073275,
15668286819122906112,
15427477814700549439,
12073839964796618661,
17507605560077946920,
2455365195181918791,
5964998669248654874,
15447880721255769419,
4469176972055685202,
15211694042356568608,
3759814231605665372,
18168445266382181794,
6509891475561581108,
12124751967199354237,
17848311530842249744,
17627624472618765247,
1223563903634178192,
2918849287364629264,
2746577282574245190,
18249210529947804762,
1387152020856480609,
3855972378689829637,
14111119528432513185,
6580174121676077055,
18265787066455576602,
10691648861204636862,
6833173963338540739,
8454814670236484282,
15036345140247192881,
9105289581939367919,
16703249455563584555,
10569135442141345919,
397017240905668054,
126198906736958735,
16591722875182706201,
5736319088835606273,
15916827908810835259,
16321683770365590218,
4536445586451618173,
9199827198413403170,
2588029247400550403,
1504353623037103694,
I guess that I can get quite a few more, because they are still trickling out of the generator.

This totally brute force method might be able to generate a 24 bit set but it would take a very long time. I guess that to get better sets with higher Hamming distances between each and every pair, a more sophisticated gathering method is needed.

But if you just need at least 23 bit hamming distance between every pair in the set, then the above set should be fine.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Zobrist key random numbers

Post by bob »

hgm wrote:
bob wrote:What is not possible is to use the values you gave, upper half ones, lower half ones, and all ones, and then generate other numbers that only have a hamming distance of 32 or higher, including those three, to fill the 788 element array. I've tried way over 4,000,000,000 64 bit random numbers and have only gotten to 23 as the min between any pair. 24 might be possible, and perhaps 25 or 26. But 32 seems well out of reach
But that is overlooking my original constraint that _all_ pairs of numbers in the set have to have a hamming distance >= N. So far N is at least 23...
I never said that it was possible to give all keys a distance of 32, nor is this needed. I only wanted to point out that a set of keys with a very good hamming distance can easily hide dependincies of the worst possible kind. (Well, perhaps except having two equal keys, which would be worse.) And the offending keys could be amongst those with the best hamming distance to all other keys, and each other.

Try the following:

Take the "best" set of 788 you were able to generate, and select the three keys from it that had the largest minimum hamming distance to all others. I.e., if the keys are k_i {0<i<=778}, define the "isolation" of a key i as min(d(k_i,k_j) over all j != i, and d(x,y) the hamming distance between x and y, and pick the three keys with the largest isolation. Call these k_a, k_b and k_c.

Now calculate M = k_a ^ k_b ^ k_c.

Then transform all keys in the set to K_i = M^k_i. This transformation leaves the hamming distance invariant, as x^y = (M^x)^(M^y). So the transformed set is just as "optimal" with respect to minimum hamming distance as your original one.

But

K_a^K_b^K_c = (M^k_a) ^ (M^k_b) ^ (M^k^c) = (M^M^M) ^ (k_a^k_b^k_c)
= (M) ^ (M) = 0.

So your "best" three keys in terms of hamming distance w.r.t. all other keys are now in fact the worst 3 keys, causing collisions between boards with just 3 mutations between them, and rendering the set with this large minimal hamming distance totally useless.
Got an email from someone that is more familiar with this stuff. He first told me that it is possible to produce 788 numbers with a min hamming distance of 28. But that this will be a linear code where XORing any two of the numbers will produce another number in the set. Which is not so desirable. So I am taking that data point and trying to decide what it means with respect to Zobrist numbers...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Zobrist key random numbers

Post by bob »

Dann Corbit wrote:There is an exponential slowdown with my method. For 26 bits, I have more or less frozen on 347 distinct values (so I will have to try for a smaller set):

Code: Select all

7266447313870364031,
4946485549665804864,
16945909448695747420,
16394063075524226720,
4873882236456199058,
14877448043947020171,
13857871200353263164,
5249110015610582907,
1235879089597390050,
17320312680810499042,
8942268601720066061,
14226945236717732373,
9383926873555417063,
11510704754157191257,
6489677788245343319,
236502320419669032,
13670483975188204088,
8904234204977263924,
17251681303478610375,
13075804672185204371,
10831805955733617705,
1074659097419704618,
17119870085051257224,
10949279256701751503,
17618792803942051220,
957923366004347591,
1012818702180800310,
974125122787311712,
1861591264068118966,
3809841506498447207,
13408683141069553686,
13900005529547645957,
16475327524349230602,
13554353441017344755,
4738086532119935073,
6788940719869959076,
11670856244972073775,
2488756775360218862,
11016608897122070904,
13978444093099579683,
11628184459157386459,
4249175367970221090,
7306216312942796257,
2889379661594013754,
17310575136995821873,
3435082195390932486,
7444710627467609883,
11216615872596820107,
5770016989916553752,
1845293119018433391,
1259990987526807294,
15531278677382192198,
16317667579273275294,
9134927878875794005,
9030000260502624168,
3115849849651526279,
10637177623943913351,
16428252083632828910,
15722061259110909195,
1524477318846038424,
3443401252003315103,
9689406052675046032,
3609534220891499022,
9281161952002617309,
147649915388326849,
10131486500045494660,
8517521928922081563,
2836463788873877488,
9570032848237657586,
10863668391515109722,
1552803150609742001,
2790375502200557313,
9038024825497430573,
91888768090624853,
18145740993490813283,
12654149022202498759,
4206418103243872757,
7233523623977397383,
16215672393055652545,
10738887894178969425,
18204068107936511697,
14383128117587060157,
15849831596023436356,
17675390291979846750,
2977578850677699908,
4893323648315952120,
1286466090879300568,
9888911152046881084,
3183884142852054126,
13772224761560358678,
9094920381744576493,
16129742540997802980,
16945398958854163835,
17650197551112766205,
4852422776459831315,
9362357443732597760,
2374087830147132659,
15000861190071109560,
2902081674035190433,
15810933559568492050,
12678167969995957047,
1798389442866720091,
14599659047605763816,
17782026137486407602,
3027116614594121997,
6496187495111652573,
9859717582333494749,
5930885232297252456,
4061277839767617930,
12035499765197893420,
4370560942875640999,
5634383789002676726,
8907175724738102010,
16593287713411177161,
3325238609365118367,
17125462708636491154,
10188578131352743024,
15161949016576385831,
6657699133553403854,
2352226978179009098,
3859532089524191730,
17631674258545638758,
17581014988572303447,
7458819045178438285,
5488240155574034654,
7788457792396395633,
1234217808918573134,
10045923023026503261,
2803693151878023143,
15042951576086758915,
1809970995609003345,
6472832596573079460,
10531013421297635766,
9687689322966646953,
5309220766259687196,
16099895359080387221,
15463291357721078947,
14892243053368326929,
15913028219213787856,
17114854711077298999,
6881183452302138939,
9743703211409053724,
6120184892838179370,
4488025338083630045,
6932643716586102064,
7085729815153112724,
2577286319771781656,
3212578193372804795,
7140055923216537951,
11545784650358033961,
15097420044622846756,
9577429288174440901,
1651506457155992685,
17206783877956047023,
4977537220776361209,
16799175153209517804,
17623046094747753280,
16695848152965592420,
807005292018537624,
5694219642130963465,
17782774995076800672,
5025236171457631467,
11601588411391151733,
13800826249802546619,
8320715347883164621,
15765965395656039061,
9783656346475123313,
15660593116602060011,
12686638988178810220,
4601829680043422926,
13649469918759116343,
11072681934824066811,
3484285465118294452,
5250162757012130834,
11822278712571422607,
16820676274862823347,
2258483262623939360,
18059638503665417019,
4038533795659869059,
9217581272623145121,
10474525469047663535,
1704011107366220345,
15761773994985082820,
1396662462031085091,
11499399103501446733,
8253913244279442889,
18014518805502248392,
10766750626076003259,
13347551569433141972,
12285514714001968960,
12601751059746685848,
4088019966658540820,
7550841428494759028,
14457212971848820997,
16415384305117522006,
3274893893751255634,
10659638677637579954,
6338371175383690179,
18162230369769586150,
428321177825102899,
15817001710821818046,
12235635129931490851,
13527122555395203005,
2178128838908381672,
14367385536076681562,
12915933956577960132,
4652351249928028414,
4951391482976146214,
7296771005593252278,
14127467184305310300,
16956161371242220606,
2288730399829329044,
10224299563023357164,
15302392990651373659,
5732367270286632815,
7889985811968217208,
5521408468444455621,
3010954896914979971,
14717388125128732814,
17543622707664214218,
16699503790769821674,
5300069125018992847,
4491717662350224528,
6179887503359229642,
10444048407325898982,
12310419282952883445,
9615039512616912255,
8912906368760218223,
2736639230152280465,
1466229153547721039,
2954109638740141000,
11746874332443504878,
10637552291778782845,
17962194647643634986,
7190730870912935711,
15378933026600388229,
7415343666878271746,
4247889442676475641,
17929428741300739597,
6205303292541642307,
11123091740953949733,
784117286214737662,
11137709922435249100,
14725228923085766997,
10386402860586212951,
13143405698908382732,
196620903144528027,
10705589578384286810,
13817879522456382188,
9229688921939842696,
16633756859233364337,
1032072982178823495,
6370454774064667856,
12850106475877076817,
12267618954701302483,
8145470530489095863,
1814673802044807488,
9225545243819924881,
14884320946805680190,
7015855463293451660,
15665030223840195079,
17002420156823161993,
3049382545994967746,
17417472035022723033,
12396544237084354931,
6725541218060571039,
9710463154252506414,
9950389178902628715,
2371212431907900846,
18374266211527465082,
14109608474880409885,
10041272077912916256,
5726527053967358581,
11966583246028264826,
16565423595231842294,
4787603906131836800,
2358971807316617129,
701848729445873300,
7462412777600825764,
17256139670461659054,
18098924730684751225,
503596689135387308,
17615667363549849844,
3787023102090135939,
10889153560001930160,
9630600983458854043,
14840676362451429709,
15285971904287568249,
760130182760799549,
18273147886613016929,
17988260782976079957,
10576771164953308062,
1374404921073484550,
5711543178872819554,
7267384182398429791,
3847053869966350600,
11350390488874863454,
18034667604288436754,
15728235335976939570,
1690501778949613150,
10549826829132374141,
8187654266517442902,
14570575066764711251,
8330819712241433781,
17436220147483706956,
1259157189813452226,
13025642373655069123,
14356472637065835570,
16222490068333456653,
2485152632185027389,
2742816983698754277,
2661133492768338581,
2301215659926313223,
13233097894633159274,
12656717602888925661,
10165318829475529952,
17104609321564382922,
10325932561555029770,
6413244029449044455,
8191767193394389622,
10270929734388613920,
12291445944674790578,
10802320535004165936,
3928453647719019674,
10318533838179330761,
18290228294878833931,
17117845830988322373,
12942239967337847160,
11380882416157141219,
13460991881535950924,
3587389546577196427,
5111810686918228644,
4114159579120732836,
8946597124993059928,
5207951741791249331,
1411671654137597246,
7702399104537211022,
4568625842739988035,
563893241007464401,
17187067130913047100,
11828988545797689038,
11702908455376917457,
8794147767634410081,
10079173818009207539,
125881399269187320,
5230839931433374219,
1531203087033921236,
Someone who knows the theory behind this sent me an email stating that 28 is possible. But the numbers would be highly undesirable as XORing any two would produce another number in the set which is not so hot...