COLOR- and PIECE-BLIND CHESS 1. Impressing Humans What Better
Total Page:16
File Type:pdf, Size:1020Kb
COLOR- AND PIECE-BLIND CHESS such a thing could still be impressive. This is also impres- sive to other computers, who are largely concerned with filling up their memories with efficiently coded data. With a mod- DR. TOM MURPHY VII PH.D. ern chess engine, it is easy to scale to an arbitrary number of games, since the exhibitor can make progress by observing one of the boards, computing a strong move, and playing it; this re- quires O(1) space because all of the state is stored externally 1. Impressing humans in the exhibition itself. However, we run the risk of losing What better way for humans to impress each other with the tournament (other players may be yet stronger comput- their brains, especially in movies, than to play chess|and to ers). The man-in-the-middle attack remains an efficient way shout dramatically CHECKMATE! upon surprise-checkmating to minimize loss (ensuring an exactly even score). The sim- their opponent? Well, one way is to play chess while disadvan- plest way to do this is to explicily generate a perfect bipartite taged somehow, for example, by punching each other in the matching over the n games G being played. This consists of face repeatedly during the game to impair brain function (see n=2 pairs hGw;Gbi (where we play as white against Bob and Chess Boxing [8]). Another common distraction is to play a black against Walice, respectively). Since each game starts in multitude of games against many opponents at the same time, the starting position, this is very easy; we can just assign the in a so-called \simultaneous exhibition." The idea is that this matches consecutively. Along with each pair we also record is more challenging because of the need to maintain mental which of the following states we are in: state for so many games at once, whereas your opponents only (1) We are waiting for a move from Walice (our white need to maintain state for one game. In truth, simultaneous opponent) exhibitions easily fall to a \man-in-the-middle attack." If the (2) We have seen a move from Walice, which is . purported genius simply creates a perfect bipartite matching of (3) We are waiting for a move from Bob (our black oppo- the games played with the white pieces and the games played nent) with black, he can mechanically forward moves between these (4) We have seen a move from Bob, which is . pairs of boards. This requires only constant state (see next section) per pair of games, and guarantees an even score for If in State 1, we just watch Gb until Walice makes a move, the exhibition. So that's not very impressive. then record it and proceed to State 2. We consume the move Another disadvantage that humans sometimes use to im- and move to State 3 by playing that move in Gw against Bob press each other is a blindfold (worn over the eyes). In this (where it must be our turn). We can immediately seek out that predicament they only hear the opponent announce moves and game or wait until we naturally come upon it. However, we must imagine the position on the board in their mind's eye, should only approach Gw when the pair of games is in State 3, both for the sake of remembering it and while exploring po- etc., otherwise we will not have a move to play. tential moves. Disadvantages can be combined, such as in the There are n=2 pairs, with two bits for the state, no more2 final scene of the 1988 documentary Bloodsport where Jean than log2(64 × 64 × 4) = 14 bits for each move (source square, Claude van Damme is blinded by an illicit foreign substance destination square, and 2 bits to distinguish promotion to 1 during the final martial art battle. queen, rook, bishop, or knight). However, we also need to store the matching of Gw to Gb; this can be done with a pair 2. Impressing computers of indices (or e.g. memory addresses) but unfortunately, this In contrast, it is much more difficult to impress computers or requires log2(n) bits to represent. So overall this approach re- impress people with computers. When it comes to computers quires O(n log(n)) space to play a simultaneous exhibition of playing chess, largely, the jig is up; it is now easy for chess pro- n games. grams, running on consumer hardware, to defeat the strongest It appears to be possible to reduce the space usage per game human players. It is well known that striking a computer actu- to a constant. In order to perform a man-in-the-middle attack, ally fixes it, so Chess Boxing becomes trivial. Blindfold chess is we need a perfect matching between the white games and black the natural interface for a chess computer; it is actually much games. It is not essential that the matching be stable over more difficult to have the computer interpret the opponent's time; for example if we are forwarding moves between Walice move by visually studying a physical board! and Bob, and between Waluigi and Bario, and these games Playing multiple games simutaneously is an easy extension happen to transpose to the same position, then it works just of playing a single game, although in principle the scale of fine to switch to forwarding between Walice and Bario; Waluigi and Bob. So, rather than store the matching explicitly, we can Date: 1 April 2019. reconstruct it from the stored state at each step. Copyright c 2019 the Regents of the Wikiplia Foundation. Appears Let's think about the process of forwarding the moves from in The Journal Of LaTeX Class Files with the insufficient material of the our white opponents to our black opponents; the reverse is Association for Computational Heresy; IEEEEEE! press, Verlag-Verlag of course symmetric. The first step will be to wait for the volume no. 0x40-2A. 1 tempo. 1JCVD does not play chess on camera, but it is implied that he is also holding a simultaneous exhibition between rounds in a different room of 2There are only 1792 pairs of squares between which pieces can ever the underground Hong Kong illegal karate complex. move (Section 5.3.1), so 11 + 2 bits suffices, with some added complexity. white opponents to make their moves, and then copy these Fortunately, we know that there exists a perfect matching n=2 positions (not moves) into a vector in memory. (assuming all players are playing legal moves) and we can tell The black opponents are waiting for a move from us. Next, if we found one (i.e., we didn't get stuck). So, one strat- we'll copy their n=2 positions into memory, aligned with the egy that works is to choose randomly when there is some n=2 positions already present. Let's say that the relation that ambiguity, and start over from the beginning if we ever get defines a legal move in chess is stuck. In practice this will be pretty efficient, since convergent board states are unusual. We only need a single pseudoran- m 0 B ! B dom pool for the entire process, so it can be O(n) bits; this seems easily enough to generate all possible permutations of where B is the position before the move m, and B0 is the n=2 items. Even 22n grows much faster than n!. If we don't like resulting position. Our goal is to align the games such that B0 the random approach, I believe it is also possible to compute (a position copied from our white opponent) is aligned with B next_permutation in constant space; so we can just explicitly (a position pending a move for our black opponent) in memory; try all orderings for B0 (this takes exponential time). this will represent the perfect matching. Computing m from 0 m Once we have paired up each B and B , we simply compute B and B0 when B ! B0 is easy (and unique), so this allows the move (which we now know exists) and play it in that game. us to read off and play the move for each row. We then wait for the black opponents to play their moves, copy By invariant, it will be possible to produce such an align- the resulting board states into our vector and repeat the above ment. For example, the first time we do this, each B will be the process (but flipping \black" and \white"). starting position, and B0 will be a legal move made by white Although this is more involved than the previous approach, from the starting position. Any alignment will work. Let's say and may take exponential time, it allows us to play against n that just one of the white opponents played 1. d4, resulting in simultaneous opponents using O(n) space! B0; then one black opponent will make a legal response to this 0 (say 1. Nf6, giving B1). Then B1 can be B for the next 2.1. Board representations. The actual space used per game round, which we can align with B = B0, and so on. is primarily the representation of a chess position, plus a few The only tricky thing is figuring out which boards go with bits for bookkeeping. So, representing boards compactly gives m which. Although if B ! B0 it is easy to deduce m, it is not us a way to increase the number of simultaneous games we can possible to compute B from B0, or even from B0 and m.