chessboard 7x 7

128 Views Asked by At

A 7 × 7 chessboard that is painted black and white, with the corners painted black;and we have the operator "inverse", which can be applied to a single row or single column in a table that it change the color of the cell from white to black or from black to white ( for example the first cell at row 2 in the chessboard colerd by white and the second is black.... if i will use "inverse" to this row it will change the first cell to black and the second to white ...) The goal is to make the whole board colered black. What is the minimum number of steps required to achieve the goal?

there is two soultion for this question, i need the two soultions!!

1

There are 1 best solutions below

0
On BEST ANSWER

enter image description here

If we consider the initial board, we just have to reverse $3$ rows and $3$ columns as indicated by the external stones on the picture above.

Note: $6$ moves is the minimal number since if we consider the stones on the top edge and right edge for instance, there are $6$ of them and they need to be reversed anyway. This cannot be done in less than $6$ operations.

The order has no importance, you can start by the rows $2,4,6$ and then all the columns, but you can also select any row or column that has not been already reversed.

enter image description here

For instance here is the status after $1$ column was reversed.

enter image description here

And after $2$ rows and $1$ column were reversed.

If you continue the process, with the remaining $3$ marked available moves, you end up with an all black board, no matter the order of the moves.


The reason it works is the following when you consider the possible moves (stones on the outside) you will notice that white stones can be reversed by only $1$ possible move while black stones can be reversed with $0$ or $2$ of them.

The order is not important, the parity is. Assuming we do not repeat a previously made reversal, then white stones will be flipped once (and become black) and black stones will be flipped zero or twice (and remain black).

In the end the whole board turns black.