\begin{problem}{Irrelevance Criteria} 

A variable in a Bayes net is said to be \emph{irrelevant} to a given query if we could remove the variable from the Bayes net without changing the answer to the query. For example, in the Bayes net below, the variable $D$ is irrelevant to the query $\P(B)$, because we already have the $\P(B)$ table. On the other hand, $B$ is \emph{not} irrelevant to the query $\P(D)$, because $\P(B)$ is needed to compute $\P(D)$.

Consider the Bayes net below:
\begin{center}\includegraphics[height=0.2\textwidth]{figures/q5a.png}\end{center}


\begin{question}[6]
Suppose we are making the query $\P(A \mid D = d)$. Prove that $C$ is irrelevant to this query using the following steps:\\\\
(i) Write the full joint distribution as a product of the CPTs in the Bayes net.\\
\solutionspace{1.5cm}{15cm}{}{\ThreeAi}\\\\
(ii) Sum over this product and normalize to get $\P(A \mid d)$. Make sure you write out the full equations.\\
\solutionspace{2cm}{15cm}{}{\ThreeAii}\\\\
(iii) Explain why this expression does not depend on the variable $C$.\\
\solutionspace{2cm}{15cm}{}{\ThreeAiii}
\end{question}

\begin{question}[6]
Now suppose we are making the query $\P(C \mid D = d)$. Execute the first two steps in part (a) for this query, and then argue why $B$ is \emph{not} irrelevant.\\
\solutionspace{4cm}{15cm}{}{\ThreeB}
\end{question}

\newpage

The \emph{ancestor criterion} says that any node which is not an ancestor of a query or evidence variable is irrelevant. 

In the Bayes net below, query variables are indicated by a double circle and evidence variables are shaded in. 
\begin{question}[6]
Cross out all the nodes that are irrelevant to this query according to the ancestor criterion.

For your submission to this problem, you may do one of the following:
\vspace{-0.1cm}
\begin{itemize}
    \item Draw/annotate on top of the existing images in the pdf.
    \item Edit the \texttt{figures/q5c.png} image file to add markings.
\end{itemize}
\vspace{-0.1cm}


\begin{center}
\solution{\includegraphics[height=0.3\textwidth]{figures/q5c.png}}{\ThreeC}
\end{center}
\end{question}

The moral graph of a Bayes net is an undirected graph containing all of the same connections as the original Bayes net, plus edges that connect variables which shared a child in the original Bayes net. Another criterion of irrelevance says that $X$ is irrelevant to the query $\P(Q_1 \dots Q_n \mid e_1 \dots e_n)$ if in the moral graph, every path between a query variable $Q_i$ and $X$ goes through some evidence variable $e_j$ (i.e., $X$ is \emph{m-separated} from the query variables given the evidence variables).

\begin{question}[6]
For the following Bayes net, \textbf{draw in} the additional edges found in the moral graph \textbf{and cross out} all the variables that are irrelevant to the query according to the m-separation criterion. 

For your submission to this problem, you may do one of the following:
\vspace{-0.1cm}
\begin{itemize}
    \item Draw/annotate on top of the existing images in the pdf.
    \item Edit the \texttt{figures/q5d.png} image file to add markings.
\end{itemize}
\vspace{-0.1cm}


\begin{center}
\solution{\includegraphics[height=0.3\textwidth]{figures/q5d.png}}{\ThreeD}
\end{center}
\end{question}

\begin{question}[2]
Which variables \emph{are not} considered irrelevant by the ancestor criterion but \emph{are} considered irrelevant by the m-separation criterion?\\
\solutionspace{1.5cm}{3.5cm}{Variables:}{\ThreeE}
\end{question}

\end{problem}