mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Chess (https://www.mersenneforum.org/forumdisplay.php?f=93)
-   -   chess positions: how many legal ones are there ? (https://www.mersenneforum.org/showthread.php?t=15448)

Christenson 2011-04-04 02:46

[QUOTE=CRGreathouse;257502]I'm not particularly happy with that bound, since it essentially just labels each of the pieces and tracks where they go. Obviously replacing unlabeled pieces by labeled ones is valid for finding an upper bound, but this does not take into account other states that pieces may be in. For example, suppose all the pieces but a single pawn are placed; in your upper-bound, there are at most 3612 * 62!/33! ways to place them and at most 33 ways to place the pawn on the remaining squares. But the pawn has many more than 33 possibilities: in each of the legal positions it can be normal, promoted to queen, vulnerable to [i]en passant[/i], etc.

Now the upper bound is high enough that it's still a true upper bound, but not 'for the right reasons' as far as I'm concerned.[/QUOTE]

My stated upper bound isn't terribly sharp...thus the question earlier about how many pawns could be promoted given the number of captured pieces. Incidentally, no pawns can be promoted unless something has been captured.
[SPOILER]
Oversize, reasonably sharp upper bound for all pieces on the board:
3612 ways to place two kings * (35 ways to place a pair of pawns on the same file)^(8 files) * (64-18 remaining pieces)!/32! / 4(can't tell Rooks apart, both sides)/4(can't tell knights apart)

Ignores that some ways to place the kings are going to get into the way of some pawn placements.

And, oversize, not so sharp upper bound for all pieces but one on the board:
3612 ways to place two kings * (35 ways to place a pair of pawns on the same file)^6 * (64-16 remaining pieces)!/32! /4/2 (have at least 3 pairs of rooks/knights I can't tell apart) * (5 (pawn, rook, knight, bishop, queen))^3(pawns could have been promoted after one capture)

It is going to get a lot more complicated to keep even this sharp as we lose more pieces. Everyone except ScienceMan knows this....
[/SPOILER]

science_man_88 2011-04-04 11:13

[QUOTE=Christenson;257520]
ScienceMan, back to the question about the number of distinct legal positions with three pieces on the board. There's a problem or two with my math in the previous post; what is it?[/QUOTE]

the error is in the fact that there are only another 30 pieces to put on the board no 32 and that with 2 used up we can limit the remaining squares from 64 to 62. oh and the math doesn't account that the squares are like semi distinguishable urns in that you can tell one group from another.

science_man_88 2011-04-04 11:40

one thing I thought of last night was the fact that we know how many chess moves each side has by calculation I remember 3608/side ( somewhere on the forum is a image I made to show this) 8 of which aren't important to positional play unless you want how fast you can get to it. oh course these don't consider most captures on the board ( only normal pawn ones if I remember ( not that the others can be distinguished from a normal move except in notation)).

Christenson 2011-04-04 12:16

[QUOTE=science_man_88;257541]the error is in the fact that there are only another 30 pieces to put on the board no 32 and that with 2 used up we can limit the remaining squares from 64 to 62. oh and the math doesn't account that the squares are like semi distinguishable urns in that you can tell one group from another.[/QUOTE]

Scienceman, the question I was trying to work was:
How many distinct legal chess positions are there with only 3 pieces on the board. We know there are 3608 ways to legally place the two kings, and we are going to place one other piece. It is correct to note that there are only 62 places where this piece can go, but whether we have 1 piece beyond the 3 we are working with or 30 is temporarily irrelevant. What choices do we have for *each* of those 62 places? Something important is missing from my earlier post, what is it?

science_man_88 2011-04-04 12:23

[QUOTE=Christenson;257546]Scienceman, the question I was trying to work was:
How many distinct legal chess positions are there with only 3 pieces on the board. We know there are 3608 ways to legally place the two kings, and we are going to place one other piece. It is correct to note that there are only 62 places where this piece can go, but whether we have 1 piece beyond the 3 we are working with or 30 is temporarily irrelevant. What choices do we have for *each* of those 62 places? Something important is missing from my earlier post, what is it?[/QUOTE]

no the 3608 is legal chess moves not including most captures per side. 3612 is the number of king v king. that pawns only deal with 48 is relevant then , I'm stumped without looking through the thread again. the fact that there are only 7 distinguishable( possibly 6 if you count both bishops as one) pieces may come in play.

CRGreathouse 2011-04-04 13:25

[QUOTE=science_man_88;257547]the fact that there are only 7 distinguishable( possibly 6 if you count both bishops as one) pieces may come in play.[/QUOTE]

If you count each side as having only six types of pieces, you'll need to keep track of the other stuff elsewhere: castle ability, en passant vulnerability, etc. You could alternately store this with the piece types: you could have a "king that can still castle" and a "king that can't castle", a "pawn that has just double-moved" and "any other pawn", a "rook that can still castle", etc.

science_man_88 2011-04-04 20:04

[QUOTE=CRGreathouse;257551]If you count each side as having only six types of pieces, you'll need to keep track of the other stuff elsewhere: castle ability, en passant vulnerability, etc. You could alternately store this with the piece types: you could have a "king that can still castle" and a "king that can't castle", a "pawn that has just double-moved" and "any other pawn", a "rook that can still castle", etc.[/QUOTE]

in a game setting could this not be accomplished by a addition for a given position in a binary string, the problem is I don't have a useful legal move making code as move() as I have it doesn't check if it's legal.

Mr. P-1 2011-04-04 20:24

[QUOTE=CRGreathouse;257551]...you could have a "king that can still castle" and a "king that can't castle"...[/QUOTE]

You don't need to track king castlability, only the castlability of the rooks. Any move by the king removes castlability from both rooks.

question for sm88: defining a "configuration" as a particular arrangement of chess men on a board, without additional information, and a "position" as a configuration plus additional information sufficient to determine the entire space of possible games that might follow, what is the maximum number of positions that might be represented by a single configuration?

science_man_88 2011-04-04 20:46

[QUOTE=Mr. P-1;257595]You don't need to track king castlability, only the castlability of the rooks. Any move by the king removes castlability from both rooks.

question for sm88: defining a "configuration" as a particular arrangement of chess men on a board, without additional information, and a "position" as a configuration plus additional information sufficient to determine the entire space of possible games that might follow, what is the maximum number of positions that might be represented by a single configuration?[/QUOTE]

if you allow the initial position ( a configuration by your definition of position) then the answer is the number of legal chess positions.

science_man_88 2011-04-05 01:00

[QUOTE=science_man_88;257596]if you allow the initial position ( a configuration by your definition of position) then the answer is the number of legal chess positions.[/QUOTE]

never mind I get why I'm wrong.

Christenson 2011-04-05 01:55

[QUOTE=Mr. P-1;257595]You don't need to track king castlability, only the castlability of the rooks. Any move by the king removes castlability from both rooks.

question for sm88: defining a "configuration" as a particular arrangement of chess men on a board, without additional information, and a "position" as a configuration plus additional information sufficient to determine the entire space of possible games that might follow, what is the maximum number of positions that might be represented by a single configuration?[/QUOTE]

Thank you Mr P-1, for pointing out a fundamental ambiguity in the thread title. I thought we were trying to count configurations, not positions, as defined above.

How much state information do we need beyond the positions of the pieces to distinguish all the configurations?

I think we need to keep track of whether four rooks can be castled, and whether 16 pawns have the chance to capture en passant.

@SM88: Can you tell me the intent of the word "positions" in the thread title?


All times are UTC. The time now is 14:09.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.