From 11bd085595b181daa1150270b8f38ec9ec45cbe8 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 5 Dec 2023 17:31:19 -0800 Subject: [PATCH] Refactor retrograde --- Advanced/Retrograde Analysis/main.tex | 116 +++++++++++- Advanced/Retrograde Analysis/parts/easy.tex | 172 +++++++++++++++--- Advanced/Retrograde Analysis/parts/hard.tex | 2 +- Advanced/Retrograde Analysis/parts/intro.tex | 17 +- Advanced/Retrograde Analysis/parts/medium.tex | 106 +++++++++-- 5 files changed, 360 insertions(+), 53 deletions(-) diff --git a/Advanced/Retrograde Analysis/main.tex b/Advanced/Retrograde Analysis/main.tex index 8814433..2884a42 100755 --- a/Advanced/Retrograde Analysis/main.tex +++ b/Advanced/Retrograde Analysis/main.tex @@ -13,6 +13,47 @@ \usepackage{afterpage} \usepackage[hang]{footmisc} +% A row of stars, for showing difficulty +% first arg: filled stars +% second arg: total stars +\def\liststars#1#2{% + \def\oncolor{\color{ogrape}}% + \def\offcolor{\color{white}}% + % + \count255=1% + \count254=#2% + \advance\count254 by -1% + \ifnum #1 > 0 + % The $$ are required around \bigstar. + % the special \odot chess piece breaks + % star sizing if they are ommited. + \loop + {\oncolor $\bigstar$}% + \ifnum\count255 < #1 + \advance\count255 by 1 + \repeat% + \else% + {\oncolor $\bigstar$}% + \fi% + % + \ifnum \count255 < #2% + \loop + {\offcolor $\bigstar$}% + \ifnum\count255 < \count254 + \advance\count255 by 1 + \repeat% + \fi% +} + + +\def\startimes#1{ + {\color{ogrape} $\bigstar \times #1$} +} + +\def\starvalue#1{ + \stars{#1}{#1} \par + \vspace{1mm} +} \def\difficulty#1#2{ \textbf{Difficulty:} \stars{#1}{#2} \par @@ -60,8 +101,20 @@ $\odot$}} \chessboard[setpieces = {#1}] \fi } -\makeatother +\@makeORMCbox{hintlist} + {Available Hints} + {black!12!white} + {black!80!white} + +\long\def\hintcontent#1#2#3{ + \if@solutions + \liststars{#1}{#2} \par #3 + \else + \liststars{#1}{#2} + \fi\par +} +\makeatother @@ -83,18 +136,71 @@ $\odot$}} } + \section{Rules} + + This handout contains a set of problems. \par + Each is marked with a few gold stars, which you collect by presenting a solution. + + \vspace{2mm} + + Below each problem is a list of hints, written next to their cost. \par + To get a hint, you must pay the marked number of stars. \par + Hints are usually provided in order, and are the same for all groups. \par + + \vspace{2mm} + + There is one exception: instructors may offer certain hints for a reduced fee, + judging by your explanation of what you have so far. + + \begin{instructornote} + This exception is for groups that are stuck on the last bit of a problem. \par + If they've solved most of it, give them the information they already know + for a steep discount (or even for free). + \end{instructornote} + + + + An example problem is below. + + \vspace{4mm} + + \generic{Problem $0$:} + \starvalue{4} + + This is a problem that's worth four points. \par + Two hints are available. The first costs two stars (of the four available). \par + The second costs one of the two stars available \textit{after} revealing the first hint. + + \begin{hintlist} + Hint 1: + \hintcontent{2}{4}{This is a hint. Only instructors see this.} + + Hint 2: + \hintcontent{1}{2}{This is another hint.} + \end{hintlist} + + \vfill + + You may notice that hints often cost a significant fraction of their problem's score. \par + This is intentional---don't ask for hints unless you're very, very stuck. + + + + + \vfill + \pagebreak + \input{parts/intro} \section{Simple problems} \input{parts/easy} - - \section{Harder problems} + \section{Slightly harder problems} \input{parts/medium} - \section{Very difficult problems} - \input{parts/hard} + %\section{Very difficult problems} + %\input{parts/hard} \chessboard \hfill \chessboard \par \chessboard \hfill \chessboard \par diff --git a/Advanced/Retrograde Analysis/parts/easy.tex b/Advanced/Retrograde Analysis/parts/easy.tex index 0964925..36079b6 100644 --- a/Advanced/Retrograde Analysis/parts/easy.tex +++ b/Advanced/Retrograde Analysis/parts/easy.tex @@ -1,6 +1,7 @@ % Sherlock, A little exercise \problem{A little exercise} -\difficulty{1}{5} +%\difficulty{1}{5} +\starvalue{3} Black has just moved in the game below. White started on the south side of the board.\par What was Black's last move, and what was White's last move? \par @@ -11,9 +12,17 @@ What was Black's last move, and what was White's last move? \par Bg1 } +\begin{hintlist} + Hint 1: + \hintcontent{1}{3}{What was Black's last move? What White do to make this happen?} + + Hint 2: + \hintcontent{1}{2}{White uncovered a check. What piece did Black capture?} +\end{hintlist} + \begin{solution} It's pretty clear that Black just moved out of check from A7. - + \vspace{2mm} How did White deliver this check? The bishop couldn't have moved to G1, @@ -37,9 +46,15 @@ What was Black's last move, and what was White's last move? \par + + + + + % Sherlock, Which color? \problem{Which color?} -\difficulty{2}{5} +%\difficulty{2}{5} +\starvalue{4} In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. There is a pawn at G3. What color is it? \par \hint{Again, White started on the bottom.} @@ -51,6 +66,16 @@ There is a pawn at G3. What color is it? \par Pd2,Pf2 } +\begin{hintlist} + Hint 1: + \hintcontent{2}{4}{How did the white king get off E1? It must have castled!} + + Hint 2: + \hintcontent{1}{2}{ + It castled kingside (how do we know?). Now, how did it get off G1? + } +\end{hintlist} + \begin{solution} The white king is the key to this solution. How did it get off of E1? \par It must have castled kingside---castling queenside would move a rook from black to white. @@ -67,13 +92,23 @@ There is a pawn at G3. What color is it? \par + + + + + + + + + + % Arabian Knights 2 \problem{Invisible, but not invincible} -\difficulty{2}{5} +%\difficulty{2}{5} +\starvalue{4} -Seeing that this battle was lost, the black king has turned himself invisible. \par -Unfortunately, his position is hopeless. Mate the king in one move. \par -\hint{You don't need to find the king, you only need a checkmate.} \par +The black king has turned himself invisible. Unfortunately, his position is hopeless. \par +Mate the king in one move. \par \manyboards{ Ra8,rb8,Kf8, @@ -81,6 +116,14 @@ Unfortunately, his position is hopeless. Mate the king in one move. \par Pa6,Rc6 } +\begin{hintlist} + Hint 1: + \hintcontent{1}{4}{Do you need to know \textit{exactly} where the black king is?} + + Hint 2: + \hintcontent{1}{3}{Don't forget about promotion.} +\end{hintlist} + \begin{solution} Since it is White's move, Black cannot be in check. \par So, either White is in check or the black king is on C8. \par @@ -97,9 +140,14 @@ Unfortunately, his position is hopeless. Mate the king in one move. \par \pagebreak + + + + % Sherlock, a question of survival \problem{An empty board} -\difficulty{2}{5} +%\difficulty{2}{5} +\starvalue{4} In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. There is one more piece on the board, which isn't shown. What color square does it stand on? \par @@ -109,6 +157,11 @@ There is one more piece on the board, which isn't shown. What color square does Ke1 } +\begin{hintlist} + Hint 1: + \hintcontent{1}{4}{Which piece performed the last capture?} +\end{hintlist} + \begin{solution} Which piece performed the last capture on a black square? It couldn't have been a white pawn, which haven't moved. @@ -126,7 +179,8 @@ There is one more piece on the board, which isn't shown. What color square does % Sherlock, another monochromatic \problem{The knight's grave} -\difficulty{3}{5} +%\difficulty{3}{5} +\starvalue{5} In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. The white king has made less than fourteen moves. \par Use this information to show that a pawn was promoted. \par @@ -137,6 +191,20 @@ Use this information to show that a pawn was promoted. \par Ke1 } +\begin{hintlist} + Hint 1: + \hintcontent{1}{5}{ + \par + Who took the knights? Only one of them is interesting---most are easy to account for. + \vspace{2mm} + } + + + Hint 2: + \hintcontent{2}{4}{We can easily account for the white knights and the + black knight on G8. Which white pieces can move to capture the black knight on B8?} +\end{hintlist} + \begin{solution} Knights always move to a different colored square, so all four missing knights must have been captured on their home square. What pieces captured them? @@ -156,9 +224,13 @@ Use this information to show that a pawn was promoted. \par + + + % Arabian Knights, intro (given with solution) \problem{Promotion?} -\difficulty{2}{5} +%\difficulty{2}{5} +\starvalue{6} It is White's move. Have there been any promotions this game? \par @@ -167,6 +239,14 @@ It is White's move. Have there been any promotions this game? \par Bc1,Kd1,Rh1 } +\begin{hintlist} + Hint 1: + \hintcontent{3}{6}{ + The black king must have moved from F1. (Why not G1?) \par + This would be impossible if something hadn't blocked check from the white rook. + } +\end{hintlist} + \begin{solution} Since it is White's move, Black has just moved his king. Where did he move it from? @@ -192,9 +272,11 @@ It is White's move. Have there been any promotions this game? \par % Sherlock Holmes, two bagatelles (1) \problem{Whodunit} -\difficulty{2}{5} +%\difficulty{2}{5} +\starvalue{5} It is Black's move. Can Black castle? \par +\hint{Remember the rules of chess: you may not castle if you've moved your rook.} \manyboards{ ra8,bc8,ke8,rh8, @@ -205,22 +287,30 @@ It is Black's move. Can Black castle? \par Bc1,Qd1,Ke1,Bf1 } +\begin{hintlist} + Hint 1: + \hintcontent{1}{5}{ + Black captured a knight on his last move. \par + Why do we know this, and how did he do it? + } +\end{hintlist} + \begin{solution} White's last move was with the pawn. \par Black's last move must have been to capture the white piece which moved before that. - + \vspace{2mm} This piece would have to have been a knight, since the white rooks could not have got out onto the board. It is clear that none of the black pawns captured this knight. The black rook on A8 couldn't have captured it either, because there is no square that the knight could have moved from to get to that position. - + \vspace{2mm} The black bishop couldn't have captured the knight either, since the only square the knight could have come from is D6, where it would have been checking the king. - + \vspace{2mm} So, the black king or the rook on H8 made this capture. Therefore, Black can't castle. @@ -232,10 +322,12 @@ It is Black's move. Can Black castle? \par % Sherlock Holmes, two bagatelles (2) \problem{Castle contradiction} -\difficulty{2}{5} +%\difficulty{2}{5} +\startimes{7} Neither Black nor White captured a piece on their last move. \par It is Black's move. Can he castle? \par +\hint{What was White's last move? Check the cases.} \manyboards{ ke8,rh8, @@ -245,17 +337,23 @@ It is Black's move. Can he castle? \par bd1,Rf1,Kg1 } +\begin{hintlist} + Hint 1: + \hintcontent{2}{7}{If White moved his king, Black cannot castle. Why? \par + That's the simple case. The other option: White castled. What did Black do before that?} +\end{hintlist} + \begin{solution} If White's last move was with the king, then the black rook moved to check him and Black can't castle. - + \vspace{2mm} If White's last move wasn't with the king, White must have castled. \par What was Black's last move? \par If it was with the king or rook, Black can't castle. - + \vspace{2mm} - + It could not have been with the bishop, since then White would have had no move immediately before that. Now, suppose Black moved his pawn. Then White's preceding move must have been with the pawn from E2, capturing a piece on F3. This means that the bishop on D1 is a promoted bishop. The promoting pawn must @@ -270,10 +368,12 @@ It is Black's move. Can he castle? \par % Arabian Knights, intro (given with solution) \problem{A matter of order} -\difficulty{3}{5} +%\difficulty{3}{5} +\startimes{8} A black bishop captured a White piece earlier in this game. \par Which bishop was it, and what did it capture? \par +\hint{Black and White start with 16 pieces each.} \manyboards{ ra8,qd8,ke8, @@ -286,16 +386,34 @@ Which bishop was it, and what did it capture? \par Kc1,Rd1,Rh1 } -\begin{instructornote} - \textbf{Hints to give:} (these should be answered in order) - \begin{itemize} - \item How many pieces does Black have? Where were the missing ones captured? - \item Which pieces is White missing? Where could they have been captured? - \item How did those white pieces get to the place they were captured? - \end{itemize} +\begin{hintlist} + Hint 1: + \hintcontent{1}{8}{ + \begin{itemize} + \item How many pieces are missing? Where were the missing ones captured? + \item How did those pieces get to the place they were captured? + \end{itemize} + \vspace{2mm} + } -\end{instructornote} + Hint 2: + \hintcontent{2}{7}{ + \begin{itemize} + \item The pawn on C3 came from D2, capturing a black rook. + \item The black rook it captured couldn't have moved there before... + \end{itemize} + \vspace{2mm} + } + + Hint 3: + \hintcontent{1}{4}{ + \begin{itemize} + \item ...the black pawn on G7 captured a white piece on H6. + \item What else is missing? + \end{itemize} + } +\end{hintlist} \begin{solution} First, notice that the pawn on C3 came from D2 by capturing a piece. \par diff --git a/Advanced/Retrograde Analysis/parts/hard.tex b/Advanced/Retrograde Analysis/parts/hard.tex index 6c0bff2..9afeb15 100644 --- a/Advanced/Retrograde Analysis/parts/hard.tex +++ b/Advanced/Retrograde Analysis/parts/hard.tex @@ -69,7 +69,7 @@ Show that he must be on C7. Black is in check, so we know that it is Black's move and White is not in check.\par Assume the white king is not on C7. Where else could he hide? First, we exclude the black pawns on A6, A7, and B5, since the white king would be in check in any of those positions. \par - + \vspace{2mm} The pawn on A6 came from B7 by capturing one piece, and the pawn on B5 came from D7 by capturing two. diff --git a/Advanced/Retrograde Analysis/parts/intro.tex b/Advanced/Retrograde Analysis/parts/intro.tex index ceb4ef1..74a7f14 100644 --- a/Advanced/Retrograde Analysis/parts/intro.tex +++ b/Advanced/Retrograde Analysis/parts/intro.tex @@ -28,7 +28,7 @@ This is called an \textit{en passant} capture (Which means \say{in passing} in F ] White moves two squares - \end{center} + \end{center} \end{minipage} \hfill \begin{minipage}{0.3\textwidth} @@ -98,7 +98,7 @@ A king and rook can \textit{castle} under the following conditions: \draw[ocyan,line width=0.1em,->] (e1)--(c1); }, - hmarginwidth=0mm + hmarginwidth=0mm ] Possible castle directions @@ -136,5 +136,18 @@ A king and rook can \textit{castle} under the following conditions: \end{minipage} \par +\vfill + +\generic{General Strategies:} +Below is a list of questions you'll want to ask yourself if you get stuck. \par +\note[Note]{Yes, I know you don't have the problems yet. Patience.} + +\begin{itemize} + \item What was the last move? (By black or white) + \item Were there any promotions? This may be indirect:\par + if White needs a third bishop, there was a promotion.\par + \note{Promotions often resolve seemingly impossible situations.} +\end{itemize} + \vfill \pagebreak \ No newline at end of file diff --git a/Advanced/Retrograde Analysis/parts/medium.tex b/Advanced/Retrograde Analysis/parts/medium.tex index aa58847..239f267 100644 --- a/Advanced/Retrograde Analysis/parts/medium.tex +++ b/Advanced/Retrograde Analysis/parts/medium.tex @@ -1,7 +1,8 @@ % Sherlock, A matter of direction \problem{A matter of direction} -\difficulty{3}{5} +%\difficulty{3}{5} +\starvalue{5} The results of a game of chess are shown below. \par Did White start on the north or south side of the board? \par @@ -14,6 +15,11 @@ Did White start on the north or south side of the board? \par Bh1 } +\begin{hintlist} + Hint 1: + \hintcontent{2}{5}{The bishop on H1 is important. How did White deliver this check?} +\end{hintlist} + \begin{solution} Let us first find White's last move. It wasn't with the pawns on D4 and E5, since Black wouldn't have a move before that. (Note the double-check on A7). @@ -29,11 +35,15 @@ Did White start on the north or south side of the board? \par + + + % Arabian Knights 1 \problem{Where is the king?} -\difficulty{3}{5} +%\difficulty{3}{5} +\startimes{8} -The white king has turned himself invisible. Find him. \par +The white king has again become invisible. Find him. \par \hint{White started on the bottom. En passant.} \par \manyboards{ @@ -42,6 +52,30 @@ The white king has turned himself invisible. Find him. \par kd1 } + +\begin{hintlist} + Hint 1: + \hintcontent{3}{8}{ + Either the white king is on B3, or Black is in check. \par + First, show that the latter implies the former. + \vspace{2mm} + } + + Hint 2: + \hintcontent{2}{5}{ + Moving back in time, you'll need to add two pieces to the board (not counting the king). \par + They have been captured! + \vspace{2mm} + } +\end{hintlist} + +\makeatletter +\if@solutions + \vfill + \pagebreak +\fi +\makeatother + \begin{solution} Looking at the board, we see that the white king is on B3 or Black is in check. @@ -77,7 +111,7 @@ The white king has turned himself invisible. Find him. \par White: C2 $\to$ C4 \par Black: B4 $\to$ C3 (en passant capture) \par White: B3 $\to$ C3 \par - So, the white king must be on C3. + So, the white king must be on C3. \end{minipage} \end{solution} @@ -86,9 +120,22 @@ The white king has turned himself invisible. Find him. \par \pagebreak + + + + + + + + + + + + % Arabian Knights, intro (given with solution) \problem{Double-checks} -\difficulty{3}{5} +%\difficulty{3}{5} +\startimes{10} White to move. Which side of the board did each color start on? \par \hint{What was Black's last move? } @@ -99,17 +146,19 @@ White to move. Which side of the board did each color start on? \par Nd1,kf1,Kh1 } -\begin{instructornote} - \textbf{Hints to give:}\par - Clearly, Black just moved his king. From where? \par - All possible positions may seem impossible (thanks to double-checks), but E1 and F2 are a bit more reasonable than others. - Move the king to both and try to add (or un-promote) pieces to make the position make sense. -\end{instructornote} +\begin{hintlist} + Hint 1: + \hintcontent{4}{10}{ + Double-checks make all positions seem impossible... \par + Try E1 and F2 anyway. Can you add pieces to make it make sense? \par + Don't forget about promotion. + } +\end{hintlist} \begin{solution} Black's last move was from F2, where his king was in double-check from both a rook and a knight. How did this happen? - + \vspace{2mm} White started on the north side of the board, and put Black in check by capturing a piece on D1 with @@ -133,6 +182,17 @@ White to move. Which side of the board did each color start on? \par + + + + + + + + + + + % Arabian Knights 4 \problem{A missing piece} \difficulty{4}{5} @@ -151,6 +211,16 @@ What is it, and what is its color? \par Kc1,Rd1,nf1,Bh1 } +\begin{hintlist} + Hint 1: + \hintcontent{4}{10}{ + Double-checks make all positions seem impossible... \par + Try E1 and F2 anyway. Can you add pieces to make it make sense? \par + Don't forget about promotion. + } +\end{hintlist} + + \begin{instructornote} \textbf{Hints to give:} (in this order) \begin{itemize} @@ -173,21 +243,21 @@ What is it, and what is its color? \par \begin{solution} \textbf{Part 1:} - The black bishop on A2 cannot be original, since the white pawn on B3 would have prevented its getting there. + The black bishop on A2 cannot be original, since the white pawn on B3 would have prevented it from getting there. That bishop is a promoted bishop. \par - + The black pawn it was promoted from must have come from E7, captured four pieces to get to A3, then moved to A2, and then made a capture on B1, where it was promoted. \par Thus, the pawn from E7 has made five captures. - + \vspace{2mm} - + The white bishop from from C1 never left its home square - (since neither of the pawns on B2 or D2 have moved), and hence was captured on C1. This makes six captures of + (since neither of the pawns on B2 or D2 have moved), and hence was captured on C1. This makes six captures of white pieces, which tells us that the mystery piece is black. - + \vspace{2mm} \textbf{Part 2:}