Václav Kotěšovec

Mezi šachovnicí a počítačem

(Between chessboard and computer)

A guide for English-speaking readers

Václav Kotěšovec's Mezi šachovnicí a počítačem is one of the most interesting and original chess books to have appeared in recent years - T. R. Dawson would have delighted in it - and although it is written in Czech a surprising amount of it can be absorbed without knowledge of the language. I have therefore written this brief guide to help the non-Czech-speaking reader to find his way around it, in the hope that this will help to gain it the wider audience which it deserves. The guide may be reproduced without payment to myself.

John Beasley, Harpenden, Herts, 1996

The book is in three main sections: a selection of Václav's problems, a selection of his articles, and a description of his computer program VKSACH and the algorithms used therein.

Part 1: Problems

Most of these can be readily understood without knowledge of the language. K stands for king, D for queen, V for rook, S for bishop (beware!), J for knight, P for pawn. There is a list of fairy pieces and conditions on page 6. The problems are classified as follows:

Two-movers: Reciprocal change 9
   Cyclic change 12
   Key and threat themes 14
   Change of defensive motive 18
   Change of injury 21
   Other two-movers 26
Longer direct mates 27
Helpmates: Two-movers 29
   Longer helpmates with one solution 34
   Longer helpmates with more solutions 48
Series helpmates 56
Helpstalemates and series helpstalemates 63
Double stalemates 68
Fairy studies 74
Miscellanea 75
Compositions on small boards 75
Joke problems 78
Collaborative works 80
Appendix (problems composed after work on the book had started) 82

The direct mates need little comment, the themes being obvious from the solutions. "Vyřešili" means "solved" and "řešitelé" are solvers, so in 62 only two solvers were successful. The editorial comment to 62 said that it was composed with the help of a computer, but in this case the composer created the position and the computer acted only as a tester. 63 and 64, on the contrary, were genuinely discovered by computer. 64 shows the longest dual-free sequence of moves with this material, and I suspect that the same may be true of 63 although there is no explicit claim. "It might appear that this computer-assisted composition would be beyond the ability of the solvers, but nevertheless two were successful, Louis Azemard and Tadashi Wakashima," writes Václav.

Several of the help play problems constitute length records, but the records are all repeated on pages 138-73 and I shall not highlight them here. 97 found no solvers at all and I regret I did not succeed either, but the solution is in fact quite charming and I recommend readers to have a go. We are now into computer country, and an interesting graph appears at the bottom of page 45. The x-axis denotes half moves; the upper line shows the total number of helpmates of this length and with the force of 131, sound or not (this line continues beyond x=90), the lower line the number of sound helpmates.

The double stalemates depend on cyclic pins. Here again solvers sometimes had difficulty!

Most of the joke problems depend on bending the rules, and they may need a little explanation. In 277, the position is illegal (too many White pawn captures) and the task is to make a mating move which creates a position that could have been reached legally. 1 h8R does so; 1 h8Q does not. Castling is illegal in 278 (BK must have disturbed WK to reach hl), but the position after 1 g3 Kg1 could have been reached without disturbing WK, so... The piece on e4 in 279 is a nightrider, which isn't allowed so we remove it. This threatens 1Bxe4 (but not 7Bxe4 because Black could reply by removing it - sauce for the gander). If Black parries the threat by removing Bb1, White mates by removing Ng1 (I use the player's N for knight since the Czech text uses S for bishop); if Black parries by removing Bb7, White plays 7Rxh7. 280 is illegal in ordinary chess (BBa8), so we can't play the natural move Qe4; all right, so it's Circe, and we play Kh6. 281 is wicked. The task is to discover the last move, and the answer is that before this move we had WKa1, BKa8, BQh1, forming an eternal triangle, and the Black queen divorced her own king and ran off with the White. 282, which won the Blue Danube Joke Tourney at Bratislava (not the Whisky Tourney, I think, though the first prize was indeed a bottle of whisky) is even more X-rated. Black plays 1 Qb5, after which the neutral pawn strokes back and forth between b4 and b3, and this eventually fertilizes the BQ which gives birth to another neutral pawn: mate! In part (b), the neutral bishop mistakes the BQ for an actress and does the same job.

The appendix contains problems composed during work on the book. There are some more length records here, also several echo problems. A "barevné" echo is a chameleon echo, a "stejnobarevné" or "nebarevné" echo is monochrome. The suffix "násobné" means "multiple" (thus "trojnásobné" signifies "triple").

Part 2: Articles

The articles are inevitably more demanding in their knowledge of the language than the problems, and some are now only of historical interest. The 1985 article on page 118 asks "Why fairy chess?", and the 1987 article on page 120 discusses the solution and composition of chess problems by computer. On page 124, however, we meet a self explanatory report of computer testing of the four-movers in the Mikan booklets Galerie československých skladatelů and the books Dobrodružství 64 polí (Mikan) and České granáty (Havel). The flaws are not listed here, but they were reported in detail in issue 12/1986 of Šachová skladba. At the foot of page 125 is a report of the testing of the problems originally selected for Jiří Jelínek's forthcoming book on Bohemian selfmate echoes. (Since this was written, Jiří and his colleagues have corrected over 40 of the unsound problems, and Václav has spent another 500 hours of computer time verifying the corrected versions.)

Page 126 sees a 1984 article on the composition of problems by computer. The next seven articles relate to solving by computer, and they are prefaced by a table on page 128 which gives a historical summary up to 1995 and summarizes present performance. I don't know the MINSK-22 (was it an IBM/360 look-alike?) but I do remember the ZX81, an incredibly primitive machine by modern standards. The 1976 program solved only two-movers, but included fairies; the 1981, direct mates, helpmates, and selfmates; the 1990, "almost everything". "Vteřiny" are seconds, "minuty" minutes, "hodiny" hours, and "několik" a few. The subsequent tables give average and maximum times for the

current program VKSACH on a 586/133, the detailed notes being summarized as follows: mates in 7, "a few hours in the worst case"; selfmates in 6, "up to around 40 hours, even with very strong White material"; helpmates in 3, "average 4 seconds, usually not more than 1 minute, but up to 4 minutes in isolated cases"; helpmates in 4, "from a few seconds to minutes depending on the position (a few hours in isolated cases)"; longer helpmates, "up to 8-10 moves in a few hours at worst"; series helpmates, "practicable up to 30 moves and beyond".

At the foot of page 129 is a note on the performance of VKSACH on a 486/33 on the WCSC problems at Bratislava in 1993, when it solved them all in 52 minutes (including the time taken to enter the positions) and would have come 6th overall despite not taking part in the study round. I myself put the 1994 WCSC problems on my 486/25, using Alybadix for the problems and Genius 2 for the studies, and this combination would have scored 77 out of 90 (equal 5th on points, 5th alone after considering time). The 5-move helpmate and the 6-move selfmate would have taken Alybadix too long ( 11 hours and around 70 hours respectively) and Genius would have dropped 3 points on one of the studies.

On page 137 is what I take to be a report of the discovery by computer of the longest sound single-solution helpmates with king and x,y-leaper against king and the same leaper. (I can read Czech, but not German.) The timings are in hours, but the calculations were performed on a CPC6128 and a note says that they would run at least 300 times faster on a 586/133. The positions follow on pages 138-9, which appear to have been printed from actual computer output. Further results of the same kind follow on page 140 (for the fairy men see page 6). There are acknowledgements at the foot of pages 137 and 140 to prior work by Dr. Helmut Mertes. On pages 141-3 are the detailed results: the length of the longest sound problem in half moves, the number (in brackets) of different sound problems of this length, a specimen problem (repeated in diagram form on page 162), its solution, and the remaining problems. On pages 144-5 are similar results for helpmates with three White men against a bare king; 146-7, helpmates with fairy kings; 148-9, on a cylinder; 150-1, helpstalemates on a cylinder; 152-4, helpmates and helpstalemates on an anchor ring; 155, the same without WK; 156-8, helpmates with fairy kings on cylinder and anchor ring; 159-61, maximummer helpmates on the normal board. Diagrams of the specimen problems follow on pages 162-73.

The article on pages 174-5 deals with helpstalemates. The calculations for king against king and grasshopper took 116 hours on a CPC6128, but a 1995 repeat on a 586/133 took only 2 minutes! The graph at the top of page 175 shows the number of sound helpstalemates of each length with this material, the length being measured in half moves. Pages 176-7 show some computer-generated helpmates on 3x3 and 4x4 boards, together with distribution graphs (number of sound problems classified by length in half moves) for various combinations of material on a 4x4 board.

Pages 178-80 deal with the scanning of diagrams into the computer. I would be willing to translate this article for an interested reader, but it deals only with the scanning of printed diagrams and my experience as BCPS Librarian suggests that an even more valuable activity will be the transfer to file of the classified manuscript collections of problems and studies currently held in the Library and elsewhere. This appears to be a much more difficult task. One is usually dealing not with neat printing but with hand-drawn letters and symbols which are variable in form and sometimes written in a hurry, and the White and Black men are often differentiated only by colour.

The articles on pages 181-200 deal with endgames in fairy chess. Thse on pages 181-5 and 186-91 cover grasshopper endings: K+4G v bare K, K+2G+N/B v bare K, K+G+2N v bare K, K+3G v K+P (featured in both articles), K+G+B v K+P, and K+2B+G v K with the bishops on squares of the same colour. Pages 192-198 cover the general ending of king and two leapers against bare king on all boards from 4x4 to 8x8 inclusive. I spoke on this work at a meeting of French problemists in 1994, hence the letter quoted on page 198: "Truly an example of Gens una sumus," I wrote, "scientific results discovered by a Czech, published in Slovakia, and described by an Englishman in France!"

Pages 199-200 cover various other three-man and four-man endings on the normal 8x8 board, the cylinder, and the anchor ring.

Pages 201-203 discuss cyclic pins. Pages 204-6 is a straight piece of combinatorial mathematics concerning the number of ways of placing non-attacking kings and queens on boards of various sizes.

Part 3: VKSACH

The third part of the book (page 207 onwards) describes the computer program VKSACH. I have no personal experience of this program and am relying on the book, but it claims to offer facilities for solving, composition, and desk-top publishing (the diagrams in Šachová skladba are produced using it) and a lot of fairy chess forms are covered. The PC version needs a 286 (386 for composition) and at least version 3.30 of MS-DOS (5.0 or preferably 6.20 for work needing extended memory).

Pages 209-54 contain detailed operating instructions and may be of little interest to the general reader, and the same may be true of the algorithm descriptions on pages 255-77 although the reader experienced in the field will have little difficulty in realizing what is going on. A general "retrograde" algorithm allows the addition of extra material during the analysis, whereas a "Zermelo" algorithm considers only problems using preassigned material.

The test results on pages 278-86 are a different matter. There are four main algorithms: straightforward brute force (BF), using a preliminary enumeration of possible mating positions (R), diagnosing identical positions reached by different paths and carrying only one occurrence forward (S), and discounting such positions altogether in order to home on to the author's solution (S1). Algorithms BF, R, BF+S, and R+S give a complete test for soundness, whereas S1 and R+S1 do not. The upper graph on page 278 shows results of algorithms R and BF on 35 helpmates in three, and even on problems so short there was a significant gain in all cases but four. (The graph is truncated at 200%.) The gain on four-move helpmates was around 20,000 times, but on two-move helpmates we can expect brute force to be more than ten times quicker.

Diagrams T-1 to T-20 on page 288 show positions regarded by the author as in some way atypical. Algorithm R is 24,175 times better than brute force in T-1, more than 1000 times better in T-2, 550 times better in T-3, and more than 100,000 times better in T-4. These problems feature open positions with free squares around the BK. Brute force is better in problems T-5 ( 1.56 times), T-6 (20.9 times, and similarly part B), and T-12 (1.55 times), but in all other cases algorithm R is superior.

The graphs on page 279 throw further light on the algorithms. The lower graph is perhaps the more illuminating. Taking the time used by algorithm R as 100%, the lowest line shows the time taken to form the mating positions (the reference "R4" is to the parameter used to invoke this option), the middle line the time used by algorithms R and S1 (author's solution) in combination, and the upper line the time used by algorithms R and S (complete test for soundness) in combination. Again the problems are three-movers, hence the limited benefit of algorithm S. Once more there is an atypical case: in problem T-13 (page 288) the time taken to form the mating positions amounts to 57% of the whole, because of the need to consider each theoretically possible promotion of WPe6. For longer problems the picture is quite different, as is shown by the graph and table on pages 280-1.

Pages 282 and 283 show further graphs relating to three-move helpmates. Perhaps the most interesting is that of S/BF (page 282, second graph, lower line), which shows that the benefit of algorithm S is steady and reliable; there are no cases such as arise with algorithm R where brute force is actually better. The point is taken further on pages 284-6, with the conclusion that algorithm S is about two times better on three-move helpmates, 3 times on the set play of four-movers, 4 times on the actual play of four-movers, 8 times on five-movers, and 17 times on six-movers.

The final pages (288-93) show a selection of test problems. The figures below diagrams T-21 to T-80 give the time in minutes and seconds to find the author's solution and to perform a complete test for soundness, algorithms R and S1 or S being used throughout.