Chess puzzle I found in my dad's old book(ardoedo.it) |
Chess puzzle I found in my dad's old book(ardoedo.it) |
Should maybe update the instructions to clarify that the dark-squared bishop is not constrained to dark squares.
sorry, "The task is to place four black queens and one black bishop on the chessboard" is not at all ambiguous.
where did you read "dark-squared"?
My friend code on BadukPop is EGVNY if anyone wants to play together!
........
...Q....
........
........
.....Q..
........
........
Q..B..Q.
Q.......
........
........
........
..QQB..Q
........
........
........
My original intuition was to place the queens on unique rows and columns to cover as much as possible but it turns out there are solutions with three of them on the same row.Python script: https://gist.github.com/dllu/698d5f71b2b9735c5c462ddf4a2f6fc...
Here's how it works:
0. precompute the attack patterns of each possible queen/bishop location as a bitmask, stored as an integer
1. generate candidate solutions, allowing attack rays to pass through other pieces, by brute forcing the positions of the 5 pieces and taking the bitwise OR of their attacks
2. out of the candidate solutions, check which ones are actually valid taking into account occlusion. Actually, you only need to check if the queen's horizontal attack is blocked by the bishop, as queens cannot block each other (the blocking queen herself has the same attacks so they effectively pass through each other).
........
Q..B..Q.
........
........
.......Q
........
........
...Q....
Where the bishop lies at the intersection of three queens' horizontal attacks. With these queens, no other bishop placement works.After identifying solutions up to rotation and reflection there are only 49 solutions. No solutions have rotational symmetry, and there is exactly one solution with reflection symmetry (already mentioned by an earlier commenter).
Out of the 49 solution classes, there are 18 distinct queen layouts. The layouts have between 1 and 5 ways to place the bishop to complete the solution. Interestingly, there is exactly one queen layout (up to rotation / reflection) for which there are exactly 2 ways to place the bishop to complete the puzzle.
..N.....
........
........
....Q...
.....Q..
...Q....
......Q.
........
Edit: even more fun facts: if we take the standard piece values of Q=9, R=5, B/N=3, then we can ask for the smallest piece budget that attacks every square. The cheapest possible configuration is 24 points, you can see one with 8 bishops: ........
....B...
....B...
.B......
...B.B..
.....B..
..B.....
....B...
Which has pleasing symmetry when you view it as a composition of light-square bishops and dark-square bishops.That got me down to 6 free spaces.
const solution = {
a8: "b1",
b8: "q1",
f7: "q2",
a4: "q3",
e3: "q4"
};
It would be cool if it randomly selected one of those 388, so you could click repeatedly and develop an intuition for what kinds of distributions were a valid solution.That last word should be "check". not "checkmate". A king next to an unprotected queen will be in check but not checkmate as it can capture the queen.
The key was realizing the proximal spaces next to the placed queen are the most important to cover. Forget about trying to have a long reach, it comes naturally.
In fact, there isn’t really a need for two colors. Just color the squares that are threatened by the pieces and leave the rest blank. The meaning will be obvious.
I think this is a bit ambiguous and, strictly speaking, wrong for the solution as given.
In particular, this asks for the king to be in check _mate_. Does this require all black pieces to defend each other? Otherwise, white king on the board would not be in checkmate if you place it next to a queen and can immediately capture.
From the solution, you can see it's not a checkmate requirement, just a check requirement.
. . . . . . . .
. . . . . . . Q
. . B . . . . .
. . . . . Q . .
. . . . . . . .
. . . Q . . . .
. . . . . . . .
. Q . . . . . . . B . . . . . .
. . . . . . Q .
. . . B . . . .
Q . . . . . . .
. . . . . B . .
. . Q . . . . .
. . . . . . . B
. . . . Q . . .I remember being given another puzzle in my childhood, where the task was to put 8 queens on the board and none of them should "see" each other. Wonder how many solutions exist for that one..
ETA: Apparently it's a classic puzzle, and there are 92 solutions - https://en.wikipedia.org/wiki/Eight_queens_puzzle
Bonus problem: find an arrangement of 4 queens on the board such that:
1. There is exactly 1 square on which a bishop can be placed, such that the 4 queens and the bishop attack all unoccupied squares
AND
2. There is exactly 1 square on which a rook can be placed, such that the 4 queens and the rook attack all unoccupied squares
Amazingly, modulo rotation / reflection, this problem has exactly 1 solution.
I didn’t find it that difficult. A good (?) guess is that the queens would be in (rotational) symmetry, and hence form a square. To maximize coverage, the angle of course is neither 90° nor 45°, and the queens will have a minimum distance of 3 from each other. Going from smallest distance possible between queens to largest, one tries (3, 1), (3, 2), (4, 1), done. One might not notice that (4, 1) works (which happened to me), because it only works when the square is at the edge of the playing field. But the next one, (4, 2), works unconditionally. Or going from largest to smallest, one tries (6, 1), (5, 2), (5, 1), (4, 3), (4, 2), done.
Also a click on a square could auto place a queen and a second click would swap to the bishop. Every click could auto-check.
A separate discovery mode could start blocking out the squares visually as you place pieces. For a lot of people, that would be easier than the mental representation.
- ChatGPT was able to solve it in 6 seconds.
- Opus exhausted my entire days token limit on the problem & didn’t solve it.
> In other words, after arranging the five black pieces, it must be impossible to place the white king anywhere without it being in checkmate.
These two sentences mean very different things in the normal rules of chess. And if you replace the word “checkmate” with the word “check” in the second sentence it still doesn’t mean the same thing as the first sentence.
The first sentence implies that all the pieces must be defended.
Edit: Eh, I guess it depends on how you view the word “attack” since all the pieces are the same colour.
...Q....
.......Q
........
........
..Q.....
......Q.
........
B.......
edit: Its almost the exact same solution to the one provided lolHowever let us suppose that you can place it on the board and have it be in either check or checkmate.
If it has been placed on the board and it is in check, since it cannot move into check it follows that it is the king's move. If it can move out of check by taking a piece or another way of moving it is not in checkmate, this seems a pretty weird trick then, because it is not so interesting that you can place the king on the board and it will be in check and it is the king's move to get out of check.
If it can get out of check by taking an unprotected queen then it is again not very interesting, and why would I not just put the king on one of those positions and take the queen from the first.
If I cannot put it on the board without it being in checkmate, it must mean that the placing it on the board is itself the move, and you cannot move into checkmate, but if placing it on the board is the move then it follows you can take a queen with that move if you can place the king anywhere on the board.
The phrasing of the puzzle is inadequate, it seems.
I don’t see why that would be uninteresting. Before analyzing this, it isn’t clear that there is no way to place four black queens and a black bishop on the board in such a way that they attack all blank squares _and_ defend each other against capture.
If that were the case, the puzzle where you have to find a setup where you cannot place a king on the board without it being in check is easier than the one where you have to find a setup where you cannot place a king on the board without it being in checkmate.
Also, if you interpret the puzzle description in the latter way (and that, I think, is the most natural way to do it), it seems the puzzle doesn’t have a solution (https://news.ycombinator.com/item?id=48129115)], so do you think this puzzle is not very interesting?
A real shame, this totally ruined the puzzle for me as it seemed so unlikely that all five Black pieces would be mutually protected. I should have forced myself to ignore the faulty clause and try to solve without it. The bad clause is also completely unnecessary - one of those cases where deleting text (or code!) is an improvement with no downside!
For the knight's tour all you need is a simple heuristic, consistently applied, of doing the hardest bits first - visiting the next square that has fewest remaining squares that lead to it, meaning that you start in a corner. This is what has me wondering about the puzzle/heuristic being discussed where the first placement is using a different heuristic.
On a slow computer the trick to a fast 8-queens solution is to recognize that a minimal constraint is that the queens need to all be on different rows and columns, so you can start by using an efficient permutation algorithm to generate permutations of {1, 2, .. 8} (corresponding to column placement of queen on n'th row), then just check the diagonals of this reasonable number of candidates.