The number of legal chess positions estimated at 4.5x10^44 – proof games wanted
github.com
github.com
> They're all legal.
But then, looking at the final position[1], black is in check by the knight on b2. If white's pawn can be captured en passant, this implies the knight was not the most recent move, so the black king was in check on the previous turn as well.
It's obviously not legal to remain in check. What am I missing?
[1] https://raw.githubusercontent.com/tromp/ChessPositionRanking...
I missed something, and clearly misclassified this position, leaving only 51 legal in the 1k set (and only 537 in the 10k set).
Oops. It's embarrassing since I did pay attention to the en-passant positions in the 919-93 positions not from the smaller 1k sample, such as this one: https://github.com/tromp/ChessPositionRanking/issues/916
I'll have to make some changes to my README. Meanwhile, congratulations on spotting the error. And I'll be sure to mention you in the eventual publication.
This underscores the need to back up my classification with proof games...
In fact it was closed as
https://github.com/tromp/ChessPositionRanking/issues/915
So I had classified it correctly, but only AFTER making the diagrams for the 1k sample.
That means the 538 count for the 10k sample still stands. Good. Less things to fix on the README :-)
That changes the prospective number of legal positions to 539...
[1] https://github.com/tromp/ChessPositionRanking/issues/794
It's funny-- except for Tenoke all the responses so far boil down to essentially this.
I'll try again.
Assume an alternate reality where this incredibly important rule doesn't exist. In it, the other player simply takes the king on the next turn from a neophyte who didn't realize they are still in check.
What bad things would happen as a result of the non-existence of the gratuitous rule?
And don't just speculate based on the zero cost of posting on HN. Give me the real reason based on the history of the creation of chess rules and/or the documented behavior of real chess players in history.
This is not merely an alternate reality; this is effectively the reality of blitz chess, where capturing the king is a way of claiming victory by declaring that the opponent made an illegal move when they didn't move out of check. In blitz chess you do not have the right to correct illegal moves after the opponent points them out.
https://www.reddit.com/r/chess/comments/jrvmk7/capture_the_k...
If the penalty for the specific illegal move of not getting oneself out of check is to lose the game, what could the practical significance of the rule possibly be?
The other respondent is claiming that chess would become a game of "gotcha," as if the rule somehow prevents chess players from faking injuries to distract the chess ref and get free moves.
In regular chess, the rule just helps a player avoid one particular kind of blunder. Basically, it was arbitrarily decided that game records should never have king captures in them.
I would agree that makes it a poor excuse for a rule.
An interesting edge case is if the opponent does not notice the illegal move. See FIDE for details.
Chess would be a game of gotcha instead of the game it currently is.
The rule is there to support the preferences of the kind of people who think chess is fun.
In other words, complete horseshit.
You're not. You're asking a stupid question and complaining that other people don't share your views on what makes a game fun.
Think about actual, medieval monarchs in their castles, holding literal absolute power over everyone. If someone were to invent a board game featuring a King, and the King were to be made aware that you moved him into danger and got him captured, he might have your head.
Number of legal Go positions https://tromp.github.io/go/legal.html
Help me out on the legality of some of these boards. I see excess pieces on many boards (for example, 2 or more queens, 4 or more knights of one color).
Are these considered legal by pawn conversion?
So those choices are not redundant.
Text: https://en.chessbase.com/post/solution-to-a-truly-remarkable...
It's more difficult than you're thinking. If white has 6 dark squared bishops, they you know that he promoted at least 5 pawns on dark squares so one pawn must have taken a piece since it's promoting on a dark square instead of a white one. Not every board set-up will have enough missing pieces that 5 pawns can maneuver to get promoted on dark squares.
https://wismuth.com/chess/statistics-games.html
Also isn’t this relatively easy if you can just waste turns (pointless moves by a Queen) while returning pieces back home?
This is fascinating because on the surface it seems very do-able but I bet the devil is in the details.
It seems the 50 move rule is probably older according to Wikipedia (1800s vs 1500s), which is kind of surprising to me, I would have expected the other way around. It's easier to keep track of "moves since last capture/pawn advance" than every board position played so far. Maybe just in theory not in practice. I am a terrible chess player.
Not so! Pawns move diagonally via capturing, which theoretically could allow white to promote all 8 pawns just in the d column, and black to promote all 8 in the e column (at the expense of various other pieces).
edit: of course, you'd run out of pieces first, but you can accomplish something similar by using multiple columns.
Sample game start that accomplishes a subset of this (2 pawns promoted from each side, 6 pawns remaining from each side):
1. Nf3 Nc6 2. Ng5 Nb4 3. Ne6 Nd3+ 4. exd3 dxe6 5. Ke2 Qd7 6. Kf3 Qc6+ 7. Kg3 e5 8. d4 e4 9. d5 e3 10. d6 e6 11. d7+ Ke7 12. d4 Kf6 13. d8=R e2 14. Rd5 e1=R 15. Ra5 Re5 16. d5 Rh5 17. d6 e5 18. d7 e4 19. d8=R e3 20. Rdd5 e2 21. Rdb5 e1=R
I think they all can.
If white’s A pawn takes a black piece in the B file and black’s B pawn takes a white piece in the A file, both white’s two B pawns and black’s two A pawns have a clear route to promotion.
You can do the same for files C and D, E and F, and G and H, at the cost of 8 taken pieces.
Of course, that “white’s A pawn takes a black piece” is wasteful in the sense that it is both a pawn move and a piece being taken, but I think it still is better than letting the pawns end up facing each other without being able to move more.
This paper concludes 17,697 moves. 50-move rule is not automatically applied per FIDE rules.
Then have these move through as many board permutations as possible without triple repetition. This would give a multinomial of (64 choose 36 1 3 3 3 2 2 1 3 3 3 2 2) ~ 4.6 x 10^41 positions to move through, which could be multiplied by 2 for side to move (over estimating a lot since many positions will have the wrong king in check, or the right king in impossible check) and another factor 2 for first repetition, giving roughly a 2e42 upper bound.
There's also the fivefold repetition rule, which draws the game automatically.
One could further simplify the search by abstracting away from the exact location of pawns, but recording only their color and order within each file.
Many of the 381 illegal positions can be proven illegal just by absence of such proof kernels.
Proof game kernels can also guide construction of full proof games.
http://talkchess.com/forum3/viewtopic.php?f=7&t=77685&p=9051...
[1] https://hackage.haskell.org/package/simple-enumeration-0.2/d...
[2] https://byorgey.wordpress.com/2019/07/05/lightweight-inverti...
http://www.nwchess.com/articles/misc/chessic_coincidence.htm
1. compact, in that it uses a relatively narrow range of numbers.
2. efficiently computable, in that you can quickly map numbers (or preferably, thousands of them) to positions, and back.
The combination of these is what allows for estimating the number of legal positions.
You're right that counting is much easier than ranking. That's reflected in my Haskell counting program [4] being MUCH simpler and MUCH faster than the ranking program. But counting is only good for upper bounding and doesn't let you draw a random sample to determine the fraction of legal ones, as needed for estimation.
[1] https://github.com/tromp/ChessPositionRanking/blob/main/src/...
[2] https://github.com/tromp/ChessPositionRanking/blob/main/src/...
[3] https://github.com/tromp/ChessPositionRanking/blob/main/src/...
[4] https://github.com/tromp/ChessPositionRanking/blob/main/src/...
I can imagine this project being of interest in the seminar of the right university department.
I don't think that this is true. I think that explicit enumerations are rarer than exact size computations, which are themselves rarer than asymptotic size estimations, for presumably obvious reasons; but a bijective proof (https://en.wikipedia.org/wiki/Bijective_proof) is still regarded as the gold standard in combinatorics, and as a desideratum.
Of course you can derive an enumeration by bijection to a set with an existing enumeration, but the point is that that's usually not of interest.
Obviously the former is more fun, since you feel like you scaled the summit when you determine the exact count in all its glory.
When you can only estimate, you cannot reach the summit, only reach a little higher than the previous explorer by spending much more effort on your estimation climb. I do feel some satisfaction in having established base camp though:-)
Maybe somewhere in between the enjoyment from the computable numbers of Go and chess. There is no estimation involved there. Although there are lower bounds.
The other difference being that it's a much more esoteric subject (on account of the prevalence of the Turing Machine based definition) with a much more limited audience.
It would be interesting to define parameters for a "good move" and see how many there are, though!