Hacker News new | ask | show | jobs
by zone411 805 days ago
Note that the number of possible legal positions will likely be largest with fewer than 24 pieces. For regular chess, I've calculated that there are most legal positions for 29 pieces: https://github.com/lechmazur/ChessCounter?tab=readme-ov-file...
2 comments

It doesn't really matter, since every position with 24 pieces can change into one with fewer. So you need the sum of all of those values.

For a more sophisticated estimation of the number of legal positions, taking into account _true_ legality (a legal position must be reachable by a sequence of legal moves from the starting position, however dumb), see https://github.com/tromp/ChessPositionRanking. You can probably filter their sample by number of pieces to gain pretty accurate estimations for number of 29-piece positions if you wish.

This matters in the context of your statement of "factor of 140 per extra piece," which doesn't hold when the number of pieces nears the maximum.
> For regular chess, I've calculated that there are most legal positions for 29 pieces

Improved counting shows the maximum to occur at 28 pieces [1] (also see the issue I filed on your github repo).

[1] https://www.chess.com/forum/view/general/on-the-number-of-ch...

I don't have time to go through the thread at this time but I see that in the first post of this thread you just confirmed the number I calculated (8.7E+45) instead of your earlier estimate of 4.5E+46?
Your page only mentions

> Upper bound estimate of possible legal chess position (counts en passant, castling, sides to move, allows underpromotions): 8.7E+45.

But how exactly is this number determined? Is this a sampling based estimate?

My 8726713169886222032347729969256422370854716254 is an exact upperbound on the number of so-called urpositions, and is not sampling based.

In any case it will be easier to continue this discussion at https://github.com/lechmazur/ChessCounter/issues/1