\DocumentMetadata{
  lang = en-US,
  pdfstandard = ua-2,
  pdfversion = 2.0,
  testphase = {latest}
}

\documentclass[12pt]{article}

\tagpdfsetup{math/alt/use=true}

% -------------------------
% Course / assignment metadata
% Edit these once per assignment
% -------------------------
\newcommand{\coursecode}{EE 520}
\newcommand{\coursetitle}{Random Processes}
\newcommand{\quartername}{Fall 2026}
\newcommand{\assignmenttype}{Homework}
\newcommand{\assignmentnumber}{1}
\newcommand{\assignmenttitle}{Belief and the failed search}
\newcommand{\duedate}{October 9, 2026}
\newcommand{\studentname}{}
\newcommand{\instructorname}{John Lipor}

% Derived metadata strings
\newcommand{\fullcoursename}{\coursecode: \coursetitle}
\newcommand{\assignmentname}{\assignmenttype\ \assignmentnumber}
\newcommand{\fullassignmentname}{\assignmentname\ifx\assignmenttitle\empty\else: \assignmenttitle\fi}

% -------------------------
% Packages
% -------------------------
\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{xparse}
\usepackage{etoolbox}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{bbm}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algorithmic}
% \usepackage{enumitem}
\usepackage{titlesec}

% Links and PDF metadata
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
\usepackage{bookmark}
\urlstyle{same}
\hypersetup{
  pdftitle={\coursecode\ \fullassignmentname},
  pdfauthor={\instructorname},
  pdfsubject={\fullcoursename\ assignment},
  pdfcreator={LaTeX},
  pdfproducer={LaTeX with hyperref},
  pdfdisplaydoctitle=true
}

% Improve math environment tagging
\usepackage{tagpdf}
\tagpdfsetup{activate-all,uncompress}

% Header command
\newcommand{\makehomeworkheader}{%
  \thispagestyle{plain}
  \begingroup
  \setlength{\fboxsep}{8pt}
  \noindent\fbox{%
    \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}

      \noindent\textbf{\fullcoursename}\hfill \quartername\par

      \begin{center}
        {\LARGE \assignmentname\par}
        \ifx\assignmenttitle\empty\else
          {\large \assignmenttitle\par}
        \fi
        {\large Due: \duedate, 11:59 PM PT\par}
      \end{center}

      \noindent\textit{Student Name: \studentname}\hfill \textit{Instructor: \instructorname}\par
    \end{minipage}%
  }
  \endgroup
  \vspace{4mm}
}

% Section heading format used by \problem
\titleformat{\section}
  {\normalfont\normalsize\bfseries}
  {}
  {0pt}
  {}

% Problem headings
\newcounter{problem}
\NewDocumentCommand{\problem}{O{} O{}}{%
  \refstepcounter{problem}%
  \par\medskip
  \section*{\normalfont\normalsize\bfseries
    Problem \theproblem%
    \ifstrempty{#1}{}{\,: #1}%
    \ifstrempty{#2}{}{\normalfont\; [#2]}%
  }%
  \addcontentsline{toc}{section}{Problem \theproblem}%
}

% Use alpha labels for enumerate subproblems
\renewcommand{\labelenumi}{(\alph{enumi})}
\renewcommand{\theenumi}{\alph{enumi}}

% Solution command
\newcommand{\solution}{%
  \par\smallskip
  \noindent\textbf{Solution.}\enspace
}

% My math macros
% theorem type environments
\newtheorem{thm}{Theorem}
\newtheorem{prop}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{cor}{Corollary}
\newtheorem{defn}{Definition}
\newtheorem{assump}{Assumption}
\newtheorem{example}{Example}
\newtheorem{conjecture}{Conjecture}

% frequently used symbols
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bP}{\mathbb{P}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bZ}{\mathbb{Z}}
\newcommand{\sC}{{\mathcal C}}
\newcommand{\sD}{{\mathcal D}}
\newcommand{\sE}{{\mathcal E}}
\newcommand{\sF}{{\mathcal F}}
\newcommand{\sL}{{\mathcal L}}
\newcommand{\sH}{{\mathcal H}}
\newcommand{\sN}{{\mathcal N}}
\newcommand{\sO}{{\mathcal O}}
\newcommand{\sP}{{\mathcal P}}
\newcommand{\sR}{{\mathcal R}}
\newcommand{\sS}{{\mathcal S}}
\newcommand{\sU}{{\mathcal U}}
\newcommand{\sX}{{\mathcal X}}
\newcommand{\sY}{{\mathcal Y}}
\newcommand{\sZ}{{\mathcal Z}}

% operators
\newcommand{\sign}{\mathop{\mathrm{sign}}}
\newcommand{\supp}{\mathop{\mathrm{supp}}}
\newcommand{\argmin}{\operatornamewithlimits{arg\,min}}
\newcommand{\argmax}{\operatornamewithlimits{arg\,max}}
\newcommand{\dist}{\operatorname{dist}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\vecop}{\operatorname{vec}}
\newcommand{\st}{\operatorname{s.t.}}
\newcommand{\cut}{\setminus}
\newcommand{\ind}[1]{\mathbbm{1}\left\{#1\right\}}
\newcommand{\given}{\,|\,}

% grouping operators
\newcommand{\brac}[1]{\left[#1\right]}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\paren}[1]{\left(#1\right)}
\newcommand{\norm}[1]{\left\|#1\right\|}
\newcommand{\ip}[2]{\left\langle #1,#2 \right\rangle}

% code commands
\newcommand{\matlab}{\textsc{Matlab}}
\newcommand{\python}{\textsc{Python}}


\begin{document}

\makehomeworkheader

\section*{Instructions}
Submit your work as a PDF through the course submission system. If you need an accommodation or an alternate format, contact the instructor.

\noindent \textbf{Note:} For all questions asked in this course, unless the question is simply asking about definitions, please justify all answers. Stating the correct answer without justification will earn no credit. For example, if you write down a string of equations, each successive equation should be accompanied by some justification such as ``by the additivity axiom'' or ``because the outcomes are equally likely'' or ``by the distributive property of set operations.'' You do not need to justify algebra.

% ============================================================
% Problem 1 
% ============================================================
\problem[The wreck in the grid][5 pts each]

A vessel is lost in one of four seafloor regions with prior probabilities $p = (0.7, 0.15, 0.1, 0.05)$. A side-scan sonar pass over a region \emph{containing} the wreck detects it with probability $1 - \alpha$, where $\alpha = 0.4$ is the overlook probability (rough terrain). A pass over an empty region never produces a detection.

\begin{enumerate}
  \item The team searches region~1 and finds nothing. Compute the posterior over all four regions. Verify it sums to one.
  \item Show that the searched region's probability strictly decreased while every unsearched region's probability increased \emph{by the same multiplicative factor}. Interpret in one sentence: where does the probability ``flow''?
  \item The team searches region~1 again and again finds nothing. Compute the new posterior. After how many consecutive failed passes of region~1 does region~2 become the most probable region?
  \item  Session~2 proves that after $n$ consecutive failed searches of a cell with prior $p$ and overlook probability $\alpha$, its posterior is $p\,\alpha^n / (p\,\alpha^n + 1 - p)$. For a general tolerance $\varepsilon \in (0,1)$, derive in closed form (via logarithms) the smallest $n$ for which this posterior falls below $\varepsilon$. State the inequality carefully: which way does the sign flip when you divide by $\ln\alpha$, and why? Evaluate your bound for the numbers of part~(a) with $\varepsilon = 0.01$. Finally, what happens to your $n$ as $\alpha \to 1$, and why does that make sense?
\end{enumerate}

% ============================================================
% Problem 2
% ============================================================
\problem[The flagged channel][5 pts each]

A spectrum sensor monitors a channel that is occupied $4\%$ of the time. When the channel is occupied, the detector flags it with probability $0.9$; when idle, it false-alarms with probability $0.075$.

\begin{enumerate}
  \item \emph{Before computing anything}: identify the latent variable, the observation, the prior, and the likelihood. Then compute the probability the channel is actually occupied given a flag.
  \item Redo the computation in odds form: posterior odds $=$ prior odds $\times$ likelihood ratio. Which form makes it more obvious \emph{why} the answer is far from $0.9$?
\end{enumerate}

% ============================================================
% Problem 3
% ============================================================
\problem[Three coins][5 pts]

You flip three fair coins. At least two are alike, and there is an even chance that the third is a head or a tail. Therefore the probability that all coins show the same side is equal to $1/2$. Do you agree? Provide both your intuited and computed answers.

% ============================================================
% Problem 4
% ============================================================
\problem[One look, best look][5 pts]

With the prior and overlook probability of Problem~1, suppose each region $i$ costs $c = (1, 1, 2, 4)$ hours to search and you have time for exactly one pass. If your objective is probability of detection per hour, which region do you search? Prove that for a single look, searching the region maximizing $p_i(1 - \alpha_i)/c_i$ is optimal among all single-look strategies. (Session~3 states this allocation rule without proof; supplying the proof is your task here.)

% ============================================================
% Problem 5
% ============================================================
\problem[Posterior heat map][10 pts]

Simulate a $10 \times 10$ grid with a prior of your choosing (\emph{not} uniform) and overlook probability $\alpha = 0.3$. Script a sequence of $25$ greedy searches (always search the current-posterior-maximizing cell; the target's true cell is drawn once from the prior).

\noindent\textbf{Before running:} predict in one sentence what the posterior map will look like if the target happens to be in a low-prior cell.

\noindent\textbf{Turn in:} posterior heat maps after $5$, $15$, and $25$ failed/successful looks, your prediction versus what happened, and your code.

% ============================================================
% Problem 6
% ============================================================
\problem[Audit the TA-bot][5 pts]

An AI assistant was asked: \emph{``A monitoring channel is busy $10\%$ of the time. A detector flags a busy channel with probability $0.85$ and false-alarms on an idle channel with probability $0.15$. Given a flag, how likely is the channel to be busy?''} It answered:

\begingroup
\setlength{\fboxsep}{8pt}
\noindent\fbox{%
  \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
    \noindent\textbf{TA-bot writes:} We use the odds form of Bayes' rule. The likelihood ratio is $L = \bP(\text{flag} \given \text{busy})/\bP(\text{flag} \given \text{idle}) = 0.85/0.15 = 17/3$. The posterior odds of busy versus idle are therefore $17 : 3$, giving $\bP(\text{busy} \given \text{flag}) = 17/20 = 0.85$. Sanity check: the detector is highly reliable, so a high posterior makes sense.
  \end{minipage}%
}
\endgroup

\medskip
\noindent This solution contains \textbf{exactly one error}.
\begin{enumerate}
  \item Identify the first line that goes wrong.
  \item Name the violated principle in one sentence, citing the session.
  \item Give the corrected posterior.
  \item One sentence: why is this a mistake a language model plausibly makes?
\end{enumerate}

% ============================================================
% Problem 7
% ============================================================
\problem[Reflection / Meta-Learning][5 pts]

Read Chapter~1 of \href{https://raktimchatterjee.wordpress.com/wp-content/uploads/2015/09/solving-mathematical-problems-terence-tao.pdf}{Solving Mathematical Problems} by Terence Tao, and answer the following questions \textbf{in the \texttt{interesting-reading} channel on Discord}.
\begin{itemize}
  \item Among the problem solving strategies discussed, have you used any (whether implicitly or explicitly) in this course so far or in other courses?
  \item Among the problem solving strategies discussed, which do you think would be helpful to use going forward?
\end{itemize}

\end{document}
