| ▲ | No reachable chess position with more than 218 moves(lichess.org) |
| 269 points by emporas 11 hours ago | 126 comments |
| |
|
| ▲ | codeulike 9 hours ago | parent | next [-] |
| They dont really spell it out but they mean "from this position the player has 218 possible legal moves to choose from" |
| |
| ▲ | stavros 5 hours ago | parent | next [-] | | Ah, wow, I read the article wrong all this time, thank you. I thought they meant "the maximum number of moves you can make to reach any chess position is 218", and I was wondering why the article made no sense to me. | | |
| ▲ | bscphil an hour ago | parent | next [-] | | I thought the same, but no doubt pawn promotion rules dramatically increase the depth needed to reach certain positions. | |
| ▲ | kelipso 3 hours ago | parent | prev [-] | | Is that weird? I feel like it’s plausible though. Very rare to have chess games with more than 200 moves. | | |
| ▲ | stavros 3 hours ago | parent | next [-] | | Yeah I kind of thought that it meant "you can get to any valid position in 218 moves max", it was hard to parse. | |
| ▲ | refulgentis 28 minutes ago | parent | prev [-] | | It’s also rare to have one with more than 50 moves. I’m curious if this class of observation will help establish a true bounds. Especially because we don’t have we don’t have a definition of what it means - my instinct is to first do that, so “infinity” isn’t the obvious upper bound. |
|
| |
| ▲ | wodenokoto 9 hours ago | parent | prev | next [-] | | I thought it was "How many moves in a game does it take to reach this position" | | |
| ▲ | winternewt 6 hours ago | parent | next [-] | | I thought it was "there's no position in chess that requires more than 218 moves to reach." | | |
| ▲ | unkulunkulu 6 hours ago | parent [-] | | I thought “there is no chess problem that is both reachable from starting position and requires more than 218 moves to solve” | | |
| ▲ | binarymax 5 hours ago | parent | next [-] | | There are no more than 218 ways to interpret this title | | |
| ▲ | fer 29 minutes ago | parent [-] | | It'll take at most 218 comments on HN to figure out the meaning of the submission title |
| |
| ▲ | leoff 3 hours ago | parent | prev [-] | | I seriously thought they meant "it's not possible to have a chess game with more than 218 moves" | | |
| ▲ | ojo-rojo 2 hours ago | parent [-] | | Yeah, I'm still confused. | | |
| ▲ | fwip 10 minutes ago | parent [-] | | There is no reachable[1] chess position[2] at which a player has more than 218 valid moves[3] to choose from. [1] Able to happen while following the rules of chess [2] The arrangement of chess pieces on the board [3] A valid move is the motion of one piece to a place on the board, which doesn't break the rules of chess - e.g: "King to E4." |
|
|
|
| |
| ▲ | coolness 9 hours ago | parent | prev | next [-] | | I also thought this but OP is right: https://dev.timenote.info/de/Nenad-Petrovic > In 1964 Petrović constructed a position with 218 possible moves for White. | |
| ▲ | jmkd 7 hours ago | parent | prev | next [-] | | Same, which also damages my personal policy of reading the link before any HN comments. | | |
| ▲ | stephenhumphrey 5 hours ago | parent [-] | | Huh. I also have that personal policy. Yet this time I jumped first to the comments before reading the article. I’m not certain why. Perhaps I subconsciously intuited that the ambiguity in the headline might be resolved by some of you smart people. Brains are weird; mine is, anyway. | | |
| ▲ | jl6 4 hours ago | parent [-] | | The right™ order is to check the comments before the article, but to read the article before commenting. |
|
| |
| ▲ | weinzierl 4 hours ago | parent | prev | next [-] | | But this an interesting problem too. More specifically is there an upper bound for the number of moves in a legal chess game? | | |
| ▲ | dmurray 4 hours ago | parent | next [-] | | I believe 8848.5 under modern rules (with the 75-move rule, as in FIDE rules since 2014). There's a reasonably rigorous demonstration here: https://wismuth.com/chess/longest-game.html | | |
| ▲ | LegionMammal978 4 hours ago | parent | next [-] | | Thanks for that link! I was looking for that answer a few years ago, but I couldn't find anyone who had carried it out all the way through (with the cost of "switching control" fully accounted for), nor many people who were even aware of the 75-move rule. | |
| ▲ | sim7c00 3 hours ago | parent | prev [-] | | how can the longest game have half a move??? | | |
| ▲ | pxx a minute ago | parent | next [-] | | An A press is an A press. You can't say it's only a half. | |
| ▲ | InitialLastName 3 hours ago | parent | prev [-] | | "Moves" are counted for both players. Half a move means White moved but Black hasn't yet. | | |
|
| |
| ▲ | unkulunkulu 4 hours ago | parent | prev | next [-] | | there certainly is if you consider 50 moves rule. And you can derive an easy upper bound from that as 50x8x8x2 (basically each 50 moves you make a pawn move) if you only consider 3 moves repetition and not 50 move rule then this is harder and the number becomes one of those crazy combinatorical numbers. | | |
| ▲ | CrazyStat 4 hours ago | parent | next [-] | | > And you can derive an easy upper bound from that as 50x8x8x2 (basically each 50 moves you make a pawn move) This is not high enough, because the 50 move rule also resets when a piece is captured. | | |
| ▲ | Certhas 13 minutes ago | parent [-] | | Actually no. 50×(16×6 + 32) = 50×(16× 8) works I think. Every 50 moves, move a pawn or capture. There are 16 pawns. Each pawn can be moved 6 times, so there are 16×6 pawn moves available. In addition there are 32 captures available. |
| |
| ▲ | jibal 4 hours ago | parent | prev | next [-] | | The 50 move rule is a rule of chess so it must be considered. The 3 repetition rule is an opportunity for one of the players to declare a draw, but games can continue beyond that. The mandatory draw rule is 5 repetitions. In any case, the 50 move rule is far more limiting as to the number of moves in a game, since repetitions are necessarily neither pawn moves nor captures (the whole point of the 50 move rule being limited to those is that they are irreversible). | |
| ▲ | Scarblac 2 hours ago | parent | prev [-] | | The 50 moves rule doesn't have be considered as it is optional. The players may claim, but they don't have to. So the game can continue. The 75 move rule is the exact same thing but mandatory. That has to be considered. (same thing is true for 5 times repetition vs 3 times). Captures also reset the counter, not only pawn moves. |
| |
| ▲ | kevindamm 4 hours ago | parent | prev [-] | | Not explicitly, but when you consider the "cannot repeat the same board layout three times" rule, the number of moves possible in a game does have a limit. | | |
| ▲ | jibal 4 hours ago | parent [-] | | The 3 repetition draw rule has no bearing on the number of possible chess positions. And for the number of possible moves in a game the 50 moves with no capture or pawn move rule is a much more stringent limit. BTW, the 3 repetition rule only comes into play is one of the players invokes it ... games can legally have more than 3 repetitions, but not more than 5 repetitions. | | |
| ▲ | kevindamm 3 hours ago | parent | next [-] | | I didn't know it required a player to invoke it, I was basing the statement on chess implementations I've read (and written) where it kicks in automatically... but the 5-time limit you mention still supports my case that there's an upper limit. As long as the number of pieces remains the same, there are a finite number of arrangements for them so eventually (after a finite number of moves) a position would be repeated enough times. If a piece is captured (or converted) it resets this but still yields a finite number of new arrangements. Eventually you either cannot avoid the repetition, or a win condition is met, or a draw for insufficient material. Compare this to, say, the L game, where the number of moves is unbounded. | | |
| ▲ | jibal 3 hours ago | parent [-] | | Your "case" that there's a limit isn't in question ... as I said, the 50 move rule is a far more stringent limitation. And those 50 moves cannot include repetitions--they are captures and pawn moves, which are irreversible. If you read my comment that you responded to carefully, you will find that it is precise and accurate--as I said, the repetition rule has no bearing on the number of positions. This horse is dead, so I'm moving on. |
| |
| ▲ | Scarblac 2 hours ago | parent | prev [-] | | The 50 moves rule also needs to be claimed by one of the players. However there is a 75 move rule and a 5 time repetition rule that are both automatic (don't need to be claimed). |
|
|
| |
| ▲ | brumar 5 hours ago | parent | prev [-] | | Same. I was astonished it was remotely possible to do this. | | |
| |
| ▲ | BrenBarn 7 hours ago | parent | prev | next [-] | | Yes, very strange that the phrase "possible moves" never occurs in the article. The key word is "possible". The article consistently just uses the phrasing "have moves" but this is not an obvious way of phrasing things to the average person (although I think it's more common in chess lingo). | | | |
| ▲ | arc-in-space 8 hours ago | parent | prev | next [-] | | Ah, thank you. I was confused reading this article, thinking it's about the unique position that takes the most moves to reach. | |
| ▲ | WithinReason 8 hours ago | parent | prev | next [-] | | Thanks, I misunderstood the entire article. Great writing! | | |
| ▲ | sverhagen 7 hours ago | parent [-] | | How can those two things be true at the same time? Unless you appreciate misunderstanding what you read...? | | |
| ▲ | burnished 5 hours ago | parent | next [-] | | What other reason would a person have for juxtaposing two statements? | |
| ▲ | Sharlin 2 hours ago | parent | prev [-] | | How could someone ever write something while intending to convey the exact opposite meaning? |
|
| |
| ▲ | amitparikh 7 hours ago | parent | prev | next [-] | | Right, and by "reachable" they mean it is theoretically possible to get to this board position through a normal (albeit obviously methodically chosen) series of moves. | |
| ▲ | aqme28 2 hours ago | parent | prev | next [-] | | I thought they meant that no game could go more than 218 moves. I can imagine some upper limit since three-fold repetition ends the game. But it’s a lot higher than 218. | | |
| ▲ | hibikir 2 hours ago | parent [-] | | Another relevant rule is a draw after 50 moves without a capture or a pawn move. But yes, the maximum number of moves would be extremely large when both players are trying. Just think of a first 2 moved allowing the king out, an outrageous king march, followed by another pawn move... |
| |
| ▲ | Agingcoder 5 hours ago | parent | prev | next [-] | | Yeah I gave up when I realized I didn’t understand what problem he was trying to solve | |
| ▲ | amenghra an hour ago | parent | prev | next [-] | | The confusion is perhaps caused by the word “reachable”. “No legal chess position with more than 218 possible moves” would have been more clear imho. | |
| ▲ | hx8 an hour ago | parent | prev | next [-] | | I had the same confusion, until they showed the existing 218 position and realized it was about maximizing white's legal moves. | |
| ▲ | amelius 7 hours ago | parent | prev | next [-] | | If only they had appended "to choose from" to the article headline, it would have been clear from the start. | | |
| ▲ | jibal 3 hours ago | parent [-] | | The caption on the first position is "Reachable chess position with 218 moves for White, published by Petrović in 1964." And the title is unambiguous: "There is no reachable chess position with more than 218 moves" -- that cannot possibly mean "There is no reachable chess position that it takes more than 218 moves to reach". Also, lichess is a chess site, where people are certain to know that chess games can go way beyond 218 moves. |
| |
| ▲ | nabla9 7 hours ago | parent | prev | next [-] | | It should be obvious that there are no 8.7 × 10^45 possible chess moves from any chess position.
All pieces have less than 32 moves per piece and 19 pieces means less than 608 moves. | | |
| ▲ | electroly 7 hours ago | parent [-] | | No, they do mean possible moves and they don't mean maximum length game. There are on the order of 10^45 reachable chess positions. The article did not say that was the number of moves from one position. The article says 218 is the maximum number of moves from one reachable position--it's the whole point of the article! | | |
| |
| ▲ | davedx 7 hours ago | parent | prev [-] | | But black has no king, so surely the game is over and there are no more legal moves? Why does black have two pawns but no king? I don’t understand any of this | | |
| ▲ | electroly 7 hours ago | parent [-] | | Every board on the page, with the exception of the illegal "all queens" board, has a black king. The king is the one with the cross above the crown. In the first board, the 218 winner, it's at A1. | | |
| ▲ | davedx 7 hours ago | parent [-] | | The first image, which I assume is the solution because the title is 'Reachable chess position with 218 moves for White, published by Petrović in 1964.', has no black king? | | |
| ▲ | electroly 7 hours ago | parent [-] | | Look again. It's at A1. You may be confusing that symbol with a different piece. | | |
| ▲ | davedx 5 hours ago | parent [-] | | Ugh. Sigh, I see it now - I thought that was the white king, because it has quite some white in it. I will allocate 50% blame to my brain and eyes, and 50% to whoever designed a black king to have so much white in it :P Thanks! | | |
| ▲ | jibal 3 hours ago | parent [-] | | No, it's 100% on you. If the piece on a1 is a white king, then what's the piece on f1? And why would there be no black king, when the subject is reachable (and thus legal) positions? |
|
|
|
|
|
|
|
| ▲ | NickC25 3 hours ago | parent | prev | next [-] |
| Just want to give Lichess a shoutout here. They are fantastic, provide great content, have things for free that you need to pay for on Chess.com, and a fantastic amount of variants. Even better, the level of play in those variants, like 960 or Crazyhouse, is MUCH higher on Lichess than on Chess.com. |
| |
| ▲ | qsort 2 hours ago | parent [-] | | It's free, it has the same features as commercial servers, it's open source, developer-friendly, with no ads (not even on free accounts) and a transparent corporate structure under French law. It's almost ridiculously good. Donate if you can! |
|
|
| ▲ | dbatten 3 hours ago | parent | prev | next [-] |
| Genuinely interested in being educated here: If Gurobi's integer programming solver didn't find a solution better than 218, is that a guarantee that there exists no solution better than 218? Is it equivalent to a mathematical proof? (Let's assume, for the sake of argument, that there's no bugs in Gurobi's solver and no bugs in the author's implementation of the problem for Gurobi to solve.) I guess I'm basically asking whether it's possible that Gurobi got trapped in a local maximum, or whether this can be considered a definitive universal solution. |
| |
| ▲ | gregdeon 31 minutes ago | parent | next [-] | | I'm not sure about Gurobi or how the author used it in this case. But in general, yes: these combinatorial solvers construct proof trees showing that, no matter how you assign the variables, you can't find a better solution. In simpler cases you can literally inspect the proof tree and check how it's reached a contradiction. I imagine the proof tree from this article would be an obscenely large object, but in principle you could inspect it here too. | |
| ▲ | salt4034 2 hours ago | parent | prev | next [-] | | In addition to the value of the best integer solution found so far, Gurobi also provides a bound on the value of the best possible solution, computed using the linear relaxation of the problem, cutting planes and other techniques. So, assuming there are no bugs in the solver, this is truly the optimal solution. | | |
| ▲ | dbatten 2 hours ago | parent [-] | | Unless I missed something, though, the highest bound the author reported for the relaxation was 271 2/3 moves, which is obviously significantly higher than 218... | | |
| ▲ | salt4034 2 hours ago | parent [-] | | I think that was an intermediate model. The author updated it, then Gurobi solved the new model to optimality (i.e., the bound became equal to the value of the best solution found). > With this improved model, I tried again and after ~23 000 seconds, Gurobi solved it to optimality! | | |
| ▲ | dbatten an hour ago | parent [-] | | > Gurobi solved the new model to optimality (i.e., the bound became equal to the value of the best solution found). Ah, I was not aware that that's what this language indicated. Thanks for helping me understand more! I've used Gurobi (and other solvers) in the past, but always in situations where we just needed to find a solution that was way better than what we were going to find with, say, a heuristic... I've never needed to find a provably optimal solution... |
|
|
| |
| ▲ | nhumrich 2 hours ago | parent | prev [-] | | In theory, it's not proof. In practice, it is. | | |
| ▲ | sigbottle 2 hours ago | parent [-] | | Well, if the solver isn't wrong and there were no bugs in impl, yes, the approach is rigorous. Allow strictly more "powerful" configurations yet still prove that the maximum is X, then achieve X through a construction, is standard math |
|
|
|
| ▲ | eru 9 hours ago | parent | prev | next [-] |
| https://lichess.org/@/Tobs40/blog/there-is-no-reachable-ches... describes how the author removed some more complicated rules in the first pass, and is willing to re-introduce them, if necessary. Ie if the solution found violates them. Interestingly, mixed integer linear programming solvers already support these. The technical term for this is 'row generation'. It comes from the usually way these problems are written in matrix form, where rows correspond to constraints and columns correspond to variables. (Dynamically) adding a row is equivalent to introducing a constraint only if it's violated. This approach is often used for the traveling salesman problem. (Weirdly enough, Wikipedia has https://en.wikipedia.org/wiki/Column_generation but nothing on row generation.) |
| |
| ▲ | salt4034 2 hours ago | parent | next [-] | | The most commonly used term for this is lazy constraints (https://support.gurobi.com/hc/en-us/articles/360013197972-Ho...). | |
| ▲ | LeGrosDadai 9 hours ago | parent | prev [-] | | I'm quite curious to see if the MILP solver would terminate (given the massive search space), my guess is not. | | |
| ▲ | eru 7 hours ago | parent [-] | | Well, my point is that you can encode the tricks described in the linked article directly in a modern MILP solver in a way that is legible to the solver. We'd expect similar behaviour in that case, or perhaps slightly better, because the solver can 'see' them better. Yes, if you do a naive programme only, it would be a massive search space. |
|
|
|
| ▲ | tromp 8 hours ago | parent | prev | next [-] |
| > There is no reachable chess position with more than 218 moves. "no more than 218 possible next moves" would be a lot clearer... > By checking all approximately 8.7x10^45 reachable chess positions? That's a large overestimate. https://github.com/tromp/ChessPositionRanking accurately estimates the number of legal chess positions at ~4.8x10^44. |
| |
| ▲ | XCSme 6 hours ago | parent | next [-] | | Isn't that estimate just 20x bigger? Which is not a big difference considering the magnitude. | |
| ▲ | nhumrich 2 hours ago | parent | prev [-] | | One is "legal" the other is "total problem space"
From a computing point of view, the total problem space is what matter because you still have to "compute" if it's legal or not before moving on. There isn't a straightforward way to only iterate over legal positions. |
|
|
| ▲ | amelius 7 hours ago | parent | prev | next [-] |
| What is the least number of bits that can describe any reachable chess board? update: article says there are approximately 8.7x10^45 reachable chess positions and https://github.com/lechmazur/ChessCounter says this is an upper bound. (this would correspond to about 153 bits) |
| |
| ▲ | jcranmer an hour ago | parent | next [-] | | The king can reach any of 64 tiles. Rooks, queens, and knights can also do so, but they can also be captured, so 65 states for those 5 pieces. Bishops can only reach half of those tiles, so those two pieces get 33 states each. Pawns are interesting: they can promote into 4 pieces that each can move 64 tiles, they can be captured, or they can move into a somewhat variable number but 20-30ish positions as a pawn, or about 290 states per pawn. This means it takes 111.something bits to represent the board position of a color, or rounding up, 224 bits to represent the board positions of both black and white. En passant and castling restrictions don't add to the bit representations once you round up, since that's just 1 extra state for several pieces. That's probably the most compact representation for a fixed-size direct board representation. For a sparse representation, note that both kings have to exist, so you can represent the live pieces with a base-10 number of n digits with n + 2 64-bit numbers representing piece position, and a little bit extra information for castling and en passant legality. If half the pieces are gone (a guesstimate for average number of pieces on the board), that amounts to about 180 bits for a board representation. Move history requires about 10 bits per move (pair of white/black turns, with a ply of around 32 = 5 bits), which means you get to 18 moves, which appears to be somewhat shorter than the halfway point of an average chess game. To be honest, it looks to me like getting more compact than the upper hundreds will require building impossibly large dictionaries. | |
| ▲ | tromp 6 hours ago | parent | prev | next [-] | | That's ceil(log2(~4.8x10^44)) = 149 bits. But to make it efficiently decodable you'd use the ceil(log2(8726713169886222032347729969256422370854716254)) = 153 bit representation of the ChessPositionRanking project linked to in my other comment. The ChessCounter project does not provide an efficiently decodable code. | |
| ▲ | cabirum 6 hours ago | parent | prev | next [-] | | Piece type and color fit in 4 bits. So, either a fixed-length encoding of the whole board, 64 * (4 bits) = 256 bits = 32 bytes. Or, sparse variable length encoding of pieces only, 6 bits to index each of 64 squares, = 10 bits * piece count. E.g. initial position takes 32*10 = 320 bits or 40 bytes. | | |
| ▲ | mcherm 6 hours ago | parent [-] | | That's a fine upper bound, but it doesn't minimize but usage since it also can represent illegal positions. | | |
| ▲ | mormegil an hour ago | parent | next [-] | | While this is an upper bound for a "board position", it should be noted that it is not an upper bound for a "game state". That includes the (unbounded) whole board position history because of the threefold repetition rule. If you ignore that (and the fifty-move rule which can alternatively be kept using a six-bit counter), you also need the castling state and the en passant state.
Plus one bit of the player on move, obviously :-) | |
| ▲ | jfengel 2 hours ago | parent | prev [-] | | The vast majority of the positions are illegal. There is only 1 black king on the board; practically all of the represented positions have more than one. And there are over a dozen kinds of pieces to repeat that for. A better upper bound is almost 100 orders of magnitude smaller. |
|
| |
| ▲ | LegionMammal978 2 hours ago | parent | prev [-] | | The 8.7e45 "restricted" number in that repo rules out certain patterns of pawn promotions. It looks like the 5.68e50 "general" number is the true upper bound, allowing any promotions possible. |
|
|
| ▲ | tromp 2 hours ago | parent | prev | next [-] |
| Meanwhile, for the game of Go, as played on a standard 19x19 board, we have: The maximum number of possible next moves is 361, which happens only in the initial empty position. The 361 hardest-to-reach positions (assuming logical rules like [2]) are all the positions with 360 white stones and 1 empty point. these take 2*361 = 722 ply to reach, with black passing all their turns. And these answers were found without checking all 208168199381979984699478633344862770286522453884530548425639456820927419612738015378525648451698519643907259916015628128546089888314427129715319317557736620397247064840935 legal positions :-) [1] [1] https://tromp.github.io/go/legal.html [2] https://tromp.github.io/go.html |
| |
| ▲ | mtremsal 2 hours ago | parent | next [-] | | Then white plays 1 stone, capturing all the black stones at once, essentially resetting the game with a 360 points lead. (black goes first, white has Komi, so really a 260+komi points lead) | | |
| ▲ | tromp 2 hours ago | parent [-] | | White cannot play on the last empty point as this would be suicide, which is prevented by the (assumed) superko rule forbidding repetition of the empty position. |
| |
| ▲ | GabrielBen 2 hours ago | parent | prev [-] | | A game of Go can be legally infinite due to recaptures. (player passes 360 times, then eats the entire board and it starts over). It's also a natural infinite game due to Kos which can be the best move to play. This requires a set of extra rules to prevent. (Ko, superKo, triple kos, etc) | | |
| ▲ | tromp 2 hours ago | parent [-] | | I assume superko as is standard in several rulesets to prevent infinite play. |
|
|
|
| ▲ | jobigoud 3 hours ago | parent | prev | next [-] |
| The black pawn on b2 is eating a lot of possible moves for the other pieces… It has only one legal move, take the Knight on c1. If that pawn wasn't there it would free that square for 4 white queens and a Knight. But of course the black king would already be in checkmate so these moves wouldn't really be available. Tempting to put that e5 Queen elsewhere so that it doesn't immediately checkmate and leave the b2 square available for others. edit: I imagine that pawn also needs to survive that far in order to avoid a stalemate. |
| |
| ▲ | tromp 3 hours ago | parent | next [-] | | The black b2 pawn has no moves in the position with white to move.
If it were black's move, it would still have no moves since it is pinned by the white queen on e5. If it were not pinned it would have 4 moves, as it can also underpromote. | |
| ▲ | Scarblac 2 hours ago | parent | prev [-] | | It's white to move. If black is in check with white to move, that makes the position illegal, and unreachable -- there's no possible legal move by black that led to this position where he is in check. Replacing one of the black pawns by a white knight would add some moves, but there is no budget for that -- both knights are already on the board, and all pawns were promoted to queens. (And replacing both pawns would again make it impossible for black to have made the previous move) |
|
|
| ▲ | dooglius 3 hours ago | parent | prev | next [-] |
| I'm confused, what did he change after the 271-move model to get it to produce the optimal solutions? It just says "With this improved model"... |
|
| ▲ | isagues an hour ago | parent | prev | next [-] |
| > I inserted this picture for the sole purpose of making this article look less text-heavy. Taking care of the short attention span readers |
|
| ▲ | margalabargala 7 hours ago | parent | prev | next [-] |
| Am I missing something, or is the configuration shown initially not actually reachable? It's white to move, yet the black pawns are in their starting location and the black king has no adjacent empty square, it's entombed by its pawns and the white bishop so the configuration could not have been reached. |
| |
| ▲ | Eji1700 7 hours ago | parent | next [-] | | Proof is provided here for one of them: https://lichess.org/study/PLtuv3v5/zWPNxbSA To be clear you're misunderstanding the position though. Black pawns are NOT in starting position. They've moved all the way across the board. Those are white pawn starting positions. | | | |
| ▲ | jibal 3 hours ago | parent | prev | next [-] | | Black pawns start on the 7th rank, not the 2nd rank. Here's a general rule of thumb: If the options are a) you're not missing something and the article in question is absurdly wrong and stupid but no one else is saying so, and b) you're missing something Assume (b) and put all your effort into figuring out what. | | |
| ▲ | margalabargala an hour ago | parent [-] | | Thanks for the condescension. It really helps me file your comment's suggestions appropriately. Here's a general rule of thumb: If the options are a) answer someone's question, and b) answer someone's question but also then spend triple the word count telling them it was a stupid question Then picking (b) makes you an asshole. If all you had written was your first sentence this could have been a pleasant interaction for us both. |
| |
| ▲ | KK7NIL 7 hours ago | parent | prev [-] | | The black pawns are on white's side of the board. | | |
|
|
| ▲ | kryptiskt 9 hours ago | parent | prev | next [-] |
| Now I wonder how Nenad Petrović and Jenő Bán came up with the optimal solutions to the problems in the 60s. |
| |
| ▲ | somenameforme 7 hours ago | parent | next [-] | | Probably by just thinking about it and working to incrementally improve their answers. I'd expect plenty of people solved it before them but never published or publicized their solution. It's quite logical in many ways. For instance just thinking about the problem abstractly: - You can only have 9 queens and they're going to want to be as centrally placed as possible with as little overlap as possible. - The black king will need to be tucked in a corner and covered by a minimum of his pieces and nonchecking pieces of your own. - All your other pieces, if useable, will probably end up on the edge of the board since minimizing the number of squares they block is likely to be more impactful than maximizing the number of squares they cover. There's probably other heuristics I'm not considering, but just with those 3 you're already well on your way to the solution. So you'd lay out the pieces, and then try to find a way to do it one move better, and iterate! The concerns I'd have: pawn promotion can complicate things dramatically. Pawns can promote to 4 different pieces which would technically be 4 different moves. And a pawn can have up to 3 different paths to promote - so that's 12 possible moves tucked in a very tiny space. And then king placement - castling can add up to 2 more moves, and so compensating for that (and the corresponding rook position) adds some complexity. | |
| ▲ | Eji1700 7 hours ago | parent | prev [-] | | Glancing at it a chess players first instinct looks to be the "solution". Assume all pawns are queens, then maximize queen moves, work backwards from there. Couple of other "obvious" assumptions such as minimal black pieces, which means shoving the king in a corner but somehow not in check, Rooks cover the next largest amount of space so they're going in corners, bishops will be mirrored, etc. Not to say it isn't still impressive, but I always wonder how many "sane" positions there are for solving a puzzle like this in the first place. The paper quotes some huge number and someone else says it's a smaller, but still massive, number, but when you look at the stated goal and start from some obvious starting points, start working out rules (obviously 4 queens right in the middle blocks other queens and costs space), and eliminate symmetrical positions, well you're left with a decently solvable problem. At least compared to the kind of shit that's usually brute force solved. Edit: This is actually a fun one to think about for a bit the more I look at it. It quickly becomes apparent that your basically getting 7 moves out a of a rank/column MAX, so you maximize for that first. It quickly becomes apparent that the knights L move shape is also the optimal way to start tiling your 9 queens to maximize for squares taken. As I said before the black position obviously has to be the dead minimum, and it makes sense that'd be a king and 2 pawns due to various end game stuff (basically impossible to prevent the king from being in check otherwise while taking up as much space as possible). Once you know you're doing that with the black king you'll want to "block" the remaining space with pieces that can't threaten it, so you shove a bishop adjacent (which can still take the pawn), and figure you're going to mirror that bishop because that's kinda how bishop's work in play/mathematically. It's actually quite neat to see how each step sorta leads you to the next one, like one of those metal puzzles or the sudoku's with unique rules and only 1 or 2 starting numbers. Still i'm positive if I hadn't seen this picture first I probably NEVER would've gotten this answer correct, but I do think i would've come closer than I ever expected. Edit 2: Ahh i do see they have at least one or two solutions that are 218 where there's only 2 black pieces. I'm somewhat surprised that's a possible legal position but so be it. Interesting that still leads to the same net realestate. Thats the one area i'd expect to gain something if you could cheat. |
|
|
| ▲ | pmontra 7 hours ago | parent | prev | next [-] |
| How can a position with more than 9 white queens be legal? The limit seems to be one queen plus 8 promoted pawns. |
| |
| ▲ | tromp 5 hours ago | parent | next [-] | | The phrasing "Legal but non-reachable " makes clear that they use some notion of legal that differs from the normal one of reachability.
It's hard to imagine what sensible notion that could be though.
Something like: each side having only one king, no pawns on first/last row, at most one king in check, etc ?! | |
| ▲ | codeulike 7 hours ago | parent | prev [-] | | There are only 9 queens on the board | | |
| ▲ | pmontra 6 hours ago | parent [-] | | The caption of the last diagram is "Legal but non-reachable position with 271 moves for White. Corner queens can be replaced with bishops." There are 24 white queens. | | |
| ▲ | contravariant 6 hours ago | parent | next [-] | | That's the difference between illegal an unreachable. To reach that position you'd need to start from a different point (start both sides with 16 pawns or w/e), but you wouldn't need to break any other chess rules. | | |
| ▲ | systoll 3 hours ago | parent [-] | | If you can start from any arbitrary different point, you can just start from the point you’re intending to reach, and don't need to break any other rules. As per FIDE rule 3.10.3 "A position is illegal when it cannot have been reached by any series of legal moves". The position isn't legal per FIDE rules. Beyond there being too many queens… black could not possibly have made the last move. For white to have any moves right now, the last move must have been black moving the king to H8. But G8, G7, H7 are all occupied, so where could the King have moved from? | | |
| ▲ | zuminator an hour ago | parent [-] | | Legality is a long standing term of art used by chess problem creators. Essentially it means a position withtwo kings on the board, non touching, and not both in check. And no pawns on first or eighth ranks. It has nothing to do with whether the position is reachable from standard chess rules. Along came FIDE in 1999 with its standardized nomenclature but that doesn't invalidate the terminology used by chess problem creators in their own work. |
|
| |
| ▲ | Bootvis 6 hours ago | parent | prev [-] | | I understand this as follows: Legal: doesn’t break the rules of chess. For example: no pawns on the eighth rank or in check when it’s not their turn. Reachable: there is a series of moves that lead to this position from the standard starting position. |
|
|
|
|
| ▲ | a3w 6 hours ago | parent | prev | next [-] |
| Blue is of course the color of math, his primary school is doing it wrong. |
|
| ▲ | p_zuckerman 6 hours ago | parent | prev | next [-] |
| Great article! Thanks for sharing |
|
| ▲ | renewiltord 8 hours ago | parent | prev | next [-] |
| This is pretty cool. Would have been neat to see some descriptive text about encoding to integer programming problem. |
|
| ▲ | TZubiri 8 hours ago | parent | prev | next [-] |
| I'm not sure but I think the original utility and motivation for this mathematical puzzle is how to represent possible legal moves when programming chess, and this would be evidence that an 8bit unsigned integer is sufficient for the worst case scenario, although you would need some complex kind of encoding mechanism to make the representation terse enough to represent the common moves along with 7 promoted queens in the same 256-moves space. Practically I think I'll stay with a fixed-length encoding for each of the starting pieces and their movements assuming maximum freedom, while adding a variable length variable in case of promotions. Although nowadays with OOP and classes and superfast CPUs you probably have entirely variable length encodings, you know, an array of piece objects each with their own legal_moves function. But back in the day, when chess engines were written in C, these things were managed globally with all kinds of hack to save space, not due to space reasons, but to improve locality by reducing cache sizes. For example, even though the chess board is 8x8, a common trick is to make the board 12x12 to account for knight moves that go off the board (and mark them as ilegal of course.) Which goes to show that even with efficiency as the upmost consideration, a terse representation is not ideal, so I doubt we are going to see 8bit variables to represent moves. |
| |
| ▲ | Scarblac an hour ago | parent [-] | | > although you would need some complex kind of encoding mechanism to make the representation terse enough to represent the common moves along with 7 promoted queens in the same 256-moves space. If you have an algorithm for generating the list of legal moves in a position that always generates them in the same order, you can just use the index at which the move is in the list. Of course that would come at the cost of speed (you always need to generate that list to know what move was made is meant). |
|
|
| ▲ | reader9274 9 hours ago | parent | prev [-] |
| Isn't the very first move of any chess game a reachable chess position with more than 218 moves? |
| |
| ▲ | electroly 9 hours ago | parent | next [-] | | Maybe one of us is misunderstanding, but aren't there far fewer than 218 on the first move? The position in the article needed nine unobstructed queens to achieve 218 possible moves. For the first move, I think we could just enumerate the moves by hand, right? Eight pawns can move one or two spaces, that's 16 moves. The two knights have two moves, that's 4. Nothing else can move, can it? That's only 20 moves. EDIT: I think I understand the confusion. A "move" in this case is a legal possibility for white's next turn. It's not talking about the number of moves in the game, but rather the number of legal choices for white in a single turn. | |
| ▲ | clintonc 9 hours ago | parent | prev | next [-] | | The initial board position is certainly reachable (and reached in every game!), but there are only 20 legal moves available: the 16 legal pawn moves for White, and the 4 legal knight moves for White. | | | |
| ▲ | reed1234 9 hours ago | parent | prev | next [-] | | It’s not 218 possibilities it’s 218 moves. | |
| ▲ | jibal 3 hours ago | parent | prev [-] | | No, there are only 20 moves in the initial position. |
|