\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}{6}
\newcommand{\assignmenttitle}{Gaussian vectors and fusion}
\newcommand{\duedate}{November 27, 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[Build the covariance][5 pts each]

Two hydrophones measure the same source amplitude $A \sim \sN(0, 4)$. Sensor $i$ reports
\[
  Y_i = A + W_i, \qquad i = 1, 2,
\]
where the noises $W_1, W_2$ are zero-mean, each with variance $1$, are independent of $A$, and share a common interference component so that $\operatorname{Cov}(W_1, W_2) = \rho$.
\begin{enumerate}
  \item Write the covariance matrix of the vector $(A, Y_1, Y_2)$. For what values of $\rho$ is your matrix a valid covariance matrix?
  \item At each extreme, $\rho = 1$ and $\rho = -1$, your matrix is singular. For each, find a nonzero linear combination of $A$, $Y_1$, $Y_2$ that has zero variance, and say in one sentence what it means physically and what fusing the two sensors should then be worth. (Problem~4's MSE formula should confirm both answers.)
  \item Form the sum and difference channels $S = Y_1 + Y_2$ and $D = Y_1 - Y_2$. Use affine propagation to find the covariance matrix of $(A, S, D)$, and show that $D$ is uncorrelated with both $A$ and $S$. Then suppose instead that the noise variances were unequal, $\operatorname{Var}(W_1) = \sigma_1^2 \neq \sigma_2^2 = \operatorname{Var}(W_2)$, all else unchanged: show that $D$ is still uncorrelated with $A$, but now $\operatorname{Cov}(S, D) = \sigma_1^2 - \sigma_2^2$. In one sentence: $D$ carries no trace of $A$ in either case, so why could it help estimate $A$ when $\sigma_1 \neq \sigma_2$, but not in this problem?
\end{enumerate}

\problem[Uncorrelated $\neq$ independent][5 pts each]

\begin{enumerate}
  \item Let $X \sim \sN(0, 1)$ and $Y = X^2$. Show that $X$ and $Y$ are uncorrelated but not independent, and explain why $(X, Y)$ is \emph{not} a Gaussian random vector.
  \item The pair in (a) fails to be jointly Gaussian for an obvious reason: $Y$ is not even Gaussian. Here is a subtler pair, the one Session~13's pitfall promised. Let $S$ be a random sign, $\bP(S = 1) = \bP(S = -1) = \tfrac12$, independent of $X \sim \sN(0, 1)$, and let $Z = SX$. Show that $Z \sim \sN(0, 1)$, that $X$ and $Z$ are uncorrelated, and that they are not independent. Then show that $(X, Z)$ is not a Gaussian random vector.
  \item Pretend that $(X, Z)$ were a Gaussian vector with the covariance matrix you found in (b), and use Session~13's conditioning formula to predict $\bE[X \given Z = z]$ and $\operatorname{Var}(X \given Z = z)$. Now find the true conditional distribution of $X$ given $Z = z$. Which of the formula's two predictions survives, which fails, and which property of Gaussian conditioning does the failure violate? Finally, check that the formula's variance is nonetheless right \emph{on average} over $Z$.
\end{enumerate}

\problem[Gaussian conditioning][5 pts each]

Let $X = (X_1, X_2, X_3)$ be a zero-mean Gaussian random vector with covariance
\[
  C = \begin{bmatrix}
    5 & 2 & 2 \\
    2 & 5 & 2 \\
    2 & 2 & 5
  \end{bmatrix}.
\]
\begin{enumerate}
  \item Find $\bE[X_1 \given X_2, X_3]$ and the conditional variance.
  \item Compare the conditional variance to $\operatorname{Var}(X_1)$. This reduction is the entire business model of measurement: give one sentence connecting it to Homework~3 Problem~5 (the value of a measurement).
\end{enumerate}

\problem[Fusion][5 pts each]

For the setup of Problem~1:
\begin{enumerate}
  \item Derive the LMMSE estimate of $A$ from $(Y_1, Y_2)$ and its MSE, as functions of $\rho$, via the orthogonality principle.
  \item Specialize to $\rho = 0$ and show the estimator is precision-weighted averaging. Then evaluate the MSE at $\rho = 0$, $\rho = 0.5$, and $\rho \to 1$, and explain the trend in one sentence each.
  \item Fuse sequentially: condition on $Y_1$ first, then treat the result as the prior and condition on $Y_2$ (take $\rho = 0$). Show that you land on the batch answer. This is ``Bayes twice,'' the germ of every tracking filter you will meet.
\end{enumerate}

\problem[The channel model][5 pts]

Let $X \sim \sN(0, \Sigma_X)$ and
\[
  Y = HX + N, \qquad N \sim \sN(0, \Sigma_N) \text{ independent of } X,
\]
where $H$ is a known $m \times n$ matrix. Derive the MMSE estimate of $X$ from $Y$. (Session~14 introduced this linear-Gaussian channel and stated the form of its estimator; here you derive it in full, and you should recognize what Problem~4 was a special case of.)

\problem[Fusion in silico][10 pts]

\emph{(Callback to Homework~4 Problem~4: another predict-then-verify simulation of an estimator you just derived.)}

\noindent Simulate the setup of Problem~4 with $\rho \in \set{0,\ 0.3,\ 0.6,\ 0.9}$. For each $\rho$, draw $10^4$ samples of $(A, Y_1, Y_2)$ and compare the empirical MSE of three estimators of $A$: (i) a single sensor, (ii) the naive average of the two readings, and (iii) the LMMSE fusion of Problem~4.

\noindent\textbf{Before running:} predict at which $\rho$ the naive average and the LMMSE estimate visibly separate, and why.

\noindent\textbf{Turn in:} a plot of MSE versus $\rho$ for all three estimators, your prediction versus the outcome, and your code.

\problem[Audit the TA-bot][5 pts]

The assistant was asked: \emph{``Three sensor biases $(X_1, X_2, X_3)$, each of unit variance, are proposed to have correlations $\rho_{12} = 0.8$, $\rho_{13} = -0.8$, $\rho_{23} = 0.6$. Is the resulting $\Sigma$ a valid covariance matrix?''} It answered:

\begingroup
\setlength{\fboxsep}{8pt}
\noindent\fbox{%
  \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
    \noindent\textbf{TA-bot writes:} The matrix is $\Sigma = \begin{bmatrix} 1 & 0.8 & -0.8 \\ 0.8 & 1 & 0.6 \\ -0.8 & 0.6 & 1 \end{bmatrix}$. A covariance matrix must be symmetric, with every correlation in $[-1, 1]$ and every off-diagonal entry no larger in magnitude than the geometric mean of the corresponding diagonal entries (here $1$). Checking: symmetry $\checkmark$; $|0.8|, |{-0.8}|, |0.6| \leq 1$ $\checkmark$; geometric-mean bounds $\checkmark$. All conditions hold, so $\Sigma$ is a valid covariance matrix.
  \end{minipage}%
}
\endgroup

\medskip
\noindent This solution contains \textbf{zero, one, or two errors}; a single wrong step and everything it drags down counts as one error.
\begin{enumerate}
  \item Identify the first line that goes wrong, or certify the solution correct.
  \item Name the violated result or modeling rule in one sentence, citing the session. (Apply to each error you find.)
  \item Fix it: settle validity with an explicit vector, and add one sentence of intuition about the sign pattern. (Apply to each error you find.)
  \item One sentence: why is this a mistake a language model plausibly makes?
\end{enumerate}
\noindent\emph{Flagging a correct step as an error costs credit; certifying correctness is part of the skill.}

\end{document}
