# HG changeset patch # User Christian Urban # Date 1380189954 -3600 # Node ID ffde837b1db1a923381428e142828e2531b5339f # Parent bea2dd1c7e73f7fe52c14e4bb8e04db550e8457d updated diff -r bea2dd1c7e73 -r ffde837b1db1 hws/hw01.pdf Binary file hws/hw01.pdf has changed diff -r bea2dd1c7e73 -r ffde837b1db1 hws/hw01.tex --- a/hws/hw01.tex Thu Sep 26 10:52:54 2013 +0100 +++ b/hws/hw01.tex Thu Sep 26 11:05:54 2013 +0100 @@ -18,6 +18,9 @@ \item {\bf (Optional)} Have a look at the crawler programs. Can you find a usage for them in your daily programming life? +\item Read the handout of the first lecture and make sure you +understand the concepts of strings and languages. + \item In the context of the AFL-course, what is meant by the term \emph{language}? \item Give the definition for regular expressions. What is the meaning of a @@ -29,8 +32,6 @@ \item How is the power of a language defined? (Hint: There are two rules, one for $\_\!\_^0$ and one for $\_\!\_^{n+1}$.) -\item Given the regular expressions $r_1 = \epsilon$ and $r_2 = \varnothing$ and $r_3 = a$. -How many strings can the regular expressions $r_1^*$, $r_2^*$ and $r_3^*$ each match? \end{enumerate} diff -r bea2dd1c7e73 -r ffde837b1db1 hws/hw02.pdf Binary file hws/hw02.pdf has changed diff -r bea2dd1c7e73 -r ffde837b1db1 hws/hw02.tex --- a/hws/hw02.tex Thu Sep 26 10:52:54 2013 +0100 +++ b/hws/hw02.tex Thu Sep 26 11:05:54 2013 +0100 @@ -9,6 +9,12 @@ \section*{Homework 2} \begin{enumerate} +\item What is the meaning of a regular expression? Give an inductive definition. + +\item Given the regular expressions $r_1 = \epsilon$ and $r_2 = \varnothing$ and $r_3 = a$. +How many strings can the regular expressions $r_1^*$, $r_2^*$ and $r_3^*$ each match? + + \item Give regular expressions for (a) decimal numbers and for (b) binary numbers. (Hint: Observe that the empty string is not a number. Also observe that leading 0s are normally not written.)