diff --git a/wk10/chart-1.png b/wk10/chart-1.png new file mode 100644 index 0000000..2c10d28 Binary files /dev/null and b/wk10/chart-1.png differ diff --git a/wk10/chart-2.png b/wk10/chart-2.png new file mode 100644 index 0000000..5d85de7 Binary files /dev/null and b/wk10/chart-2.png differ diff --git a/wk10/chart.png b/wk10/chart.png new file mode 100644 index 0000000..eef7884 Binary files /dev/null and b/wk10/chart.png differ diff --git a/wk10/week10.tex b/wk10/week10.tex index 1740bdb..1ee1cbd 100644 --- a/wk10/week10.tex +++ b/wk10/week10.tex @@ -1,6 +1,12 @@ \documentclass[a4paper]{article} % To compile PDF run: latexmk -pdf {filename}.tex +\usepackage{graphicx} % Used to insert images into the paper +\graphicspath{ {} } + +\usepackage[justification=centering]{caption} % Used for captions +\captionsetup[figure]{font=small} % Makes captions small + % Math package \usepackage{amsmath} %enable \cref{...} and \Cref{...} instead of \ref: Type of reference included in the link @@ -20,6 +26,51 @@ \author{Kelvin Davis \and Jip J. Dekker\and Tony Silvestere} \maketitle + \section{Overview} + \section{Methodology} + % Describe methods + % How did we collect data (and how we made it precise by averaging data) + The experiment compares the capability of two algorithms to generate words from scratch. This involved taking repeated measurements of the number of time steps each algorithm required to generate words of varying fixed length. Each algorithm was tasked to generate words of length 1, 2, 4, 8, and 16 letters, and each of these measurements were performed ten times. The results were each word length were averaged, and used to construct the plot given in Figure \ref{fig:plot1}. + \par + The first algorithm randomly 'guesses' each digit of the required word, and fixes the letters that are correctly guessed in their respective place. The second algorithm however, uses a genetic algorithm to generate the words by 'breeding' the most correct words at each iteration. In order to assess the rate at which each method correctly finds a word, the fitness of both techniques (percentage of correct letters) is recorded at every iteration for a four letter word and compared (Figure \ref{fig:fitness1} and Figure \ref{fig:fitness2}). + \par + + In the Discussion, the merits and pitfalls of both approaches are explored, and an algorithm is selected as the most fitting for this task. + + \section{Results} + \par + % what we graphed + After taking repeated measurements of the number of steps taken to generate words of varying length, these measurements were averaged and plotted. + + \begin{figure}[ht] + \includegraphics[scale=0.65]{chart} + \centering + \captionsetup{width=0.80\textwidth} + \caption{Plot of the plain random algorithm (red) and the genetic algorithm (blue) against the word length} + \label{fig:plot1} + \end{figure} + + \begin{figure}[ht] + \includegraphics[scale=0.65]{chart-1} + \centering + \captionsetup{width=0.80\textwidth} + \caption{Repeated measurements of the fitness of the stochastic fixed algorithm (as a percentage of the word) against the number of iterations taken} + \label{fig:fitness1} + \end{figure} + + \begin{figure}[ht] + \includegraphics[scale=0.65 + ]{chart-2} + \centering + \captionsetup{width=0.80\textwidth} + \caption{Repeated measurements of the fitness of the genetic algorithm (as a percentage of the word) against the number of iterations taken} + \label{fig:fitness2} + \end{figure} + + \section{Discussion} + % Make sure Qs are answered + + \section{Conclusion} \end{document}