Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: (off topic) Is my math right?

Author: Erik Bergren

Date: 12:11:56 08/11/03

Go up one level in this thread


     Angrim, both your answers to my post
were very useful.
    I did not even consider
that computers might get stuck in bad
lines. For example if in DEEP JUNIOR
vs. KASPAROV the computer was not helped
in solving Kasparov's(origonally Shirov's)
innovation "g4" by its programmer's, then the
match result might have been 0 wins for the
computer.
     Your experimental method for producing
the probability curve was a good idea,
and not at all lazy (as you said).
    However your numbers are incorrect.
I suspect your random number generator
was bad. I would like to know what method
you used for that.
    Thus, I have listed are differences bellow.
Here is the program I wrote:

If you have programmable calculator, you can generate the equation's values with
" seq(.5^100*100!/(x!*(100-x)!,x,50,100,1)"

Unassemble of Program to generate 10,000,000 trials of flipping
a penny 100 times. The subroutine “rnd” is copied from Robert Hyatt’s
random number generator in “hash.c” of crafty.
 u 700 7b2

26d2:0700  90           start:	  nop
26d2:0701  90           	        nop
26d2:0702  8cc8         	        mov	     ax,cs
26d2:0704  8ec0         	        mov	     es,ax
26d2:0706  8d360006     	        lea	     si,x55     ;for i=0;i<55;i++) y
‘rem Note: “x55” points to 55 numbers that I copied from Robert Hyatt’s random
generator in “hash.c” of crafty.
26d2:070a  bf0030       	        mov	     di,3000
26d2:070d  b93700       	        mov	     cx,37
26d2:0710  66 3 ad         	         3 lodsd
26d2:0712  66 3 ab         	         3 stosd
26d2:0714  66 3 33c0       	        xor	     eax,eax
26d2:0717  66 3 ab         	         3 stosd
26d2:0719  e2f5         	        loop	    710
26d2:071b  90           	        nop
26d2:071c  0f31         	         5 rdtsc
26d2:071e  66 3 a30042     	        mov	     [4200],eax
26d2:0722  66 3 89160442   	        mov	     [4204],edx
26d2:0727  66 3 b9a0860100 	        mov	     ecx,186a0
26d2:072d  66 3 51         	        push	    ecx
26d2:072f  66 3 c706240100000000	   mov	     d,xp,0
26d2:0738  b96400       	        mov	     cx,64
26d2:073b  51           	        push	    cx
26d2:073c  e84000       	        call	    rnd
26d2:073f  66 3 d1d8       	        rcr	     eax,1
26d2:0742  66 3 8316240100 	        adc	     d,xp,+0
26d2:0748  59           	        pop	     cx
26d2:0749  e2f0         	        loop	    73b
26d2:074b  66 3 8b1e2401   	        mov	     ebx,xp
26d2:0750  66 3 b801000000 	        mov	     eax,1
26d2:0756  66 3 56         	        push	    esi
26d2:0758  66 3 be00440000 	        mov	     esi,4400
26d2:075e  67 3 66 3 0104de   	        add	     [esi+8*ebx],eax
26d2:0763  66 3 5e         	        pop	     esi
26d2:0765  66 3 59         	        pop	     ecx
26d2:0767  67 3 e2c3       	        loop	    72d
26d2:076a  0f31         	         5 rdtsc
26d2:076c  66 3 a30842     	        mov	     [4208],eax
26d2:0770  66 3 89160c42   	        mov	     [420c],edx
26d2:0775  e91603       	        jmp	     stop
26d2:0778  90           	        nop
26d2:0779  90           	        nop
26d2:077a  90           	        nop
26d2:077b  90           	        nop
26d2:077c  90           	        nop
26d2:077d  90           	        nop
26d2:077e  90           	        nop
26d2:077f  90           rnd:	    nop
26d2:0780  66 3 bb17000000 	        mov	     ebx,17
26d2:0786  66 3 ba36000000 	        mov	     edx,36
26d2:078c  b93700       	        mov	     cx,37
26d2:078f  90           	        nop
26d2:0790  be0030       	        mov	     si,3000
26d2:0793  bf0030       	        mov	     di,3000
26d2:0796  66 3 67 3 8b04de   	        mov	     eax,[esi+8*ebx]
26d2:079b  67 3 66 3 0104d6   	        add	     [esi+8*edx],eax
26d2:07a0  4b           	        dec	     bx
26d2:07a1  7903         	        jns	     7a6
26d2:07a3  bb3600       	        mov	     bx,36
26d2:07a6  4a           	        dec	     dx
26d2:07a7  7903         	        jns	     7ac
26d2:07a9  ba3600       	        mov	     dx,36
26d2:07ac  e2e8         	        loop	    796
26d2:07ae  90           	        nop
26d2:07af  90           	        nop
26d2:07b0  c3           	        ret
26d2:07b1  90           	        nop
26d2:07b2  90           	        nop

>
>This assumes that both have large books, and pick moves from them in
>a somewhat random fashion rather than just playing the "best" move
>each time.  many(most?) amateur engines will repeat the same game
>over and over vs the same set of moves, so seeing a result of 100:0
>between two engines that are the same strength is quite possible.
>simply the same game being played out 100 times.  learning rocks.
>
>Anyway, I was too lazy to work out the math to find the odds of
>getting a score of 85/100 between two equal randomized engines, so
>I wrote a simple program.  Here are the results.  It might be
>interesting to compare these with what your formula says you should
>get.

                        Angrim         equation  Erik  Erik
                                                f(50-n) f(n)
                          |           n     |      |     |
                          v                 v      v     v
out of 10000000 trials, 795183 scored 50 795892 795997
out of 10000000 trials, 793723 scored 51 780287 778896 779164
out of 10000000 trials, 764336 scored 52 735270 735922 735472
out of 10000000 trials, 703845 scored 53 665905 665313 667015
out of 10000000 trials, 621736 scored 54 579584 579648 579044
out of 10000000 trials, 521374 scored 55 484743 484941 486146
out of 10000000 trials, 416639 scored 56 389526 390330 389009
out of 10000000 trials, 316655 scored 57 300686 300605 301192
out of 10000000 trials, 227297 scored 58 222923 223008 222802
out of 10000000 trials, 153369 scored 59 158691 158781 158798
out of 10000000 trials, 97752 scored 60  108439 108421 108216
out of 10000000 trials, 58311 scored 61   71107  70784  71104
out of 10000000 trials, 32417 scored 62   44729  44725  44610
out of 10000000 trials, 16796 scored 63   26979  26802  27032
out of 10000000 trials, 7973 scored 64    15597  15557  15442
out of 10000000 trials, 3548 scored 65     8639   8645   8691
out of 10000000 trials, 1417 scored 66     4581   4540   4564
out of 10000000 trials, 495 scored 67      2325   2308   2358
out of 10000000 trials, 187 scored 68      1128   1065   1154
out of 10000000 trials, 56 scored 69        523    563    524
out of 10000000 trials, 17 scored 70        232    232    227
out of 10000000 trials, 6 scored 71          98     99     98
out of 10000000 trials, 2 scored 72          39     40     53
                                 73          15     17     18
out of 10000000 trials, 1 scored 74           6     12      7
                                 75           2      2      5
                                 76           1      0      0
                                 77           0      0      2




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.