handouts/ho02.tex
changeset 550 a62357075346
parent 512 56550ad904d8
child 566 629ebe8b7bbd
equal deleted inserted replaced
549:6f53ef9a9b21 550:a62357075346
    25 
    25 
    26   
    26   
    27 \begin{center}
    27 \begin{center}
    28 Graphs: $(a^*)^* \cdot b$ and strings $\underbrace{a\ldots a}_{n}$
    28 Graphs: $(a^*)^* \cdot b$ and strings $\underbrace{a\ldots a}_{n}$
    29 \begin{tabular}{@{}cc@{}}
    29 \begin{tabular}{@{}cc@{}}
    30 \begin{tikzpicture}
    30 \begin{tikzpicture}[baseline=(current bounding box.north)]
    31 \begin{axis}[
    31   \begin{axis}[
    32     xlabel={$n$},
    32     xlabel={$n$},
    33     x label style={at={(1.05,0.0)}},
    33     x label style={at={(1.05,0.0)}},
    34     ylabel={time in secs},
    34     ylabel={time in secs},
    35     enlargelimits=false,
    35     enlargelimits=false,
    36     xtick={0,5,...,30},
    36     xtick={0,5,...,30},
    39     ytick={0,5,...,30},
    39     ytick={0,5,...,30},
    40     scaled ticks=false,
    40     scaled ticks=false,
    41     axis lines=left,
    41     axis lines=left,
    42     width=5cm,
    42     width=5cm,
    43     height=5cm, 
    43     height=5cm, 
    44     legend entries={Java, Python},  
    44     legend entries={Java 8, Python},  
    45     legend pos=north west,
    45     legend pos=north west,
    46     legend cell align=left]
    46     legend cell align=left]
    47 \addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
    47 \addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
    48 \addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
    48 \addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
    49 \end{axis}
    49 \end{axis}
    50 \end{tikzpicture}
    50 \end{tikzpicture}
    51 &
    51 &
    52 \begin{tikzpicture}
    52 \begin{tikzpicture}[baseline=(current bounding box.north)]
    53   \begin{axis}[
    53   \begin{axis}[
    54     xlabel={$n$},
    54     xlabel={$n$},
    55     x label style={at={(1.1,0.0)}},
    55     x label style={at={(1.1,0.0)}},
    56     %%xtick={0,1000000,...,5000000}, 
    56     %%xtick={0,1000000,...,5000000}, 
    57     ylabel={time in secs},
    57     ylabel={time in secs},
   743     ylabel={time in secs},
   743     ylabel={time in secs},
   744     enlargelimits=false,
   744     enlargelimits=false,
   745     ymax=35,
   745     ymax=35,
   746     ytick={0,5,...,30},
   746     ytick={0,5,...,30},
   747     axis lines=left,
   747     axis lines=left,
   748     %scaled ticks=false,
   748     %%scaled ticks=false,
   749     x label style={at={(1.09,0.0)}},
   749     x label style={at={(1.09,0.0)}},
   750     %xmax=7700000,
   750     %%xmax=7700000,
   751     width=9cm,
   751     width=9cm,
   752     height=5cm, 
   752     height=5cm, 
   753     legend entries={Scala V3},
   753     legend entries={Scala V3},
   754     legend pos=outer north east,
   754     legend pos=outer north east,
   755     legend cell align=left]
   755     legend cell align=left]
   759 \end{tikzpicture}
   759 \end{tikzpicture}
   760 \end{center}
   760 \end{center}
   761 
   761 
   762 \subsection*{Epilogue}
   762 \subsection*{Epilogue}
   763 
   763 
   764 (23/Aug/2016) I recently found another place where this algorithm can
   764 (23/Aug/2016) I found another place where this algorithm can
   765 be sped up (this idea is not integrated with what is coming next, but
   765 be sped up (this idea is not integrated with what is coming next, but
   766 I present it nonetheless). The idea is to not define \texttt{ders}
   766 I present it nonetheless). The idea is to not define \texttt{ders}
   767 that it iterates the derivative character-by-character, but in bigger
   767 that it iterates the derivative character-by-character, but in bigger
   768 chunks. The resulting code for \texttt{ders2} looks as follows:
   768 chunks. The resulting code for \texttt{ders2} looks as follows:
   769 
   769