Ask HN: Which, if any, AIs can code a correct solution to this puzzle?
1 points
3 months ago
| 2 comments
| HN
You are given an array of n x n integers.

The goal is to end up with an array in which all entries are equal.

Four kinds of moves are allowed:

(1) rotate a row

(2) rotate a column

(3) add 1 to all entries in a row

(4) add 1 to all entries in a column

Show the goal is achievable if and only if the sum of the numbers in the initial configuration is congruent to 0 mod n.

Also write a python program to solve the puzzle whenever it is possible to do so.

tromp
3 months ago
[-]
The real challenge, for humans as well, is to code an efficient solution. Which probably requires solving the first part.
reply
curiousObject
3 months ago
[-]
What operation or transformation does rotate mean?
reply
amichail
3 months ago
[-]
It's just a rotation on a single column or a single row. This means you would shift the items one position with wrap around.
reply
curiousObject
3 months ago
[-]
Thanks. I asked this to help you make your question clearer if you resubmit it.

It’s an interesting question for HN, so you should try resubmitting it

Perhaps there are some useful ideas in this code: https://www.chiark.greenend.org.uk/~sgtatham/puzzles

reply