\documentclass[answers]{exam}


\usepackage{circledsteps}
\usepackage[hidelinks]{hyperref}
\hypersetup{
    colorlinks=false,
    linkcolor=black,
    filecolor=magenta,      
    urlcolor=cyan,
    pdftitle={Digital Magic: An Introduction to Base Systems}
    }
\usepackage{nopageno}
\usepackage{tcolorbox}

\renewcommand{\questionlabel}{Q\thequestion.}


\pagestyle{headandfoot}
\firstpageheader{Parker Adey}{}{Wednesday June 3rd 2026}
\runningheader{Parker Adey}{Digital Magic}{Wednesday June 3rd 2026}

\newcommand{\define}[1]{\underline{#1}}

\newcommand{\binarycard}[2]{%
    \fbox{%
      \begin{minipage}{0.4\linewidth}
	\centering
	%\textbf{Card name: #1}
	\textbf{#1}
	\[
	\begin{array}{cccccccc}
	  #2
	\end{array}
	\]
      \end{minipage}
    }
}




\begin{document}

\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
{\Large
Digital Magic:  An Introduction to Base Systems
}
}}}
\end{center}

\hfill \noindent\makebox[0.4\textwidth]{Name:\enspace\hrulefill}

\vspace{0.5cm}
\section*{Learning the Trick}
		Split up in to pairs.
		One person in each pair will be the \define{participant} and the other will be the \define{magician}.
		The participant picks a secret number from $\{0, 1, 2, \dots, 63\}$.
		For each card below, the magician asks the participant: ``Is your number on this card?''
		The participant (honestly) answers ``Yes'' or ``No.''\\
		After going through all six cards below, the magician then tells the participant their secret number. \emph{Magic!}\\

		\noindent The magicians will need to read and understand the secret method before performing the trick.\\
		The secret method is available here: \url{https://pgadey.ca/notes/digital-magic-base-systems/}\\


		
	\begin{center}
		\binarycard{A}{
		%\Circled{1} 
		1 
		& 3 & 5 & 7 & 
		%{\color{red}\fbox{9}} 
		9 
		& 11 & 13 & 15 \\
		17 & 19 & 21 & 23 & 25 & 27 & 29 & 31 \\
		33 & 35 & 37 & 39 & 41 & 43 & 45 & 47 \\
		49 & 51 & 53 & 55 & 57 & 59 & 61 & 63
		}
		\binarycard{B}{
		2 & 3 & 6 & 7 & 10 & 11 & 14 & 15 \\
		18 & 19 & 22 & 23 & 26 & 27 & 30 & 31 \\
		34 & 35 & 38 & 39 & 42 & 43 & 46 & 47 \\
		50 & 51 & 54 & 55 & 58 & 59 & 62 & 63
		}\\

		\vspace{0.5cm}

		\binarycard{C}{
		4 & 5 & 6 & 7 & 12 & 13 & 14 & 15 \\
		20 & 21 & 22 & 23 & 28 & 29 & 30 & 31 \\
		36 & 37 & 38 & 39 & 44 & 45 & 46 & 47 \\
		52 & 53 & 54 & 55 & 60 & 61 & 62 & 63
		}
		\binarycard{D}{
		%\Circled{8} 
		8 
		& 
		%{\color{red}\fbox{9}} 
		9
		& 10 & 11 & 12 & 13 & 14 & 15 \\
		24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 \\
		40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}\\

		\vspace{0.5cm}

		\binarycard{E}{
		16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 \\
		24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 \\
		48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}
		\binarycard{F}{
		32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \\
		40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 \\
		48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}\\
	\end{center}


\begin{questions}
	\begin{question}
		In this question, you play the role of the magician.\\
		What is the participant's number if they say "Yes" to the following cards?
		\begin{parts}
			\part C, D
			\part A, D, E
			\part B, C, E, F
		\end{parts}	
	\end{question}	

	\begin{question}
		In this question, you play the role of the participant.\\	
		What cards do you say ``Yes'' to if your number is each of the following?
		\begin{parts}
			\part 12
			\part 25
			\part 0
		\end{parts}
	\end{question}

\newpage
\section*{Exploring The Mathematics of The Trick}

\begin{center}
		\binarycard{A}{
		1 & 3 & 5 & 7 & 9 & 11 & 13 & 15 \\
		17 & 19 & 21 & 23 & 25 & 27 & 29 & 31 \\
		33 & 35 & 37 & 39 & 41 & 43 & 45 & 47 \\
		49 & 51 & 53 & 55 & 57 & 59 & 61 & 63
		}
		\binarycard{B}{
		2 & 3 & 6 & 7 & 10 & 11 & 14 & 15 \\
		18 & 19 & 22 & 23 & 26 & 27 & 30 & 31 \\
		34 & 35 & 38 & 39 & 42 & 43 & 46 & 47 \\
		50 & 51 & 54 & 55 & 58 & 59 & 62 & 63
		}\\

		\vspace{0.5cm}

		\binarycard{C}{
		4 & 5 & 6 & 7 & 12 & 13 & 14 & 15 \\
		20 & 21 & 22 & 23 & 28 & 29 & 30 & 31 \\
		36 & 37 & 38 & 39 & 44 & 45 & 46 & 47 \\
		52 & 53 & 54 & 55 & 60 & 61 & 62 & 63
		}
		\binarycard{D}{
		8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
		24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 \\
		40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}\\

		\vspace{0.5cm}

		\binarycard{E}{
		16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 \\
		24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 \\
		48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}
		\binarycard{F}{
		32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \\
		40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 \\
		48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 \\
		56 & 57 & 58 & 59 & 60 & 61 & 62 & 63
		}\\
	\end{center}



	\begin{question}
		In this question, we try to determine how these cards make the magic happen.
		\begin{parts}
			\part How many numbers are on each card?
			\part Does the first number on each card follow a pattern?
			\part Do the numbers on each card follow any particular pattern?
		\end{parts}
	\end{question}

	\begin{tcolorbox}
		In binary, we write numbers as sums of powers of two.	
		For example,
		\[
			11
			= 8 + 2 + 1
			= 2^3 + 2^1 + 2^0
			= \fbox{1} \cdot 2^3 + \fbox{0} \cdot 2^2 + \fbox{1} \cdot 2^1 + \fbox{1} \cdot 2^0
			= 1011_2.
		\]
	\end{tcolorbox}

	\begin{question}
		In this question, we explore binary numbers and their relation to decimal.	
		\begin{parts}
			\part Convert $1101_2$ to decimal.
			\part Convert $7$ to binary.	
			\part Write the numbers $1$ through $7$ in binary.
		\end{parts}
	\end{question}

	\begin{question}
		In this question, imagine that you're a magician from Planet Binary.\\
		Draw a set of cards for the magic trick for $\{0, 1, \dots, 7\}$ by writing the numbers in the boxes below.

	    \fbox{%
	      \begin{minipage}{0.3\linewidth}
		\centering
		\textbf{A}
		\vspace{2cm}
	      \end{minipage}
	    }
	    \fbox{%
	      \begin{minipage}{0.3\linewidth}
		\centering
		\textbf{B}
		\vspace{2cm}
	      \end{minipage}
	    }
	    \fbox{%
	      \begin{minipage}{0.3\linewidth}
		\centering
		\textbf{C}
		\vspace{2cm}
	      \end{minipage}
	    }
	\end{question}

	\begin{question}
		\emph{Very Spicy}	
		A king has 100 barrels of wine, but one of them is poisoned. The poison only shows symptoms after 1 day, and he needs the wine soon after that.
		Not wanting to take the risk, he decides to have rats test the wine. How many rats does he need to identify the poisoned barrel in just one round of testing?
	\end{question}

\end{questions}


\begin{center}
	Feel free to ask me about mathematics / magic / university: \texttt{parker.glynn.adey@utoronto.ca}
\end{center}

\end{document}
