tromp / ChessPositionRanking

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

1NRN4/1R1r3P/2n1n3/P2q3K/1b1qP3/7Q/1QnNkn1r/q1r1bb1n w - - 0 1 #15

Closed tromp closed 3 years ago

tromp commented 3 years ago

1NRN4/1R1r3P/2n1n3/P2q3K/1b1qP3/7Q/1QnNkn1r/q1r1bb1n w - - 0 1

img

Single Check wx 5 wp 3 wpr 2 wpx 3 maxuwp 5 minopp -2 bx 1 bp 0 bpr 7 bpx 1 maxubp 2 minopp -2

kevinquinnyo commented 3 years ago

edit One or more white pawns could have moved out of the way of files via captures. So my analysis below is not valid. Very tricky problems.

Illegal. Black promoted 7 times but only captured 1 piece. In order for this to be possible, one of a, e, or h white pawns would have to be deleted from the board and black would have to have minimum 2 captures. The one capture from black would allow transferring a file, but that only allows for 6 promotions, not the required 7.

First attempt. Sorry if I'm way off here.

Question: is it true to say that:

if (promotion_count - captures) > (8 - opponent_pawn_blocked_file):
  # illegal?

(opponent_pawn_blocked_file isn't just opponent_pawn_count, because they could have doubled pawns, etc)

tromp commented 3 years ago

Black captured 5 white men (wx = 5), not "only 1 piece". Capturing 3 white pawns, e.g. axb, cxd, exf, allows 6 black promotions and capturing white bishops allows more. What do you mean by promotion_count and captures? For one color, as in wpr - wx, or wpr - bx ?

The constraint we have is that wpr <= wx+bx + bpx, and similarly for bpr. And maxuwp = wx+bx + bpx - wpr, i.e. the slack in that equation. Finally, minopp, the minimum number of opposed pawns, >= wp - maxuwp.

The position looks quite legal to me...

kevinquinnyo commented 3 years ago

Black captured 5 white men (wx = 5), not "only 1 piece". Capturing 3 white pawns, e.g. axb, cxd, exf, allows 6 black promotions and capturing white bishops allows more. What do you mean by promotion_count and captures? For one color, as in wpr - wx, or wpr - bx ?

The constraint we have is that wpr <= wx+bx + bpx, and similarly for bpr. And maxuwp = wx+bx + bpx - wpr, i.e. the slack in that equation. Finally, minopp, the minimum number of opposed pawns, >= wp - maxuwp.

The position looks quite legal to me...

Yes I edited my answer once I realized I was wrong, but I was also misinterpreting the stats you provide so thanks for clearing that up. I might take another stab at this now that I have a better understanding.

petsuter commented 3 years ago
  1. h4 h5 2. g4 g5 3. f4 f5 4. e4 e5 5. d4 d5 6. c4 c5 7. b4 b5 8. a4 a5 9. Be3 hxg4 10. h5 axb4 11. a5 exf4 12. cxd5 fxe3 13. h6 e2 14. h7 exf1=N 15. Kf2 b3 16. d6 b2 17. Nd2 b1=N 18. d5 Kf7 19. d7 Qb6 20. d8=N+ Kf6 21. Nc6 Nd7 22. Nb8 b4 23. Qc2 b3 24. d6 Ne5 25. d7 Nc6 26. d8=Q+ Ke5 27. Ne2 Nh6 28. Nd4 Rg8 29. Ne6 Rg7 30. Qdd3 Ba6 31. Nd8 Raa7 32. Ra4 Raf7 33. Rd4 b2 34. Rd7 Na3 35. Rb7 b1=Q 36. Rc7 f4 37. Rc8 g3+ 38. Kf3 c4 39. Rh5 Ng4 40. Rh6 Nf2 41. Rd6 Nh1 42. Kg4 g2 43. Kh5 g1=B 44. Qh3 Bf2 45. Rd7 Be1 46. Rb7 Qa1 47. Qb2+ c3 48. Qb1 Kd4 49. Qb2 Nfg3+ 50. Kh6 Bf1 51. Qh4 Ke3 52. Qh3 Ke2 53. Qh4 Nf2 54. Qh3 Ngh1 55. Qh4 Rd7 56. Qh3 Rd3 57. Qh4 Rh3 58. Qc2 Rh2 59. Qb2 Bb4 60. Qh3 Rd7 61. Kh5 g4 62. Qh4 Qd4 63. Qh3 g3 64. Qh4 g2 65. Qh3 Nc2 66. Qh4 g1=N 67. Qh3 Nf3 68. Qh4 Ng5 69. Qh3 Ne6 70. Qh4 Na3 71. Qh3 c2 72. Qh4 c1=R 73. Qh3 Nc2 74. Qh4 f3 75. Qh3 Ng4 76. Qh4 Bg2 77. Qh3 f2 78. Qh4 f1=Q 79. Qh3 Qff2 80. Qh4 Bf1 81. Qh3 Qfe3 82. Qh4 Ngf2 83. Qh3 Qb3 84. Qh4 Qbc4 85. Qh3 Qcd5+
tromp commented 3 years ago

Verified. Thanks, Peter!