From: Mart Lubbers Date: Tue, 3 Feb 2015 22:32:15 +0000 (+0100) Subject: final version X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;ds=sidebyside;p=ker2014-2.git final version --- diff --git a/report/ass2-1.tex b/report/ass2-1.tex index 6fdba13..41573b2 100644 --- a/report/ass2-1.tex +++ b/report/ass2-1.tex @@ -18,7 +18,7 @@ calendar and leap days): $$\frac{1}{365 + 0.25 - 0.01 - 0.0025}=\frac{1}{365.2425}$$ The resultant probability distributions can be found in Table~\ref{probdist}, -in order to avoid a unclear graph. +in order to avoid an unclear graph. \begin{table}[H] \label{probdist} @@ -126,8 +126,8 @@ We implemented the distributions in \textit{AILog}, see Listing~\ref{alarm.ail} \section{Queries} 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.\\ +can have AILog calculate some other probabilities given by 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 @@ -156,31 +156,31 @@ probability of a burglary. \begin{listing}[H] \begin{minted}[fontsize=\footnotesize]{prolog} -ailog: predict burglar. +AILog: predict burglar. Answer: P(burglar|Obs)=0.002737757092501968. [ok,more,explanations,worlds,help]: ok. -ailog: observe watson. +AILog: observe watson. Answer: P(watson|Obs)=0.4012587986186947. [ok,more,explanations,worlds,help]: ok. -ailog: predict burglar. +AILog: predict burglar. Answer: P(burglar|Obs)=[0.005321803679438259,0.005321953115441623]. [ok,more,explanations,worlds,help]: ok. -ailog: observe gibbons. +AILog: observe gibbons. Answer: P(gibbons|Obs)=[0.04596053565368094,0.045962328885721306]. [ok,more,explanations,worlds,help]: ok. -ailog: predict burglar. +AILog: predict burglar. Answer: P(burglar|Obs)=[0.11180941544755249,0.1118516494624678]. [ok,more,explanations,worlds,help]: ok. -ailog: observe radio. +AILog: observe radio. Answer: P(radio|Obs)=[0.02582105837443645,0.025915745316785182]. [ok,more,explanations,worlds,help]: ok. -ailog: predict burglar. +AILog: predict burglar. Answer: P(burglar|Obs)=[0.01179672476662423,0.015584580594335082]. [ok,more,explanations,worlds,help]: ok. \end{minted} @@ -189,7 +189,7 @@ Answer: P(burglar|Obs)=[0.01179672476662423,0.015584580594335082]. \section{Comparison with manual calculation} Querying the \textit{Alarm} variable gives the following answer: \begin{minted}{prolog} - ailog: predict alarm. + AILog: predict alarm. Answer: P(alarm|Obs)=0.0031469965467367292. [ok,more,explanations,worlds,help]: ok. @@ -238,7 +238,7 @@ We implemented the extended story using a three layered model.\\ \textit{Each day a burglar decides whether he wants to work or not, and on average this happens only 5 days a week} Meaning that every burglar has the same initial working probability: 5/7 (see the first 5 lines of code).\\ -Then we implemented the constraints on the colleagues by telling ailog that a burglary can happen when at least one of our combinations is working (see line 8 to 11).\\ +Then we implemented the constraints on the colleagues by telling AILog that a burglary can happen when at least one of our combinations is working (see line 8 to 11).\\ \textit{Finally, if they decide to burgle, then they will burgle 3 houses a night.} The third layer consists of implementing the change that out of the 10,000 houses in which Joe, William, Jack and Averall are the only burglars, Holmes' house is burgled as one of the three (see line 14 to 19). This results in the following probability for a burglary at a Holmes' house. $P(burglary)\cdot( diff --git a/report/ass2-2.tex b/report/ass2-2.tex index ebf9c69..bdb504a 100644 --- a/report/ass2-2.tex +++ b/report/ass2-2.tex @@ -29,7 +29,7 @@ real-time operation. \fi \section{Domain representation} Translating the domain specification to AILog results in the following AILog -code: +code:\\ \inputminted[linenos,fontsize=\footnotesize]{prolog}{./src/pizza.ail} \section{Queries} @@ -48,7 +48,7 @@ ailog: predict circlePresent. Answer: P(circlePresent|Obs)=0.95. [ok,more,explanations,worlds,help]: ok. \end{minted} -\begin{table} +\begin{table}[H] \label{chances} \begin{tabular}{|l|ll|} \hline