hws/hw01.tex
changeset 401 5d85dc9779b1
parent 394 2f9fe225ecc8
child 403 564f7584eff1
equal deleted inserted replaced
400:e4afe3f46c29 401:5d85dc9779b1
     7 
     7 
     8 \HEADER
     8 \HEADER
     9 
     9 
    10 \begin{enumerate}
    10 \begin{enumerate}
    11 
    11 
    12 \item {\bf (Optional)} If you want to run the code presented in the
    12 \item {\bf (Optional)} If you want to run the code presented
    13   lectures, install the Scala programming language available (for
    13       in the lectures, install the Scala programming language
    14   free) from
    14       available (for free) from
    15 
    15 
    16 \begin{center}
    16 \begin{center}
    17 \url{http://www.scala-lang.org}
    17 \url{http://www.scala-lang.org}
    18 \end{center}
    18 \end{center}
    19 
    19 
    20       If you want to follow the code I present during the lectures,
    20       If you want to follow the code I present during the
    21       read the handout about Scala.
    21       lectures, read the handout about Scala.
    22 
    22 
    23 \item {\bf (Optional)} Have a look at the crawler programs.  Can you
    23 \item {\bf (Optional)} Have a look at the crawler programs.
    24   find a usage for them in your daily programming life? Can you
    24       Can you find a usage for them in your daily programming
    25   improve them? (For example in cases there are links that appear on
    25       life? Can you improve them? (For example in cases there
    26   different recursion levels, the crawlers visit such web-pages
    26       are links that appear on different recursion levels, the
    27   several times. Can this be avoided?)
    27       crawlers visit such web-pages several times. Can this be
       
    28       avoided?)
    28 
    29 
    29 \item Read the handout of the first lecture and the handout about
    30 \item Read the handout of the first lecture and the handout
    30   notation. Make sure you understand the concepts of strings and
    31       about notation. Make sure you understand the concepts of
    31   languages.  In the context of the AFL-course, what is meant by the
    32       strings and languages. In the context of the AFL-course,
    32   term \emph{language}?
    33       what is meant by the term \emph{language}?
    33 
    34 
    34 \item Give the definition for regular expressions. What is the
    35 \item Give the definition for regular expressions. What is the
    35       meaning of a regular expression? (Hint: The meaning is
    36       meaning of a regular expression? (Hint: The meaning is
    36       defined recursively.)
    37       defined recursively.)
    37 
    38 
    53       the strings in $A$ is the empty string, for example $A =
    54       the strings in $A$ is the empty string, for example $A =
    54       \{[a], [b], [c], []\}$.
    55       \{[a], [b], [c], []\}$.
    55 
    56 
    56 \item How many basic regular expressions are there to match
    57 \item How many basic regular expressions are there to match
    57       the string $abcd$? (ii) How many if they cannot include
    58       the string $abcd$? (ii) How many if they cannot include
    58       $\epsilon$ and $\varnothing$? (iii) How many if they are
    59       $\ONE$ and $\ZERO$? (iii) How many if they are also not
    59       also not allowed to contain stars? (iv) How many if they
    60       allowed to contain stars? (iv) How many if they are also
    60       are also not allowed to contain $\_ + \_$?
    61       not allowed to contain $\_ + \_$?
    61 
    62 
    62 \item When are two regular expressions equivalent? Can you
    63 \item When are two regular expressions equivalent? Can you
    63       think of instances where two regular expressions match
    64       think of instances where two regular expressions match
    64       the same strings, but it is not so obvious that they do?
    65       the same strings, but it is not so obvious that they do?
    65       For example $a + b$ and $b + a$ do not count\ldots they
    66       For example $a + b$ and $b + a$ do not count\ldots they