Computer Chess Club Archives


Search

Terms

Messages

Subject: 10^44, is it the right upper bound?

Author: blass uri

Date: 23:49:49 07/11/99


passed pawns,pawns on the same file and promoted pawns are declared to be good
pawns
The other pawns are declared to be bad pawns and have no chance to promote
before improving their behaviour.

It is easy to check that the number of white good pawns is at most the sum of
the number of captured white pieces and twice the number of black pieces that
were captured
because every capture of white piece increases the number of white good pawn by
at most 1 and every capture of black piece increases the number of white good
pawns by at most 2.

I use this observation to develop my new c program to calculate an upper bound
for the number of chess positions.

please tell me if I have a mistake in the program and if you know a way to
calculate the exact integer.

I got 9.27397309111305334*10^43

You should multiply it by 2 because I did not consider side to move.
I also did not consider other things like castling


#include <stdio.h>
#include <conio.h>
main()
{
clrscr();
char x1,x2,x3,x4,x5,y1,y2,y3,y4,y5,i,j;
long double k,n=0;
long double m[65];
m[0]=1;
for (i=1; i<65; i++)
  m[i]=m[i-1]*i;
for (x1=0; x1<9; x1++)
 for (x2=0;x2<11-x1;x2++)
   for (x3=0;(x3<11-x1&&x1+x2+x3<13);x3++)
     for (x4=0;(x4<11-x1&&x1+x2+x4<13&&x1+x3+x4<13&&x1+x2+x3+x4<15);x4++)
       for (x5=0;(x5<10-x1&&x1+x2+x5<12&&x1+x3+x5<12&&x1+x4+x5<12&&\
       x1+x2+x3+x5<14&&x1+x2+x4+x5<14&&x1+x3+x4+x5<14&&x1+x2+x3+x4+x5<16)\
       ;x5++)
{
k=m[x2]*m[x3]*m[x4]*m[x5];
i=0;
if (x2>2) i=i+x2-2;
if (x3>2) i=i+x3-2;
if (x4>2) i=i+x4-2;
if (x5>1) i=i+x5-1;
printf("%Lf\n",n);
for (y1=0; y1<9; y1++)
 for (y2=0;y2<11-y1;y2++)
   for (y3=0;(y3<11-y1&&y1+y2+y3<13);y3++)
     for (y4=0;(y4<11-y1&&y1+y2+y4<13&&y1+y3+y4<13&&y1+y2+y3+y4<15);y4++)
       for (y5=0;(y5<10-y1&&y1+y2+y5<12&&y1+y3+y5<12&&y1+y4+y5<12&&\
       y1+y2+y3+y5<14&&y1+y2+y4+y5<14&&y1+y3+y4+y5<14&&y1+y2+y3+y4+y5<16)\
       ;y5++)
	{
	 j=0;
	 if (y2>2) j=j+y2-2;
	 if (y3>2) j=j+y3-2;
	 if (y4>2) j=j+y4-2;
	 if (y5>1) j=j+y5-1;
	 if ((i<=2*(15-y1-y2-y3-y4-y5)+(15-x1-x2-x3-x4-x5))&&
	     (j<=2*(15-x1-x2-x3-x4-x5)+(15-y1-y2-y3-y4-y5)))\
	   n=n+(m[48]/(m[x1]*m[y1]*m[48-x1-y1]))*(m[64-x1-y1]/\
	 (k*m[y2]*m[y3]*m[y4]*m[y5]*m[62-x2-x3-x4-x5-y2-y3-y4-y5]));
	}
}

printf("%Lf\n",n);
}



Uri



This page took 0.01 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.