deaa133d2d999adbb119dc4825b6b3254d646de5
[ker2014-2.git] / report / ass2-1.tex
1 \chapter{Probabilistic representation and reasoning (and burglars)}
2 \section{Bayesian network and the conditional probability tables}
3 \begin{figure}[H]
4 \caption{Bayesian network, visual representation}
5 \centering
6 \includegraphics[scale=0.5]{d1.eps}
7 \end{figure}
8
9 We introduced a \textit{Noisy OR} to represent the causal independence of
10 \textit{Burglar} and \textit{Earthquake} on Alarm. Probabilities for the causes
11 of the alarm are calculated using days, in practice this means that the
12 smallest discrete time interval is one day. The calculation for the probability
13 of a burglar is then calculated with the following formula(taking leap years
14 into account and assuming a standard gregorian calendar).
15 $$\frac{1}{365 + 0.25 - 0.01 - 0.0025}=\frac{1}{365.2425}$$
16
17 This gives the following probability distributions\\
18 \begin{tabular}{|l|ll|}
19 \hline
20 & \multicolumn{2}{c|}{Earthquake}\\
21 \hline
22 T & $0.0027$ & $0.9972$ \\
23 F & $0.9973$ & $0.0027$\\
24 \hline
25 \end{tabular}
26 %
27 \begin{tabular}{|l|ll|}
28 \hline
29 & \multicolumn{2}{c|}{Burglar}\\
30 \hline
31 T & $0.0027$ & $0.9973$ \\
32 F & $0.9973$ & $0.0027$\\
33 \hline
34 \end{tabular}
35
36 \begin{tabular}{|l|ll|}
37 \hline
38 & \multicolumn{2}{c|}{$I_1$}\\
39 Earthquake & T & F\\
40 \hline
41 T & $0.2$ & $0.8$\\
42 F & $0$ & $1$\\
43 \hline
44 \end{tabular}
45 \begin{tabular}{|l|ll|}
46 \hline
47 & \multicolumn{2}{c|}{$I_2$}\\
48 Burglar & T & F\\
49 \hline
50 T & $0.95$ & $0.05$\\
51 F & $0$ & $1$\\
52 \hline
53 \end{tabular}
54 \begin{tabular}{|ll|ll|}
55 \hline
56 && \multicolumn{2}{c|}{Alarm}\\
57 $I_1$ & $I_2$ & T & F\\
58 \hline
59 T & T & $1$ & $0$\\
60 T & F & $1$ & $0$\\
61 F & T & $1$ & $0$\\
62 F & F & $0$ & $1$\\
63 \hline
64 \end{tabular}
65
66 \begin{tabular}{|l|ll|}
67 \hline
68 & \multicolumn{2}{c|}{Watson}\\
69 Alarm & T & F\\
70 \hline
71 T & $0.8$ & $0.2$\\
72 F & $0.4$ & $0.6$\\
73 \hline
74 \end{tabular}
75 \begin{tabular}{|l|ll|}
76 \hline
77 & \multicolumn{2}{c|}{Gibbons}\\
78 Alarm & T & F\\
79 \hline
80 T & $0.99$ & $0.01$\\
81 F & $0.04$ & $0.96$\\
82 \hline
83 \end{tabular}
84 \begin{tabular}{|l|ll|}
85 \hline
86 & \multicolumn{2}{c|}{Radio}\\
87 Earthquake & T & F\\
88 \hline
89 T & $0.9998$ & $0.0002$\\
90 F & $0.0002$ & $0.9998$\\
91 \hline
92 \end{tabular}
93
94 \paragraph{Implementation}\strut\\
95 This distribution results in the \textit{AILog} code in Listing~\ref{alarm.ail}
96
97 \begin{listing}
98 \label{alarm.ail}
99 \caption{Alarm.ail}
100 \inputminted[linenos,fontsize=\footnotesize]{prolog}{./src/alarm.ail}
101 \end{listing}