hw03.tex
author Christian Urban <urbanc@in.tum.de>
Tue, 09 Oct 2012 21:19:47 +0100
changeset 23 ea594f94f85d
child 27 0f05e90b960d
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass{article}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{charter}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage{hyperref}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage{amssymb}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{amsmath}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\section*{Homework 3}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\begin{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\item Assume you have an alphabet consisting of the letters $a$, $b$ and $c$ only.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
(a) Find a regular expression that recognises the two strings $ab$ and $ac$. (b)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
Find a regular expression that matches all strings \emph{except} these two strings.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
Note, you can only use regular expressions of the form 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
$r ::= \varnothing \;|\; \epsilon \;|\; c  \;|\; r_1 + r_2  \;|\; r_1 \cdot r_2 \;|\; r^*$
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\item Define the function $zeroable$ which takes a regular expression as argument
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
and returns an integer. The function should satisfy the following property:
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
$zeroable(r)$ \;if and only if\; $L(r) = \varnothing$
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
%%% Local Variables: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
%%% End: