\documentclass[12pt,a4paper]{article}
\usepackage[margin=0.7in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\usepackage{parskip}
\usepackage{titlesec}

\titleformat{\section}{\large\bfseries}{}{0em}{}

\begin{document}

\begin{center}
    {\Large \textbf{Waiting Times for Patterns in Coin Tosses}}\\\vspace*{2cm}
\end{center}    

\begin{center}
    \textbf{Name:} \underline{\hspace{6cm}} \hfill \textbf{Date:} \underline{\hspace{3cm}}
\end{center}

\vspace{1em}

\section*{Question 1}
For a fair coin, compute the expected waiting time for the pattern \texttt{HTH}.  
Define the states
\[
S_0:\text{ no match}, \qquad S_1:\text{ H}, \qquad S_2:\text{ HT}, \qquad S_3:\text{ HTH (done)}.
\]
Write equations for the expected remaining tosses $E_0,E_1,E_2$ and solve for $E_0$.

\vspace{7cm}

\newpage

\section*{Question 2}
The expected waiting time $E[\tau_A]$ for a fixed pattern $A$ in fair-coin tosses is always finite.  
Is there an analogue of a “discount factor” here?  
Explain why pattern overlaps affect $E[\tau_A]$ but cannot make it diverge.

\vspace{8cm}

\section*{Question 3}
In your simulation estimating empirical waiting times, you used a running average of the number of tosses across trials.
\begin{enumerate}[label=(\alph*)]
\item Why does this average converge to the theoretical expectation?
\item What would happen to the plot if you plotted the cumulative sum instead of the average?
\end{enumerate}

\vspace{8cm}

\end{document}