From 64f84a3e6cb4a017dfaeed6b92d8721b422f9dba Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 21 Dec 2014 14:24:11 +0100 Subject: [PATCH] update bayesian network --- report/.gitignore | 1 + report/Makefile | 7 +++++-- report/ass2-1.tex | 51 +++++++++++++++++++++++++++++++++++++++++++++++ report/d1.dot | 9 +++++++++ report/report.tex | 3 +++ 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 report/d1.dot diff --git a/report/.gitignore b/report/.gitignore index 4e73ed6..7f35862 100644 --- a/report/.gitignore +++ b/report/.gitignore @@ -4,3 +4,4 @@ *.pdf *.pyg *.toc +*.eps diff --git a/report/Makefile b/report/Makefile index 1c0358a..801528a 100644 --- a/report/Makefile +++ b/report/Makefile @@ -1,12 +1,15 @@ SHELL:=/bin/bash -all: +all: graphs latex -shell-escape report.tex latex -shell-escape report.tex dvipdfm report.dvi +graphs: + dot -Teps d1.dot > d1.eps + clean: - rm -vf report.{aux,dvi,log,pyg,toc} + rm -vf report.{aux,dvi,log,pyg,toc,eps} clobber: clean rm -vf report.pdf diff --git a/report/ass2-1.tex b/report/ass2-1.tex index ea4f9ae..03b3569 100644 --- a/report/ass2-1.tex +++ b/report/ass2-1.tex @@ -1 +1,52 @@ \chapter{Probabilistic representation and reasoning (and burglars)} +\section{Bayesian network and the conditional probability tables} +\begin{figure}[H] + \caption{Bayesian network, visual representation} + \centering + \includegraphics[scale=0.5]{d1.eps} +\end{figure} + +\strut\\ +\begin{tabular}{|l|l|} + \hline + & Burglar\\ + \hline + T & $0.01$\\ + F & $0.99$\\ + \hline +\end{tabular} +\begin{tabular}{|l|l|} + \hline + & Earthquake\\ + \hline + T & $0.01$\\ + F & $0.99$\\ + \hline +\end{tabular}\\ +\begin{tabular}{|l|ll|} + \hline + & \multicolumn{2}{c|}{Alarm}\\ + Burglar & T & F\\ + \hline + T & $0.95$ & $0.05$\\ + F & $0.00$ & $1.00$\\ + \hline +\end{tabular} +\begin{tabular}{|l|ll|} + \hline + & \multicolumn{2}{c|}{Alarm}\\ + Earthquake & T & F\\ + \hline + T & $0.20$ & $0.80$\\ + F & $0.00$ & $1.00$\\ + \hline +\end{tabular} +\begin{tabular}{|l|ll|} + \hline + & \multicolumn{2}{c|}{Holmes}\\ + Earthquake & T & F\\ + \hline + T & $0.9998$ & $0.0002$\\ + F & $0.00$ & $1.00$\\ + \hline +\end{tabular} diff --git a/report/d1.dot b/report/d1.dot new file mode 100644 index 0000000..b7ede71 --- /dev/null +++ b/report/d1.dot @@ -0,0 +1,9 @@ +digraph { + earthquake -> alarm + earthquake -> holmes + burglar -> alarm + + alarm -> watson + alarm -> holmes + watson -> holmes +} diff --git a/report/report.tex b/report/report.tex index bb1b393..2f93c8b 100644 --- a/report/report.tex +++ b/report/report.tex @@ -1,6 +1,9 @@ \documentclass[twoside,a4paper,titlepage]{report} +\usepackage{graphicx} \usepackage{minted} +\usepackage{float} +\usepackage{slashbox} \author{ Lubbers, M\\ -- 2.20.1