# In a completely lost position do chess engines attempt to bait their opponent into mistakes, or just play for the longest survival?

Essentially, do Chess Engines acknowledge that their opponents might make "flawed" moves? Or do they always assume absolutely perfect play.

More specifically, if an engine has a choice between 2 moves and one of them is:

• Mate in 5, with perfect play, all of which is completely obvious

and the other is

• Mate in 4 ... but only if the opponent does something superficially counter-intuitive. And if they do the superficially obvious thing then you can actually escape the Mating sequence into a not-directly Mated position

If you assume perfect play, then both positions are a loss, and I assume that engines are "taught" to pick the longest game if all games are lost.

But I would argue that if you believe the game is lost either way, you might want to pick the line with highest chance of an error, instead?

Do engines do that?

• Bear in mind of course, that anything that isn't an end-base board ... "perfect play" isn't objectively known ... only heuristically guessed by incredibly accurate computers, which sometimes disagree. Oct 24 at 16:13
• How does one figure out what the chance of error is? Isn't that a question of psychology rather than chess? How would we teach an engine psychology? Oct 24 at 17:54
• If the engine sees two moves, and one of them leads to a forced M4 against it and the other leads to M5, it will always choose the M5 one. Engines use the minimax algorithm, which assumes perfect play by both sides; they don't play "hope chess". Technically though, the engine might go for the M4 continuation if the move really were really hard to see and the engine itself missed it (due to pruning). Oct 24 at 20:35
• `How does one [teach the enginge] what the chance of error is?` Exactly the same way you teach it every other thing ... data. Feed it 100M games and let it work out what kinds of errors are more/less common. Hell ... if you give it the player's rankings it can probably figure out classes of error by ranking range, and estimate the range of its opponent on the fly. Oct 25 at 7:56
• Such an engine would be possible with enough data, maybe as a "fun engine" use-case. Personally I don't know of one. Oct 25 at 19:34