tromp / ChessPositionRanking

Software suite for ranking chess positions and accurately estimating the number of legal chess positions
MIT License
136 stars 7 forks source link

2K1Q2b/P2P1PnP/1N1PR3/B1nq1BPr/1n4b1/3n1b1N/4RR2/1N1krb2 b - - 0 1 #912

Closed tromp closed 3 years ago

tromp commented 3 years ago

2K1Q2b/P2P1PnP/1N1PR3/B1nq1BPr/1n4b1/3n1b1N/4RR2/1N1krb2 b - - 0 1

img

No Checks wx 0 wp 6 wpr 2 wpx 0 maxuwp 6 minopp 0 bx 4 bp 0 bpr 4 bpx 4 maxubp 0 minopp 0

ruedigerj commented 3 years ago

4 black pawns were promoted. Since no white piece was captured, all 4 pawns moved straight to their promotion square. So the opposite white pawns must mave cleared the way by capturing a black pawn and thus opening their file. This must have happened for the b, c and e pawns. But since we still have white pawns on the f, g and h file, one of these pawns must have captured twice to open temporarily a fourth file. But this would mean we have 5 captures and therefore we can conclude that this position is illegal.

tromp commented 3 years ago

Thanks for the analysis, which is correct. When both colors have number of existing or possible promotions equal to number of captures + number of opponent pawns captured, then there is no slack and every pawn captured is just to allow the remaining 3 pawns on the 2 files to promote, while every piece capture is by a pawn to make that pawn and its former opposing pawn free to promote. Having unopposed pawns of one color left on 3 adjacent files is inconsistent with that. Or as issue 909 puts it: Illegal since getting 12 possible promotions from 4 captured black pawns requires white doubling pawns in each of a&b, c&d, e&f, and f&g file-pairs.