handouts/graphs.tex
author cu
Thu, 19 Oct 2017 11:04:43 +0100
changeset 524 3acec8c93c4b
parent 497 c498cb53a9a8
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
497
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass{article}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{../style}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage{../langs}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage{../graphics}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{../data}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\begin{document}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\section*{Benchmarks for $(a^*)^* b$ and $a^{?\{n\}} a^{\{n\}}$}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\mbox{}\bigskip
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\begin{center}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
$(a^*)^* \cdot b$ and strings $\underbrace{a\ldots a}_{n}$\medskip\\
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\begin{tabular}{@{}cc@{}}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\raisebox{5mm}{
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\begin{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\begin{axis}[
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
    xlabel={$n$},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
    x label style={at={(1.05,0.0)}},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
    ylabel={time in secs},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
    enlargelimits=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
    xtick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
    xmax=33,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
    ymax=35,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
    ytick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
    scaled ticks=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
    axis lines=left,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
    width=5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
    height=5cm, 
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
    legend entries={Java, Python},  
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
    legend pos=north west,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
    legend cell align=left]
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
\end{axis}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
\end{tikzpicture}}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
&
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
\begin{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  \begin{axis}[
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
    xlabel={$n$},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    x label style={at={(1.1,0.0)}},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    %%xtick={0,1000000,...,5000000}, 
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    ylabel={time in secs},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    enlargelimits=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    ymax=35,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    ytick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
    axis lines=left,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
    %scaled ticks=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
    width=6.5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
    height=5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
    legend entries={Derivative matcher},  
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
    legend pos=north east,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
    legend cell align=left]
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
%\addplot[green,mark=square*,mark options={fill=white}] table {re2a.data};    
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
\addplot[black,mark=square*,mark options={fill=white}] table {re3a.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
\end{axis}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
\end{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
\end{tabular}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
\end{center}\bigskip
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
\begin{center}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
$a^{?\{n\}} \cdot a^{\{n\}}$ and strings $\underbrace{a\ldots a}_{n}$\medskip\\
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
\begin{tabular}{@{}cc@{}}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
\begin{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
\begin{axis}[
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
    xlabel={$n$},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
    x label style={at={(1.05,0.0)}},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
    ylabel={\small time in secs},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
    enlargelimits=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
    xtick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
    xmax=33,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
    ymax=35,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
    ytick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
    scaled ticks=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
    axis lines=left,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
    width=5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
    height=5cm, 
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
    legend entries={Python,Ruby},  
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
    legend pos=north west,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
    legend cell align=left]
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
\addplot[brown,mark=triangle*, mark options={fill=white}] table {re-ruby.data};  
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
\end{axis}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
\end{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
&
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
\begin{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  \begin{axis}[
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
    xlabel={$n$},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
    x label style={at={(1.1,0.05)}},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
    ylabel={\small time in secs},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
    enlargelimits=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
    xtick={0,2500,...,11000},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
    xmax=12000,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
    ymax=35,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
    ytick={0,5,...,30},
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
    scaled ticks=false,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
    axis lines=left,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
    width=6.5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
    height=5cm,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
    legend entries={Derivative matcher},  
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
    legend pos=north east,
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
    legend cell align=left]
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
%\addplot[green,mark=square*,mark options={fill=white}] table {re2.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
\addplot[black,mark=square*,mark options={fill=white}] table {re3.data};
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
\end{axis}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
\end{tikzpicture}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\end{tabular}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
\end{center}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
\subsubsection*{Sources}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
\url{http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java}\medskip
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
\noindent
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
\url{http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
\end{document}
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
%%% Local Variables: 
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
%%% mode: latex
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
%%% TeX-master: t
c498cb53a9a8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
%%% End: