update de style
authorMart Lubbers <mart@martlubbers.net>
Tue, 3 Feb 2015 08:52:37 +0000 (09:52 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 3 Feb 2015 08:52:37 +0000 (09:52 +0100)
1  2 
report/ass2-1.tex

@@@ -12,8 -12,7 +12,8 @@@ Figure~\ref{bnetwork21
        \includegraphics[scale=0.5]{d1.eps}
  \end{figure}
  
- Days were chosen as unit to model the story. Calculation for the probability of
 -Days were chosen as unit to model the story. Calculation of the probability of a\textit{Burglar} event happening at some day is then (assuming a Gregorian
++Days were chosen as unit to model the story. Calculation of the probability of
 +a\textit{Burglar} event happening at some day is then (assuming a gregorian
  calendar and leap days):
  $$\frac{1}{365 + 0.25 - 0.01 - 0.0025}=\frac{1}{365.2425}$$
  
@@@ -99,8 -97,14 +99,24 @@@ in order to avoid a unclear graph
        \end{tabular}
  \end{table}
  
 -\textit{If there is a burglar present (which could happen once every ten years), the alarm is known to go off 95\% of the time.} We modelled this by setting the value for Burglar True and $I_2$ True on 0,95. \\
 -\textit{There’s a 40\% chance that Watson is joking and the alarm is in fact off.} This is modelled by putting the value for Watson True and Alarm F on 0,4. As Holmes expects Watson to call in 80\% of the time, the value for alarm True and Watson True is set 0,2. Because the rows have to sum to 1, the other values are easily calculated. \\
 -\textit{She may not have heard the alarm in 1\% of the cases and is thought to erroneously report an alarm when it is in fact off in 4\% of the cases.} We modelled this by assuming that when Mrs. Gibbons hears the alarm, she calls Holmes. Meaning that the value for Gibbons False and Alarm true is 0,01. As she reports when the alarm is in fact off in 4\% of the cases, the value for Gibbons True and alarm False is 0,04. \\
 -
++\textit{If there is a burglar present (which could happen once every ten
++years), the alarm is known to go off 95\% of the time.} We modelled this by
++setting the value for Burglar True and $I_2$ True on 0,95.\\
++\textit{There’s a 40\% chance that Watson is joking and the alarm is in fact
++off.} This is modelled by putting the value for Watson True and Alarm F on 0,4.
++As Holmes expects Watson to call in 80\% of the time, the value for alarm True
++and Watson True is set 0,2. Because the rows have to sum to 1, the other values
++are easily calculated.\\
++\textit{She may not have heard the alarm in 1\% of the cases and is thought to
++erroneously report an alarm when it is in fact off in 4\% of the cases.} We
++modelled this by assuming that when Mrs. Gibbons hears the alarm, she calls
++Holmes. Meaning that the value for Gibbons False and Alarm true is 0,01. As
++she reports when the alarm is in fact off in 4\% of the cases, the value for
++Gibbons True and alarm False is 0,04.\\
+  
  \section{Implementation}
This distribution results in the \textit{AILog} code in Listing~\ref{alarm.ail}
We implemented the distributions in \textit{AILog}, see Listing~\ref{alarm.ail}
  
  \begin{listing}[H]
        \label{alarm.ail}
  \end{listing}
  
  \section{Queries}
- Using the following queries the probabilities or as follows:\\
 -Now that we have modelled the story with the corresponding probabilities, we can have ailog calculate some other probabilities given a some observations. Down below we wrote down some probabilties and the associated ailog output. \\
 -The chance that a burglary happens given that Watson calls is greater than the chance that a burglary happens without this observations, as is observerd by the difference between a and b. This makes sense as Watson calls rightly in 80\% of the time. So when Holmes receives a call by Watson, the chance that the alarm goes of increases. \\
 -When we compare b to c, the same mechanisme holds. There are more observations that give evidence for a burglary as both Watson and Gibbons have called in the case of c. \\
 -When you take a look at the last case, d, you see that the probability has decreased compared to c. This can be explained by an observation that is added on top of the observations of b; the radio. The variable Radio means that the newcast tells that there was an earhquake. As that is also a reason why the alarm could go of, but has nothing to do with a burglary, it decreases the probability of a burglary.
++Now that we have modelled the story with the corresponding probabilities, we
++can have ailog calculate some other probabilities given a some observations.
++Down below we wrote down some probabilties and the associated ailog output.\\
++The chance that a burglary happens given that Watson calls is greater than the
++chance that a burglary happens without this observations, as is observerd by
++the difference between a and b. This makes sense as Watson calls rightly in
++80\% of the time. So when Holmes receives a call by Watson, the chance that the
++alarm goes of increases.\\
++When we compare b to c, the same mechanisme holds. There are more observations
++that give evidence for a burglary as both Watson and Gibbons have called in the
++case of c.\\
++When you take a look at the last case, d, you see that the probability has
++decreased compared to c. This can be explained by an observation that is added
++on top of the observations of b; the radio. The variable Radio means that the
++newcast tells that there was an earhquake. As that is also a reason why the
++alarm could go of, but has nothing to do with a burglary, it decreases the
++probability of a burglary.
+ %We kunnen misschien de kans uitrekenen dat Watson en Gibbons allebei foutief bellen? Daar mis je denk ik info over of niet?
  \begin{enumerate}[a)]
        \item $P(\text{Burglary})=
                0.002737757092501968$
@@@ -162,11 -174,10 +199,17 @@@ Querying the \textit{Alarm} variable gi
          [ok,more,explanations,worlds,help]: ok.
  \end{minted}
  
- Using formula: $P(i_1|C_1)+P(i_2|C_2)(1-P(i_1|C_1))$ we can calculate the
 -Using the formula for causal independence with a logical OR: \\ $P(Alarm|C_1, C_2) = P(i_1|C_1)+P(i_2|C_2)(1-P(i_1|C_1))$ we can calculate the probability of the \textit{Alarm} variable using variable elimination. This results in the following answer: \\
 -$P(Alarm|burglar, earthquake) = P(i_1|burglar)+P(i_2|earthquake)(1-P(i_1|burglar)) =  0.2*0.0027+0.95*0.0027*(1-0.2*0.0027)=0.00314699654673673$ \\
 -TODOOOOOOOOOOO %Ik weet niet of we i_1 en i_2 nog door iets anders vervangen moeten worden.
 -When you compare the output of ailog and of the variable elimination, you see that they are similar.
++Using the formula for causal independence with a logical OR:\\
++$P(Alarm|C_1, C_2) = P(i_1|C_1)+P(i_2|C_2)(1-P(i_1|C_1))$ we can calculate the
 +probability of the \textit{Alarm} variable using variable elimination. This
- results in the following answer: 
- $$0.2*0.0027+0.95*0.0027*(1-0.2*0.0027)=0.00314699654673673$$
- TODOOOOOOOOOOO
++results in the following answer:\\
++$P(Alarm|burglar, earthquake) =
++P(i_1|burglar)+P(i_2|earthquake)(1-P(i_1|burglar)) =
++0.2*0.0027+0.95*0.0027*(1-0.2*0.0027)=0.00314699654673673$ \\
++TODOOOOOOOOOOO %Ik weet niet of we i_1 en i_2 nog door iets anders vervangen
++% moeten worden.
++When you compare the output of ailog and of the variable elimination, you see
++that they are similar.
  
  \newpage
  \section{Burglary problem with extended information}