handouts/ho02.tex
changeset 291 201c2c6d8696
parent 272 1446bc47a294
child 296 796b9b81ac8d
equal deleted inserted replaced
290:3a2fa69ea675 291:201c2c6d8696
    21 \begin{tabular}{@{}cc@{}}
    21 \begin{tabular}{@{}cc@{}}
    22 \begin{tikzpicture}
    22 \begin{tikzpicture}
    23 \begin{axis}[xlabel={\pcode{a}s},ylabel={time in secs},
    23 \begin{axis}[xlabel={\pcode{a}s},ylabel={time in secs},
    24     enlargelimits=false,
    24     enlargelimits=false,
    25     xtick={0,5,...,30},
    25     xtick={0,5,...,30},
    26     xmax=30,
    26     xmax=33,
    27     ymax=35,
    27     ymax=35,
    28     ytick={0,5,...,30},
    28     ytick={0,5,...,30},
    29     scaled ticks=false,
    29     scaled ticks=false,
    30     axis lines=left,
    30     axis lines=left,
    31     width=5cm,
    31     width=5cm,
    33     legend entries={Python,Ruby},  
    33     legend entries={Python,Ruby},  
    34     legend pos=north west,
    34     legend pos=north west,
    35     legend cell align=left]
    35     legend cell align=left]
    36 \addplot[blue,mark=*, mark options={fill=white}] 
    36 \addplot[blue,mark=*, mark options={fill=white}] 
    37   table {re-python.data};
    37   table {re-python.data};
    38 \addplot[brown,mark=pentagon*, mark options={fill=white}] 
    38 \addplot[brown,mark=triangle*, mark options={fill=white}] 
    39   table {re-ruby.data};  
    39   table {re-ruby.data};  
    40 \end{axis}
    40 \end{axis}
    41 \end{tikzpicture}
    41 \end{tikzpicture}
    42 &
    42 &
    43 \begin{tikzpicture}
    43 \begin{tikzpicture}
    44   \begin{axis}[xlabel={\pcode{a}s},ylabel={time in secs},
    44   \begin{axis}[xlabel={\pcode{a}s},ylabel={time in secs},
    45     enlargelimits=false,
    45     enlargelimits=false,
    46     xtick={0,3000,...,12000},
    46     xtick={0,3000,...,12000},
    47     xmax=12000,
    47     xmax=12500,
    48     ymax=35,
    48     ymax=35,
    49     ytick={0,5,...,30},
    49     ytick={0,5,...,30},
    50     scaled ticks=false,
    50     scaled ticks=false,
    51     axis lines=left,
    51     axis lines=left,
    52     width=6.5cm,
    52     width=6.5cm,
   290 
   290 
   291 \[
   291 \[
   292 Der\,c\,A\;\dn\;\{s\,|\,c\!::\!s \in A\}
   292 Der\,c\,A\;\dn\;\{s\,|\,c\!::\!s \in A\}
   293 \]
   293 \]
   294 
   294 
   295 \noindent
   295 \noindent This operation essentially transforms a set of
   296 which essentially transforms a set of strings $A$ by filtering out all
   296 strings $A$ by filtering out all strings that do not start
   297 strings that do not start with $c$ and then strips off the $c$ from
   297 with $c$ and then strips off the $c$ from all the remaining
   298 all the remaining strings. For example suppose $A = \{f\!oo, bar,
   298 strings. For example suppose $A = \{f\!oo, bar, f\!rak\}$ then
   299 f\!rak\}$ then
   299 \[ Der\,f\,A = \{oo, rak\}\quad,\quad Der\,b\,A = \{ar\} \quad
   300 \[
   300 \text{and} \quad Der\,a\,A = \varnothing \]
   301 Der\,f\,A = \{oo, rak\}\quad,\quad
       
   302 Der\,b\,A = \{ar\}  \quad \text{and} \quad
       
   303 Der\,a\,A = \varnothing
       
   304 \]
       
   305  
   301  
   306 \noindent
   302 \noindent
   307 Note that in the last case $Der$ is empty, because no string in $A$
   303 Note that in the last case $Der$ is empty, because no string in $A$
   308 starts with $a$. With this operation we can state the following
   304 starts with $a$. With this operation we can state the following
   309 property about $der$:
   305 property about $der$: