Humans and computers solving Djaja

by Frederic Friedel
5/12/2020 – Can computers handle perpetual check? Could they do so ten years ago. And more relevantly: can humans? Even those with super-GM titles? Well, a 2351 player was able to do it better than his brother, who was rated 400 points higher. We have told the story before, but since our readers spent the weekend working on the Djaja problem, it may be of interest to remember how Aronian, Navara, Gashimov, Mamedyarov and Kasparov fared.

ChessBase 15 - Mega package ChessBase 15 - Mega package

Find the right combination! ChessBase 15 program + new Mega Database 2020 with 8 million games and more than 80,000 master analyses. Plus ChessBase Magazine (DVD + magazine) and CB Premium membership for 1 year!


Before we come to the Djaja study, the subject of today's article, let me clear something up: a number of readers – well, a few readers – one reader – objected to my phrasing of the Dawson problem: "the player with the white pieces, on the move, refused to accept the resignation of his opponent. Instead he wagered that he would not win the game. He then played on and actually lost! Not by overstepping his time, resigning, or playing an illegal move. So how could he lose?"

True, I did not mention that the wager was accepted, or notarized. I phrased it in the interest of brevity. But for the record here is the original presentation from Thomas. R. Dawson, Reading Observer 29.3.1913. He reprinted it in Dawsons 'Caïssa’s Fairy Tales' in 1947, and the copy here is from that publication. It was sent to me by the ever-diligent Werner Keym.

On to Djaja. In my previous article I told you how, during a Chess960 World Championship 2009 (that's what it was called by the organizer and sponsor, Perdurabo) in Mainz, tournament arbiter Hans Secelle of Belgium showed us a position by D. Djaja. Before I tell you how the top player in Mainz handled the position, let us go through the solution. Full comments are given on our replay board.

As you probably know you can an engine (fan icon) that will help you to analyse. You can also click on the rook icon below the notation window. This will allow you the play the above position against Fritz, where you can see if the engine manages to hold the draw at tournament time controls.

[Event "Donner book"] [Site "?"] [Date "????.??.??"] [Round "?"] [White "Djaja, Dragutin"] [Black "White to play and draw"] [Result "1/2-1/2"] [Annotator "Friedel,Frederic"] [SetUp "1"] [FEN "8/R2Pk3/Pr6/7P/3r4/p5N1/7K/8 w - - 0 1"] [PlyCount "9"] {This is the starting positions of the full study. White’s position appears hopeless as there is no way of stopping the Black pawn’s march to become a queen.} 1. Nf5+ Kd8 2. Ra8+ (2. Nxd4 a2 3. Nc2 ({But our engines tell us that} 3. Rb7 a1=Q 4. Rxb6 Qxd4 5. a7 {would seem to ensure a draw.}) 3... Rb2 { and Black wins.}) {However, let us concentrate on the main line of the intended solution:} 2... Kxd7 3. a7 Ra4 4. Rg8 Rba6 {[#] This is the position we showed the GMs in Mainz, who were told to find a single white move, and then spend a few seconds explaining why it is a draw. The solution is:} 5. Nh6 $3 {and now White has perpetual check along the g-file! The explanation: "Now White has perpetual check along the g-file!" Check it out: the rook is proctected on every square the black king can use to approach: g1-g3 by the white king, g4 and g8 by the knight, and g6 by the pawn. The only unprotected squares, g5 and g7, cannot be used by the enemy king, since f5 and f7 are attacked by the knight.} 1/2-1/2

Now let us look back at engines in 2009, eleven years ago. When we took our bet with Hans Secelle the intention was to use the "Monte Carlo" function of Rybka, in which the program plays thousands of games against itself at high speed and discovers, although it may not understand why, that there is one move which simply does not produce wins for the black side (while all others do). However Rybka did it on a normal level as well:

Above is Rybka running on a standard quad system: the solution popped up in just 28 seconds, and remained permanently the main line of the program. But what about other engines?

This is good ol' Fritz 11, running on the same quad (at close to ten million positions per second). The program came up with the solution and stayed with it after just 32 seconds.

As we learned from the feedback of our 2020 readers, today's programs solve the problem and play 5.Nf6! with something close to a 0.00 evaluation instantaneously. So how about humans? In his book "The King" GM Jan Hein Donner wrote: "Keres, the two Byrnes, Lothar Schmid, Bisguier and I sat staring at this position for more than half an hour. We couldn’t find it. Can you?"

Indeed none of the chess players in Mainz were able to solve this position. Here are some of the top grandmasters who wrestled with the problem, and some cute little stories surrounding their efforts. I have told these before, like eleven years ago. But many readers may have missed the articles or forgotten them.

One of the first players I showed the problem to was Levon Aronian (on the right in this picture), between his games in the GrenkeLeasing Rapid World Championship. He solved it instantly, but had a little confession: "I know this position, I have read the Donner book!"

On the other hand Lev had a prediction: "Show it to Gabriel Sargissian," he said [Gabriel was his second, left in the picture above]. "That guy is a problem solving wonder. He gets any study and any problem immediately. It's a miracle."

No, it isn't! No, he could not.

Gabriel was unable to find the winning idea, and after some taunting by Levon and me he asked for the solution. Which I gave him.

Next I showed the problem to Evgeny Najer, rated 2663, Daniel Fridman, 2665, and David Navara, 2709 (left to right in the picture) – and to any number of other GMs in the hall. None solved it on the spot.

Late that evening Fridman, who spent a lot of time working on it, came up with the solution.

How about the others, the even stronger grandmasters?

That evening at the Champions' Dinner everyone got to try: in the above picture it is the late Vugar Gashimov, rated 2740, his brother and manager Sarkhan, IM elect rated 2351, and Viktor Bologan, 2689. At the same table was also Ivan Sokolov, 2655, Ordix Open winner Shakhriyar Mamedyarov, 2717, and other occasionally some inquisitive GM ("Hey, what you guys doin'?").

Guess which of the Gashimov brothers solved the puzzle. The one who was weaker at over-the-board chess, by almost 400 Elo points! Sarkhan is a project manager of Hewlett-Packard in Azerbaijan, speaks excellent English and has a great sense of humour. He spells his surname "Hashimov", but that is a Russian thing.

Shakhriyar Mamedyarov was another Super-GM who solved the problem – after a number of local tap beers and some intense brooding over our sheet of paper.


Another episode needs to be narrated, but I'll keep the protagonists anonymous, for obvious reasons. One top GM I showed the puzzle to – not necessarily one of those mentioned above – worked for a while on the problem and then gave up. Some time later he returned and asked to see it again. This time, after a few minutes of thinking, a smile broke out on his face and he gave me the correct solution.

Very nice. Except that later that evening a young and somewhat distraught lady told me the following: "He came outside and asked us for the solution, and the whimp (Gabriel) told it to him! The guy said we should not tell you, but I can't allow it to pass." Very devious – but hey, I like that in a man.

Finally there was Garry Kasparov, enjoying a vacation on a Mediterranean coast, but still keeping up with the chess news. He called and told me that he had solved the puzzle in a minute or two. "But only because of the big hint you included in the story!" Garry's reasoning, as he explained it: "If Rybka takes half a minute – that long! – to find the solution, in an open position, then there is only one possibility: it must be a perpetual! Once you realize that the solution is easy to find...". Good thinking, Garry Kimovitch!

Editor-in-Chief emeritus of the ChessBase News page. Studied Philosophy and Linguistics at the University of Hamburg and Oxford, graduating with a thesis on speech act theory and moral language. He started a university career but switched to science journalism, producing documentaries for German TV. In 1986 he co-founded ChessBase.
Discussion and Feedback Join the public discussion or submit your feedback to the editors


Rules for reader comments


Not registered yet? Register

Frits Fritschy Frits Fritschy 5/14/2020 12:00
Not to mention Kasparov's performances in clock simuls, for instance the 7-1 against an Israeli team averaging 2600.
Kasparov may have an ego 'that's not easy to crush', but that comes with the job. I mean, Picasso seems to have been a terrible man for some, but should we judge his art because of it? The character of people that have performed outstandingly in their field is hardly more than a side note.
RayLopez RayLopez 5/14/2020 10:17
@saturn23 - OT, it's standard practice in a simul to use weak players, since it's tiring to play strong players. Nearly all GMs do this, not controversial at all.
saturn23 saturn23 5/13/2020 07:14
It's funny that only a few minutes after I posted the previous comment, where I mentioned the episode where Kasparov complained about one player being too strong in a simultaneous, I read the chessbase article "Fischer on "60 minutes", three months before becoming world champion". There's a link to the youtube video. The top comment is written about someone who played Fischer is a simultaneous. Someone else replied with:

"And bobby probably wasnt complaining about your level as garry kasparov who was furious when hed found out that one of the players was 2000-2200 :D garry wanted to play only amateurs on exhibition match so he could crush them all in 5 minutes and be perceived as a genius :D
of course garry was a fantastic player, but his ego is huge"

Kasparov's antics are indeed very well known.
saturn23 saturn23 5/13/2020 06:46
@Frederic - thank you for your work on chessbase. I have been reading for 20 years.

You obviously know him much better than I do. I already said that I don't dispute the fact that he solved the puzzle in 1-2 minutes. My rant is not about the puzzle.

I have seen enough interviews with him and heard stories about him to know what "kind" of person he is. He is a "dirty" chess player after all (from trying to take moves back, when played against Polgar and Nakamura, to slamming doors during the match against Anand. He is known to use dirty tricks to intimidate his opponents (I heard stories from Leko and other players). He is known to be rude to people (even to fellow grandmasters like Eric Hansen). He is known to throw a tantrum when things don't go his way (when Radjabov got the prize for the best game in Linares 2003 or when one opponent was too strong in one simultaneous). There's a long history of such incidents.

He did very bad things for chess, like creating his own chess organization in the 90's (later he recognized this as a mistake). He kept the title without playing for 5 years between 1995 and 2000, while refusing to play Shirov.

He was a great chess player but I have 0 respect for him as a person. His antics are "legendary" and he should be "recognized" for all these things.
Frits Fritschy Frits Fritschy 5/13/2020 01:37
As the part of the story about the Gashimov brothers indicates, solving the Djaja study is less dependent on the strength of a player than on a sudden flash of understanding. Some will not solve it whatever time you give them, some will see the idea within seconds. It's like looking for your glasses when it's on your nose – can drive you mad (happens to me). There would be more (if any) reason to disbelieve Kasparov if he had taken five minutes for it.
Frederic Frederic 5/13/2020 01:05
I have a long history of giving Garry Kasparov puzzles, sometimes in fact tricking him. My experience is that he is rigorously honest -- but that would seem to collide with your experience with him, saturn23?! He was not "bragging" about solving the Djaja study, but gave me an insight to how he goes about winning the challenges I put out. Garry is probably the best solver I have met. I once gave him a very difficult position, the solution to which only John Nunn and the endgame database knew, in the world. He solved it walking the streets of Paris. I feel a new story coming...
lajosarpad lajosarpad 5/13/2020 11:17
@saturn23 I think Kasparov really thought back in 1997 that IBM cheated, otherwise his mighty Self could have not beaten, by an inanimate object nonetheless. It's another question whether he was right. It would certainly be premature to assume that, but I cannot exclude it either. However, his claim that he solved it so quickly must be true, otherwise he would be lying. He is an exceptionally strong player who is definitely capable of solving studies quickly and he has also noted that there was a big helping clue.
Girkassa Girkassa 5/13/2020 12:35
You are right that 2.Nxd4 a2 3.Rb7 has been shown to draw. There is a corrected version with the rook on e4 instead of d4. Then the intended solution is the only way to draw.
saturn23 saturn23 5/12/2020 11:33
Kasparov never misses a chance to brag about himself. Of course, I'm talking about his claim that he solved it in a minute or two. I'm not disputing this claim because it is possible after all that a very strong player could solve it in a minute or two. However, Kasparov has a long history of making claims without presenting any kind of evidence. For example he claimed that IBM cheated in the 1997 match or that Karpov "stole" his preparation for one of their matches.
JoshuaVGreen JoshuaVGreen 5/12/2020 05:11
@Frederic, thanks for sharing an original version of the Dawson puzzle.

I have to admit (and accept) that your phrasing isn't so far off from that original (though I do slightly prefer the original's "therefore" to your "then"). I do consider it noteworthy that that original is cast as a conversation, during which the language is likely to be somewhat imprecise. (It's also not obvious that it's posing a puzzle for the reader to solve.) Here, everything was cast as a formal stipulation, and there things should be precise.

As I wrote earlier, I prefer Wikipedia's wording. The phrasing there apparently comes from ... your own Christmas Puzzles from December 31, 2014. I don't know where you found that particular version, but clearly you thought that that was a better way to pose this puzzle back then.

The upshot is that I personally don't think that this is a particularly good puzzle with the current phrasing, and I suppose my disappointment should extend to the version in the graphic you've provided. I'll be interested in reading the comments to see if others agree; those unaware of the trick (and simply stuck) wouldn't necessarily realize that there was anything to (maybe) complain about.

Regardless, I do want to thank you for sharing all these problems and puzzles, both now and throughout ChessBase's existence. They've provided some rather pleasant diversions over the years.
Frits Fritschy Frits Fritschy 5/12/2020 02:50
I already knew the Djaja study. It reminds me of another maddening one: white Kf7 Rd1 pe3 b7 black Kb8 Rh8 pc5 f5 h4 [Alois Wotawa, Deutsche Schachzeitung 1938]. White to play and draw.