updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 04 Oct 2016 15:09:08 +0100
changeset 443 cd43d8c6eb84
parent 442 84d6714840c9
child 444 3056a4c071b0
updated
handouts/ho01.pdf
handouts/ho01.tex
handouts/ho02.pdf
handouts/ho02.tex
Binary file handouts/ho01.pdf has changed
--- a/handouts/ho01.tex	Tue Oct 04 14:54:20 2016 +0100
+++ b/handouts/ho01.tex	Tue Oct 04 15:09:08 2016 +0100
@@ -312,7 +312,7 @@
 versions of the algorithm: the first one will be able to
 process strings of approximately 1,000 \texttt{a}s in 30
 seconds, while the second version will even be able to process
-up to 12,000 in less than 10(!) seconds, see the graph below:
+up to 7,000(!) in 30 seconds, see the graph below:
 
 \begin{center}
 \begin{tikzpicture}
@@ -323,10 +323,10 @@
     x label style={at={(1.05,0.0)}},
     ylabel={time in secs},
     enlargelimits=false,
-    xtick={0,3000,...,12000},
-    xmax=13000,
-    ymax=12,
-    ytick={0,5,10},
+    xtick={0,3000,...,9000},
+    xmax=10000,
+    ymax=32,
+    ytick={0,5,...,30},
     scaled ticks=false,
     axis lines=left,
     width=7cm,
@@ -352,8 +352,8 @@
     x label style={at={(1.05,0.0)}},
     ylabel={time in secs},
     enlargelimits=false,
-    ymax=12,
-    ytick={0,5,10},
+    ymax=32,
+    ytick={0,5,...,30},
     axis lines=left,
     width=7cm,
     height=4.5cm,
Binary file handouts/ho02.pdf has changed
--- a/handouts/ho02.tex	Tue Oct 04 14:54:20 2016 +0100
+++ b/handouts/ho02.tex	Tue Oct 04 15:09:08 2016 +0100
@@ -54,8 +54,8 @@
     x label style={at={(1.1,0.05)}},
     ylabel={\small time in secs},
     enlargelimits=false,
-    xtick={0,3000,...,12000},
-    xmax=12500,
+    xtick={0,3000,...,9000},
+    xmax=10000,
     ymax=35,
     ytick={0,5,...,30},
     scaled ticks=false,
@@ -470,40 +470,40 @@
 \end{figure}
 
 
-Remember our second example involving the regular expression
-$(a^*)^* \cdot b$ which could not match strings of $n$ \texttt{a}s. 
-Java needed around 30 seconds to find this out a string with $n=28$.
-It seems our algorithm is doing rather well in comparison:
-
-\begin{center}
-\begin{tikzpicture}
-\begin{axis}[
-    title={Graph: $(a^*)^* \cdot b$ and strings $\underbrace{a\ldots a}_{n}$},
-    xlabel={$n$},
-    x label style={at={(1.05,0.0)}},
-    ylabel={time in secs},
-    enlargelimits=false,
-    xtick={0,1000,...,6500},
-    xmax=6800,
-    ytick={0,5,...,30},
-    ymax=34,
-    scaled ticks=false,
-    axis lines=left,
-    width=8cm,
-    height=4.5cm, 
-    legend entries={Java,Scala V1},  
-    legend pos=north east,
-    legend cell align=left]
-\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
-\addplot[red,mark=triangle*,mark options={fill=white}] table {re1a.data};
-\end{axis}
-\end{tikzpicture}
-\end{center}
-
-\noindent
-This is not an error: it hardly takes more than half a second for
-strings up to the length of 6500. After that we receive a
-StackOverflow exception, but still\ldots
+%Remember our second example involving the regular expression
+%$(a^*)^* \cdot b$ which could not match strings of $n$ \texttt{a}s. 
+%Java needed around 30 seconds to find this out a string with $n=28$.
+%It seems our algorithm is doing rather well in comparison:
+%
+%\begin{center}
+%\begin{tikzpicture}
+%\begin{axis}[
+%    title={Graph: $(a^*)^* \cdot b$ and strings $\underbrace{a\ldots a}_{n}$},
+%    xlabel={$n$},
+%    x label style={at={(1.05,0.0)}},
+%    ylabel={time in secs},
+%    enlargelimits=false,
+%    xtick={0,1000,...,6500},
+%    xmax=6800,
+%    ytick={0,5,...,30},
+%    ymax=34,
+%    scaled ticks=false,
+%    axis lines=left,
+%    width=8cm,
+%    height=4.5cm, 
+%    legend entries={Java,Scala V1},  
+%    legend pos=north east,
+%    legend cell align=left]
+%\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
+%\addplot[red,mark=triangle*,mark options={fill=white}] table {re1a.data};
+%\end{axis}
+%\end{tikzpicture}
+%\end{center}
+%
+%\noindent
+%This is not an error: it hardly takes more than half a second for
+%strings up to the length of 6500. After that we receive a
+%StackOverflow exception, but still\ldots
 
 For running the algorithm with our first example, the evil
 regular expression $a^?{}^{\{n\}}a^{\{n\}}$, we need to implement
@@ -669,10 +669,10 @@
     x label style={at={(1.04,0.0)}},
     ylabel={time in secs},
     enlargelimits=false,
-    xtick={0,2000,...,12000},
-    xmax=13000,
+    xtick={0,3000,...,9000},
+    xmax=10000,
     ytick={0,5,...,30},
-    ymax=12,
+    ymax=32,
     scaled ticks=false,
     axis lines=left,
     width=9cm,
@@ -705,7 +705,7 @@
     enlargelimits=false,
     xmax=7700000,
     ytick={0,5,...,30},
-    ymax=15,
+    ymax=32,
     %scaled ticks=false,
     axis lines=left,
     width=9cm,
@@ -756,10 +756,10 @@
     ymax=33,
     %scaled ticks=false,
     axis lines=left,
-    width=5cm,
+    width=5.5cm,
     height=5cm, 
     legend entries={Scala V3, Scala V4},
-    legend pos=north west]
+    legend style={at={(0.1,-0.2)},anchor=north}]
 \addplot[black,mark=square*,mark options={fill=white}] table {re3.data};
 \addplot[purple,mark=square*,mark options={fill=white}] table {re4.data};
 \end{axis}
@@ -777,10 +777,10 @@
     ymax=33,
     %scaled ticks=false,
     axis lines=left,
-    width=5cm,
+    width=5.5cm,
     height=5cm, 
     legend entries={Scala V3, Scala V4},
-    legend pos=north west]
+    legend style={at={(0.1,-0.2)},anchor=north}]
 \addplot[black,mark=square*,mark options={fill=white}] table {re3a.data};
 \addplot[purple,mark=square*,mark options={fill=white}] table {re4a.data};
 \end{axis}