Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a perfect algorithm for chess? [closed]

I was recently in a discussion with a non-coder person on the possibilities of chess computers. I'm not well versed in theory, but think I know enough.

I argued that there could not exist a deterministic Turing machine that always won or stalemated at chess. I think that, even if you search the entire space of all combinations of player1/2 moves, the single move that the computer decides upon at each step is based on a heuristic. Being based on a heuristic, it does not necessarily beat ALL of the moves that the opponent could do.

My friend thought, to the contrary, that a computer would always win or tie if it never made a "mistake" move (however do you define that?). However, being a programmer who has taken CS, I know that even your good choices - given a wise opponent - can force you to make "mistake" moves in the end. Even if you know everything, your next move is greedy in matching a heuristic.

Most chess computers try to match a possible end game to the game in progress, which is essentially a dynamic programming traceback. Again, the endgame in question is avoidable though.

Edit: Hmm... looks like I ruffled some feathers here. That's good.

Thinking about it again, it seems like there is no theoretical problem with solving a finite game like chess. I would argue that chess is a bit more complicated than checkers in that a win is not necessarily by numerical exhaustion of pieces, but by a mate. My original assertion is probably wrong, but then again I think I've pointed out something that is not yet satisfactorily proven (formally).

I guess my thought experiment was that whenever a branch in the tree is taken, then the algorithm (or memorized paths) must find a path to a mate (without getting mated) for any possible branch on the opponent moves. After the discussion, I will buy that given more memory than we can possibly dream of, all these paths could be found.

like image 987
Overflown Avatar asked Nov 18 '08 01:11

Overflown


People also ask

How close are computers to solving chess?

There are estimated to be 10^50 chess positions. Even assuming we only use 1 bit for each position (1=win, 0=loss) your computer would need at least (and probably more than) 1,000,000,000,000,000,000,000,000,000,000,000,000 TBs of storage to be able to store the outcome of all possible chess positions.

Is chess theoretically solvable?

Chess is solvable, but it is not static in nature, therefore there is no sure win sequence so long as the opponent still possesses the counter factor.

Is it impossible to beat a computer in chess?

Newswise — ITHACA, N.Y. – Since IBM's Deep Blue defeated world chess champion Garry Kasparov in 1997, advances in artificial intelligence have made chess-playing computers more and more formidable. No human has beaten a computer in a chess tournament in 15 years.


1 Answers

"I argued that there could not exist a deterministic Turing machine that always won or stalemated at chess."

You're not quite right. There can be such a machine. The issue is the hugeness of the state space that it would have to search. It's finite, it's just REALLY big.

That's why chess falls back on heuristics -- the state space is too huge (but finite). To even enumerate -- much less search for every perfect move along every course of every possible game -- would be a very, very big search problem.

Openings are scripted to get you to a mid-game that gives you a "strong" position. Not a known outcome. Even end games -- when there are fewer pieces -- are hard to enumerate to determine a best next move. Technically they're finite. But the number of alternatives is huge. Even a 2 rooks + king has something like 22 possible next moves. And if it takes 6 moves to mate, you're looking at 12,855,002,631,049,216 moves.

Do the math on opening moves. While there's only about 20 opening moves, there are something like 30 or so second moves, so by the third move we're looking at 360,000 alternative game states.

But chess games are (technically) finite. Huge, but finite. There's perfect information. There are defined start and end-states, There are no coin-tosses or dice rolls.

like image 171
S.Lott Avatar answered Sep 18 '22 02:09

S.Lott