<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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{}&lt;lastl&gt;
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$ &amp; $(\nicefrac{5}{6})^l$ &amp; $(\nicefrac{1}{6})(\nicefrac{5}{6})^{l}$ \\
		\hline\hline
		0 &amp; 1.00 &amp; 0.167 \\
		\hline
		1 &amp; 0.83 &amp; 0.139 \\
		\hline
		2 &amp; 0.69 &amp; 0.116 \\
		\hline
		3 &amp; 0.58 &amp; 0.096 \\
		\hline
		4 &amp; 0.48 &amp; 0.080 \\
		\hline
		5 &amp; 0.40 &amp; 0.067 \\
		\hline
		6 &amp; 0.33 &amp; 0.056 \\
		\hline
		7 &amp; 0.28 &amp; 0.047 \\
		\hline
		8 &amp; 0.23 &amp; 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</pre></body></html>