\begin{frame}
	\myheading{Module 19.5: Different types of reasoning in a Bayesian network}
\end{frame}

\begin{frame}
	\begin{block}{New Notations}
		\begin{itemize}
			\onslide<1->{\item We will denote $P(I=0)$ by $P(i^{0})$}
			\onslide<2->{\item In general, we will denote $P(I=0, D=1, G=B, S=1, L=0)$ by $P(i^{0},d^{1},g^{b},s^{1},l^{0})$}
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			%\vspace{-0.2in}
			\input{modules/Module4/tikz_images/table_net.tex}
			\begin{align*}
			  	P(l^1)&=\sum_{I,D,G,S} P(I,D,G,S,l^1)\\
		  		&=\sum_{I\epsilon(0,1)}\sum_{D\epsilon(0,1)}\sum_{G\epsilon(A,B,C)}\sum_{S\epsilon(0,1)} P(I,D,G,S,l^1)\\
			  	&=50.2\%
			 \end{align*}
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			%\vspace{0.2in}
			\textbf{Causal Reasoning}
			\begin{itemize}\justifying
				\onslide<1->{\item Here, we try to predict downstream effects of various factors}
				\onslide<2->{\item Let us consider an example}
				\onslide<3->{\item What is the probability that a student will get a good recommendation letter, $P(l^{1})$?\\}
				
				%\onslide<4->{\item Now what if we start adding information about the factors that could influence $l^{1}$}
			\end{itemize}
			\begin{align*}
				\onslide<4->{P(l^{1})=0.9(P(g^1))+0.6(P(g^2))\\
				+0.01(P(g^3))\\}
				\only<5->{\text{where } P(g^1)=0.3(P(i^0,d^0))+...\\
				+0.5(P(i^1,d^1))}
				\only<5->{\text{ and so on}\\}
				\only<6->{%P(l^1)=\sum_{I,D,G,S} P(I,D,G,S,l^1)\\
				\hspace{-0.4in}	P(l^1)=\sum_{I\epsilon(0,1)}\sum_{D\epsilon(0,1)}\sum_{G\epsilon(A,B,C)}\sum_{S\epsilon(0,1)} P(I,D,G,S,l^1)}
%				\onslide<7->{P(l^1)= 0.502}
			\end{align*}
%			\onslide<4->{$P(l^{1})=0.9(P(g^1))+0.6(P(g^2))+0.01(P(g^3))$\\}
%			\onslide<5>{where $P(g^1)=0.3(P(i^0,d^0))+...+0.5(P(i^1,d^1))$}
			\onslide<7->{$P(l^1)= 0.502$}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\input{modules/Module4/tikz_images/table_net.tex}
%			\vspace{0.2in}
%			\begin{align*}
%				\tiny& P(l^1)= 0.502\\
%     			& P(l^1|i^0)= 0.389 (drops) \\
%    			& P(l^1|i^0,d^1)= 0.513 (increases)
%			\end{align*}
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			%\vspace{0.2in}
			\textbf{Causal Reasoning}
			\begin{itemize}\justifying
				\onslide<1->{\item Now what if we start adding information about the factors that could influence $l^{1}$}
				\onslide<2->{\item What if someone reveals that the student is not intelligent?}
				\onslide<3->{\item Intelligence will affect the score and hence the grade}
				%\only<6->{Indeed $P(l^1|i^0)= 0.389$ (drops)}
%				\onslide<3->{\item What if the course was easy?}
%				\onslide<4->{\item A not so intelligent student may still be able to get a good grade and hence a goodl letter.}
			\end{itemize}
			%\hspace{-0.5in}
			\begin{align*}
			\onslide<4->{P(l^{1}|i^0)=0.9(P(g^1))+0.6(P(g^2))\\
				+0.01(P(g^3))\\}
			\only<5>{\text{where now } P(g^1)=0.3(P(i^0,d^0))\\
				+0.5(P(i^0,d^1))\\}
			\only<6->{%P(l^1)=\sum_{I,D,G,S} P(I,D,G,S,l^1)\\
				\hspace{-0.3in}	P(l^1|i^0)=\sum_{D\epsilon(0,1)}\sum_{G\epsilon(A,B,C)}\sum_{S\epsilon(0,1)} P(i^0,D,G,S,l^1)}
%			\only<6->{P(l^1|i^0)= 0.389 (drops)}
			\end{align*}
			%\hspace{-0.2in}
			\only<7->{Indeed $P(l^1|i^0)= 0.389$ (drops)}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\input{modules/Module4/tikz_images/table_net.tex}
			
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			%\vspace{0.2in}
			\textbf{Causal Reasoning}
			\begin{itemize}\justifying
				\onslide<1->{\item What if the course was easy?}
				%\onslide<2->{\item What if someone reveals that the student is not intelligent?}
				%\onslide<3->{\item Intelligence will affect the score and hence the grade}
				%\only<6->{Indeed $P(l^1|i^0)= 0.389$ (drops)}
				%				\onslide<3->{\item What if the course was easy?}
				\onslide<2->{\item A not so intelligent student may still be able to get a good grade and hence a good letter}
			\end{itemize}
			\begin{align*}
%			\onslide<4->{P(l^{1}|i^0)=0.9(P(g^1))+0.6(P(g^2))\\
%				+0.01(P(g^3))\\}
%			\only<5->{\text{where now } P(g^1)=0.3(P(i^0,d^0))\\
%				+0.5(P(i^0,d^1))}
			\onslide<3->{\hspace{-0.2in}	P(l^1|i^0,d^0)=\sum_{G\epsilon(A,B,C)}\sum_{S\epsilon(0,1)} P(i^0,d^0,G,S,l^1)}
			%			\only<6->{P(l^1|i^0)= 0.389 (drops)}
			%\onslide<4->{P(l^1|i^0,d^1)= 0.513 (increases)}
			\end{align*}
			\only<4->{\hspace{0.2in}$P(l^1|i^0,d^1)= 0.513$ (increases)}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			%\vspace{-0.2in}
			\input{modules/Module4/tikz_images/table_net.tex}
			%\vspace{0.2in}
			
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\textbf{Evidential Reasoning}
			\begin{itemize}\justifying
				\onslide<1->{\item Here, we reason about causes by looking at their effects}
				\onslide<2->{\item What is the probability of the student being intelligent?}
				\onslide<4->{\item What is the probability of the course being difficult?}
				\onslide<6->{\item Now let us see what happens if we observe some effects}
			\end{itemize}
			\begin{align*}
			\only<2>{& P(i^1)= ?\\
			}
			\only<3->{& P(i^1)= 0.3\\}
			\only<4>{& P(d^1)= ?\\
			}
			\only<5->{& P(d^1)= 0.4  \\}
			\end{align*}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\begin{align*}
			     & P(i^1)= 0.3\\
			     & P(d^1)= 0.4  \\
			     \only<2->{& P(i^1|g^3)= 0.079 (drops) \\}
			     \only<2->{& P(d^1|g^3)= 0.629 (increases) \\}
			     \only<4->{& P(i^1|l^0)= 0.14 (drops)\\}
			     \only<6->{& P(l^1|l^0,g^3)= 0.079\\ }
			     \only<6->{& (\text{same as }P(i^1|g^3))}
		     \end{align*}
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\textbf{Evidential Reasoning}
			\begin{itemize}\justifying
				\onslide<1->{\item What if someone tells us that the student secured $C$ grade?}
				\onslide<3->{\item What if instead of getting to know the grade, we get to know that the student got a poor recommendation letter?}
				\onslide<5->{\item What if we know about the grade as well as the recommendation letter?}
				\onslide<7->{\item The last case is interesting! (We will return to it later)}
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\begin{align*}
				& P(i^1)= 0.3\\
				\only<2->{& P(i^1|g^3)= 0.079 (drops) \\}
				\only<4->{& P(i^1|g^3,d^1)= 0.11 (improves) \\}
			\end{align*}
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\textbf{Explaining Away}
			\begin{itemize}\justifying
				\onslide<1->{\item Here, we see how different causes of the same effect can interact}
				\onslide<2->{\item We already saw how knowing the grade influences our estimate of intelligence}
				\onslide<3->{\item What if we were told the course was difficult?}
				\onslide<4->{\item Our belief in the student's intelligence improves}
				\onslide<5->{\item Why? Let us see}
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\begin{align*}
			 	& P(i^1)= 0.3\\
			 	& P(i^1|g^3)= 0.079 \\
			 	& P(i^1|g^3,d^1)= 0.11\\
			  	\only<5>{& P(i^1|g^2)= 0.175 \\
			  		& P(i^1|g^2,d^1)= 0.34} 
			 \end{align*}
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\textbf{Explaining Away}
			\begin{itemize}\justifying
				\onslide<1->{\item Knowing that the course was difficult explains away the bad grade}
				\onslide<2->{\item ``Oh! Maybe the course was just too difficult and the student might have received a bad grade despite being intelligent!"}
				\onslide<3->{\item The explaining away effect could be even more dramatic}
				\onslide<4->{\item Let us consider the case when the grade was $B$}				
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\begin{align*}
			     & P(d^1)= 0.40\\
			     & P(d^1|g^3)= 0.629 \\
			     \only<2->{& P(d^1|s^1,g^3)= 0.76}
	         \end{align*} 
		\end{overlayarea}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\vspace{0.2in}
			\textbf{Explaining Away}
			\begin{itemize}\justifying
				\onslide<1->{\item Suppose we know that the student had a high SAT Score, what happens to our belief about the difficulty of the course?}
				\onslide<3->{\item Knowing that the SAT score was high tells us that the student seems intelligent and perhaps the reason why he scored a poor grade is that the course was difficult}
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

