3 ms·
> There is a theorem which says that given any chess engine, it's impossible to decide if that chess engine is playing in an optimal way. Careful with that for
by schoen 7y ago
> There is a theorem which says that given any chess engine, it's impossible to decide if that chess engine is playing in an optimal way.
Careful with that formulation.
https://en.wikipedia.org/wiki/Rice%27s_theorem https://en.wikipedia.org/wiki/Rice%27s_theorem
https://en.wikipedia.org/wiki/Solved_game https://en.wikipedia.org/wiki/Solved_game
Several major strategy games, notably checkers, have been formally solved. That does make it possible to prove that some engines for those games behave in an optimal way (although it would still be impossible to verify whether an arbitrary program is equivalent to an optimal engine, because the arbitrary program could do something else first whose outcome couldn't be foreseen by the optimal-engine detector).
Although chess has a higher branching factor and a greater depth in various ways than games that have been solved, nobody has found a theoretical barrier to solving it, which in turn means that we can't rule out the possibility of a proof that a particular engine is optimal.
From the formal computation theory standpoint, the situation is even more extreme: the game tree given the threefold repetition rule is finite, which means that we can immediately write down an explicit game tree brute force engine which is guaranteed to perform optimally in every position. This is probably just a handful of lines of code! While this engine can't actually make a single move in a human timescale, from an algorithmic point of view it plays perfectly and we can be sure of that.
The theorems on undecidability of program behavior don't include time constraints like this because they're established using models of computation like Turing machines, where physical limitations of real computing devices are no issue.
- calhoun137 7y agoI guess the word "theorem" is a little strong, since it depends on the real world. I stand by the statement that it's literally impossible to decide this in practice. If we are allowed to say in a few lines of code you could formally compare any chess engine to a theoretically optimal one, then obviously it is possible to decide by just comparing. Without being allowed to compare a given engine to a theoretically optimal one which is based on brute forcing the full game tree, and being careful about the problem statement, I suspect it would be possible to prove something along these lines I would argue something like: "Gods evaluation function" takes as input a chess position and returns whether the position is a forced win, lose, or draw. The rules of chess are so complicated that to go from a continuous evaluation function to a discrete one like that would require an infinite number of steps (this last statement is the one that needs to fleshed out) I will stop calling it a theorem until I remember why I started calling it that. This situation exists in many non-linear optimization problems, a subject I find really interesting, and in many cases in practice there is no way to decide if a given solution is optimal. For some reason I thought there was a theorem in non-linear optimization theory that was directly relevant here