# Chess/Optional homework/Solutions

This page gives the solutions to all the problems in the optional homework. Please try to solve the problems yourself before you look here. The solutions are given in algebraic chess notation.

## Optional homework 1
### Problem 1

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
This is a standard endgame position. White sacrifices his h-pawn in order to queen his g-pawn. Using the diagram on the right, the following is the generalized plan:
* Move to any squares with a white dot (and stay on them) with an odd number of tempi (3 moves in this case) so the black king is forced to move to g7 (If the black king takes the g6 pawn or is on any square other than g7 or h8, the h-pawn can safely promote). Stay out of the squares with an X on it to avoid stalemate.
* Once your king is on any of the square with a white dot and the black king is on g7, promote the h-pawn.
* When the black king is forced to capture the newly promoted queen, move your king to f6 or h6.
* Black's only legal move at this point is to move the king to g8. When he does so, push the g-pawn. The black king will be forced to move off the 8th rank (to h7 if your king is at f6, or f7 if your king is at h6)
* Move your king to f7 if it is previously on f6, or h7 if it is on h6. The white pawn now has a safe path to promotion.
A sample variation would go like the following:
    1. Kf4 Kg7
    2. Kf5 Kh8
Any other move allows the h-pawn to queen.
    3. Kg5
Or Ke5 or Ke6, but not Kf6?? stalemate.
    3... Kg7
    4. h8=Q+ Kxh8
    5. Kf6! Kg8
    6. g7 Kh7
    7. Kf7 Kh6
    8. g8=Q Kh5
    9. Qg3 Kh6
    10. Qh4 mate.

### Problem 2

    1. Kb7!
White must not allow Black's king to reach c7 or c8 because White will not be able to queen the pawn. This is a special rule that applies only for a pawn on the edge of the board. Black's king will either stalemate White's king in the h8-corner, or it will block the pawn and be stalemated itself.
After the text move, White advances the pawn directly to h8 in 5 moves. There is nothing Black can do to stop this.

## Optional homework 2
### Problem 1

The Exchange Variation of the Ruy Lopez is defined by the following moves to open the game:
    1. e4 e5
    2. Nf3 Nc6
    3. Bb5 a6
    4. Bxc6 dxc6
Now if White plays
    5. Nxe5?!
Black responds
    5... Qd4!
Black's queen forks the e5-knight and the e4-pawn. White must defend or withdraw the knight and give up the pawn. Thus, Black achieves material equality with a slightly better position.
White's usual moves in the Exchange Variation are 5. O-O and 5. d4.

### Problem 2

This position can arise in the Exchange Variation of the Queen's Gambit Declined. The first moves are
    1. d4 d5
    2. c4 e6
    3. Nc3 Nf6
    4. Bg5 Nbd7
    5. cxd5 exd5
Now if White plays
    6. Nxd5??
Black responds
    6... Nxd5!
    7. Bxd8 Bb4+
    8. Qd2 Bxd2+
    9. Kxd2 Kxd8
Black exchanges queens and the dark-squared bishops, wins the exchange (knight for a pawn). Even though Black's knight on f6 was pinned to the queen, it can still move, so in this particular variation, it protects the pawn on d5. This is a well-known trap, played by Daniel Harrwitz in the 1850s.
White usually plays 6. e3 or 6. Nf3 instead. These moves provide an escape from the bishop check on b4, so Black must protect the d5-pawn with 6...c6 or 6...Be7.

## Optional homework 3
### Problem 1

The game Z. Djordjevic vs. M. Kovacevic, 1984, began with the following moves:
    1. d4 Nf6
    2. Bg5
This is the Trompowski-Torre attack.
    2... c6
    3. e3??
This move cuts off the bishop from returning to d2. 3. Nf3 or 3. Bxf6 were called for, but almost any move (such as 3. c4) would have allowed White to save his bishop by withdrawing it to d2.
    3... Qa5+
White resigned, as he loses his bishop to a queen fork while his king gets out of check.
This is the shortest serious tournament game in history, according to Tim Krabbé's chess records website.

### Problem 2

The game K. Shirazi vs. J. Peters, 1986 began with the following moves:
    1. e4 c5
    2. b4!?
This is the Sicilian Wing Gambit.
    2... cxb4
    3. a3 d5!
    4. exd5 Qxd5
    5. axb4??
White must play 5. Nf3 (or 5. Bb2) to prevent what happens next.
    5... Qe5+
Black's queen forks the White king and rook. White must get his king out of check, then Black captures the rook on a1.

## Optional homework 4
### Problem 1

* Rxe7+ Nxe7
* Qxd7+ Kxd7
* Bf5+ Ke8 (King has to move because it is a double check, and 3. ... Kc6? 4. Bd7#)
* Bd7+ Kd8
* Bxe7#

### Problem 2

    All the moves by black are forced.
* Nxg7+ Kd8
* Qf6+ Nxf6
* Be7#