14
$\begingroup$

With the white queen on a light-coloured square of your choosing, can you place 7 rooks on the dark squares of the chessboard so that no piece attacks another?

example position with seven black rooks and one white queen

In the above Lichess illustration (with the lovely "horsey" piece set), the rooks are attacking each other, so that one isn't a valid solution.

  • If possible, a sample position will suffice.

  • If impossible, please include a proof in your answer.

$\endgroup$

8 Answers 8

15
$\begingroup$

Alternate answer:

This cannot be done.

If I divide up the unattacked dark squares like so:
enter image description here
The squares with black rooks fit into three columns, and the squares with white rooks fit into three rows, so only six rooks can be placed in total.

Notice that the black rooks are an even number of columns away from the queen, and the white rooks are an even number of rows away. Every unattacked dark square falls into exactly one of these groups, so it either shares a column with a light square in the queen's row, or a row with a light square in the queen's column. There are six such squares in total, giving a maximum of six rooks regardless of the queen's location.

$\endgroup$
9
  • 3
    $\begingroup$ Need to argue that the same situation happens for every white square, but otherwise looks good. $\endgroup$ Commented Aug 6 at 2:48
  • 1
    $\begingroup$ Exchanging rows and columns to move the queen potentially puts the rooks on white squares (not really, but that's the gap in the proof, to my mind) $\endgroup$ Commented Aug 7 at 0:48
  • 1
    $\begingroup$ @kagami You can move the square colors along with the rows, although I'll try to come up with a more direct explanation soon. $\endgroup$ Commented Aug 7 at 0:56
  • 1
    $\begingroup$ Actually, row and column swapping feels like a dead end. It's easier to just generalize the construction for any queen position. $\endgroup$ Commented Aug 7 at 14:21
  • 1
    $\begingroup$ @AxiomaticSystem: That video inspired me to immediately see a solution involving coloring similar to yours, except that I would have started by observing that there would either be four black rooks or four white rooks, and that whichever color of rooks there were four of would see all of the white squares on the chessboard. $\endgroup$ Commented Aug 11 at 15:42
12
$\begingroup$

Answer:

This is impossible.

Explanation:

Since the rooks are on black squares, the diagonal constraints from the queen don’t matter. So it’s as if we have seven rooks on black squares and one rook on a white square. I’ll show below that this is impossible.

In the classic non-attacking rook problem, the positions of the rooks correspond to a permutation of 8 items. It is clear that any white (black) square corresponds to even (odd) value of r+c, where (r,c) is the position of that square. In any permutation σ of 8 items, the sum of r+σ(r) over all rows r is even, so there must be an even number of rows r for which r+σ(r) is odd. But the problem asks us to place seven (an odd number) of rooks on black squares. Therefore, this is impossible.

$\endgroup$
9
  • 4
    $\begingroup$ You could simplify your last paragraph a bit. For any black square, row+column is even, for any white square row+column is odd. If we place one piece in each row and column, the sum over all 8 pieces is 2*(1+2+..+8) so even. Therefore we can't use 7 black and 1 white square. $\endgroup$ Commented Aug 6 at 6:44
  • 2
    $\begingroup$ Another words: we can diagonalize 8-rook solution using row (or column) permutation, but such transformation preservs parity on diagonal color set. $\endgroup$ Commented Aug 6 at 12:48
  • 4
    $\begingroup$ @Bass. Makes sense. No worries. I think bobble added it because combinatorics’s description says “use with [mathematics]”. $\endgroup$ Commented Aug 6 at 21:36
  • 4
    $\begingroup$ @Bass So your Q is from the field of non-mathematical combinatorics? $\endgroup$ Commented Aug 7 at 3:12
  • 3
    $\begingroup$ The language might be hard to follow, but the solution shouldn't be. Give each square of the chessboard a score by interpreting a=1 etc and adding the coordinates. If we can place 8 pieces with no two in the same column or row, we must use every row and column once. So the squares we use have exactly one a,b,c etc and one 1,2,3 etc, so their total score is 72. But black squares have even score and white squares odd score, so we can't use exactly one white square and get an even total. $\endgroup$ Commented Aug 7 at 13:42
7
$\begingroup$

Alternate answer elaborating some ideas already present in the discussion.

First, observe that we can swap two rows of any solution and preserve the fact that it is a solution, provided that the two rows have the same parity (i.e. there is an odd number of rows between them); and similarly for columns. We can also perform a diagonal flip of the entire board.

Suppose we have a solution. Using the above operations we can move the queen to h1, regardless of where it started.

Chessboard with a white queen on g6, moving via f7 and f1 to h1

Now we know there is a rook on a dark square in the g-file. Using a row swap we can move it to g3. The rook can't have been on the first rank or else it would have been attacking the queen, so this doesn't move the queen we already placed. Similarly we move the rook on the 2nd rank to f2 with a column swap.

Chessboard with a white queen on h1, a black rook on g7 moving to g3, and a black rook on d2 moving to f2.

Continuing in this way, we perform swaps to place black rooks on e5 and d4, then on c7 and b6, without disturbing the queens and rooks we previously placed.

Chessboard with a white queen on h1 and black rooks on c7, b6, e5, d4, g3, and f2.

But now there is nowhere to place the last rook, a contradiction. So no solution exists.

$\endgroup$
4
$\begingroup$

Answer:

It is not possible.

A somewhat more visual explanation than other answers:

Let's consider the number of black squares in each column that don't share a row with the queen:

Image of a chess board, with a queen on a white square. The row the queen is on is highlighted.

Some columns have four black squares that don't share a row with the queen, some columns have only three.

Since the queen is on a white square, she is necessarily on a column that has four black squares not on her row. No rook can be in that column.

Image of a chess board, with a queen on a white square. The row the queen is on is highlighted, and her column is darkened. Each of the black squares in that column are marked with a red dot, counting them to four.

This leaves us with 3 columns that have 4 potential rows for rooks, and 4 columns that have 3 potential rows for rooks. Let's consider the latter.

Image of a chess board, with a queen on a white square. The row the queen is on is highlighted, and her column and every other column next to it is darkened. On the non-darkened columns, the black squares are marked with a dot. There are four columns, each of which has three such squares.

Since each of the seven rooks and the queen (eight pieces in total) take up a whole column and a whole row for themselves due to their attack pattern, and there are exactly eight rows and columns on the board, then each column (and row) must contain exactly one piece.

Notice that

On the last picture, there are four columns which must be filled. However, they all share only three rows. By the Pigeonhole principle, if each column is to contain a piece, then necessarily at least one pair must share a row. Therefore, there cannot be any valid solution!

I used the case given in the question as a visual demonstration for my answer, but my answer is independent of where the queen is placed, so long as it in on a white square.

$\endgroup$
1
  • $\begingroup$ My solution was similar. $\endgroup$ Commented Aug 7 at 8:55
2
$\begingroup$

As mentioned by @Pranay, the diagonals can be ignored. Without loss of generality (because rook attacks are preserved under row and column permutations), the white queen appears in the top left corner cell $(1,1)$. Now let binary decision variable $r_{ij}$ indicate whether a rook appears in cell $(i,j)$, where $i+j$ is odd. The problem is to maximize $\sum_{i,j} r_{ij}$ subject to linear constraints \begin{align} r_{2,3} + r_{2,5} + r_{2,7} &\le 1 \tag1\label1 \\ r_{3,2} + r_{3,4} + r_{3,6} + r_{3,8} &\le 1 \tag2\label2 \\ r_{4,3} + r_{4,5} + r_{4,7} &\le 1 \tag3\label3 \\ r_{5,2} + r_{5,4} + r_{5,6} + r_{5,8} &\le 1 \tag4\label4 \\ r_{6,3} + r_{6,5} + r_{6,7} &\le 1 \tag5\label5 \\ r_{7,2} + r_{7,4} + r_{7,6} + r_{7,8} &\le 1 \tag6\label6 \\ r_{8,3} + r_{8,5} + r_{8,7} &\le 1 \tag7\label7\\ r_{3,2} + r_{5,2} + r_{7,2} &\le 1 \tag8\label8 \\ r_{2,3} + r_{4,3} + r_{6,3} + r_{8,3} &\le 1 \tag9\label9 \\ r_{3,4} + r_{5,4} + r_{7,4} &\le 1 \tag{10}\label{10} \\ r_{2,5} + r_{4,5} + r_{6,5} + r_{8,5} &\le 1 \tag{11}\label{11} \\ r_{3,6} + r_{5,6} + r_{7,6} &\le 1 \tag{12}\label{12} \\ r_{2,7} + r_{4,7} + r_{6,7} + r_{8,7} &\le 1 \tag{13}\label{13} \\ r_{3,8} + r_{5,8} + r_{7,8} &\le 1 \tag{14}\label{14} \end{align} The maximum turns out to be

$6 < 7$,

and the optimal linear programming dual variables provide a short certificate of optimality. Explicitly, adding up constraints \eqref{2}, \eqref{4}, \eqref{6}, \eqref{9}, \eqref{11}, and \eqref{13} yields $\sum_{i,j} r_{ij} \le 6$.

This is a similar approach to the answer by @AxiomaticSystem, but the proof here is generated somewhat automatically as a by-product of the LP solve.

$\endgroup$
4
  • $\begingroup$ That’s nice! Here’s an arrangement that achieves this maximum: i.sstatic.net/7Ag6NXqe.png. Of course there are many more. $\endgroup$ Commented Aug 6 at 5:11
  • 1
    $\begingroup$ @Pranay if you actually try this puzzle out on a chess board, you'll quickly find out that every position with the queen and five rooks will allow for one more rook to be added. In other words, it's impossible to not reach the maximum by whichever piece placement you care to try. :-) $\endgroup$ Commented Aug 6 at 20:47
  • $\begingroup$ @Bass. Ah yes you are right $\endgroup$ Commented Aug 6 at 20:53
  • $\begingroup$ The "without loss of generality" argument needs a little more care since the colors of the board squares are not preserved by arbitrary row and column permutations. My answer gives one way of making it work. $\endgroup$ Commented Aug 8 at 0:54
2
$\begingroup$

Answer:

Not possible.

As mentioned by others,

the queen's diagonal attack is irrelevant: it affects only white squares and the 7 rooks are on black. She might as well be just an eighth rook. Without loss of generality you can also assume she is at h1.

This means that an equivalent problem is to

place 7 non-attacking rooks on the 7x7 sub-board a2-g8, such that all 7 are on black squares.

Notice that

a rook on a black square of this 7x7 sub-board attacks 5 black squares (excluding her own) and 7 white squares. So any placement of 7 rooks on black squares will result in a total of 35 attacks against the 17 unoccupied black squares.

Hence some black square is attacked more than twice, which means it must have either two attackers in the same rank or two in the same file - and these rooks also attack each other.

$\endgroup$
1
$\begingroup$

I had a highly visual answer prepared, only to realize it was basically the same as @Invizio's. So here's another:

Is it possible?

No.

Why?

Let's place our $7$ rooks. Each of them can attack $7 \times 2=14$ squares. There are also $7 \times 6 = 42$ squares in total that are attacked twice by any dual combination of these rooks. So, together they all attack $14\times7-42=56$ distinct squares, making $63$ when the squares they're on themselves are added.

Each of them can attack $8$ white and $6$ black squares. If we have $n$ white squares that are attacked twice, then we have $56-n$ attacked white squares, and $n+7$ attacked or occupied black squares. Since there's only one free square left:

$33>n+7>30$
$26>n>23$

However, both squares attacked by the same combination of rooks have the same color, so $56-n$ and by extension $n$ must be even, as in $24$.

$n+7=31$, so the remaining square must be black, and therefore can't be occupied by the queen.

$\endgroup$
1
$\begingroup$

Another solution:

Since Queen’s diagonal moves aren’t valid, we can state that the white queen is another eighth rook.

Then the problem becomes:

Can you locate 8 rooks in 7 black / 1 white squares, not attacking each other?

We know that

Swapping 2 rooks like following (White to black) in any valid not-attacking 8 rook solution makes another valid solution.

Swap

This manipulation should be possible until we get the following position:

Valid solution

Note that

Swapping two rooks doesn’t change the parity of numbers of whites/blacks which rooks are located.

Simple proof:

Any rectangles on the chessboard (considering each squares to vertices) should have even number of white / blacks.

Therefore

Seven blacks and one white is impossible.


Edit - Here is the proof that

there are no solutions that cannot be diagonalized by swaps.

Using the standard chess notation and the picture above, there is a rook on file a, and so on the rank 8.

If the rook is on a8, no need any moves. If the rook is not on a8, swap a? rook and ?8 rook.

After the moves, we just need to solve the problem in smaller chessboard (7x7).

Repeating these moves will let the range of to-solve chessboards as 7x7, 6x6, 5x5, 4x4, 3x3, 2x2 and finally all rooks are solved.

$\endgroup$
3
  • 1
    $\begingroup$ This is pretty similar to what @Pranay's answer is saying, up to and including the fact that neither answer explains why there are no solutions that cannot be diagonalized by row and column swaps. :-) This one's much easier to read though, so here's my +1. $\endgroup$ Commented Aug 12 at 11:40
  • $\begingroup$ @Bass. Not sure I understand your comment. My answer is a complete proof. Are you saying there’s something missing there? $\endgroup$ Commented Aug 14 at 7:28
  • 2
    $\begingroup$ @Pranay Incomplete answers don't tend to get upvoted anyway. There was nothing wrong with your answer. People skip some steps to shorten their solutions because they figure it's easy/intuitive enough for other puzzlers to realize anyway all the time; it's not required to show your entire work as long as it's comprehensible. $\endgroup$ Commented Aug 14 at 8:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.