\section{Introduction}

\generic{Setup:}
Suppose we toss a 6-sided die $n$ times. \par
It is easy to detect the first time we roll a 6. \par
What should we do if we want to detect the \textit{last}?

\problem{}<lastl>
Given $l \leq n$, what is the probability that the last $l$
tosses of this die contain exactly one six? \par
\hint{Start with small $l$.}

\begin{solution}
	$\mathcal{P}(\text{last } l \text{ tosses have exactly one 6}) = (\nicefrac{1}{6})(\nicefrac{5}{6})^{l-1} \times l$
\end{solution}

\vfill

\problem{}
For what value of $l$ is the probability in \ref{lastl} maximal? \par
The following table may help. \par
\note{We only care about integer values of $l$.}

\begin{center}
	\begin{tabular}{|| c | c | c ||}
		\hline
		\rule{0pt}{3.5mm} % Bonus height for exponent
		$l$ & $(\nicefrac{5}{6})^l$ & $(\nicefrac{1}{6})(\nicefrac{5}{6})^{l}$ \\
		\hline\hline
		0 & 1.00 & 0.167 \\
		\hline
		1 & 0.83 & 0.139 \\
		\hline
		2 & 0.69 & 0.116 \\
		\hline
		3 & 0.58 & 0.096 \\
		\hline
		4 & 0.48 & 0.080 \\
		\hline
		5 & 0.40 & 0.067 \\
		\hline
		6 & 0.33 & 0.056 \\
		\hline
		7 & 0.28 & 0.047 \\
		\hline
		8 & 0.23 & 0.039 \\
		\hline
	\end{tabular}
\end{center}

\begin{solution}
	$(\nicefrac{1}{6})(\nicefrac{5}{6})^{l-1} \times l$ is maximal at $l = 5.48$, so $l = 5$. \par
	$l = 6$ is close enough.
\end{solution}

\vfill

\problem{}
Finish your solution: \par
In $n$ rolls of a six-sided die, what strategy maximizes
our chance of detecting the last $6$ that is rolled? \par
What is the probability of our guess being right?

\begin{solution}
	Whether $l = 5$, $5.4$, or $6$, the probability of success rounds to $0.40$.
\end{solution}


\vfill
\pagebreak