hws/hw02.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 26 Sep 2013 10:41:47 +0100
changeset 102 1ab41c59e3d3
parent 93 hw/hw02.tex@4794759139ea
child 104 ffde837b1db1
permissions -rw-r--r--
links
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
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 2}
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 Give regular expressions for (a) decimal numbers and for (b) binary numbers. 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
(Hint: Observe that the empty string is not a number. Also observe that leading 0s 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
are normally not written.)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\item Decide whether the following two regular expressions are equivalent $(\epsilon + a)^* \equiv^? a^*$ and 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
$(a \cdot b)^* \cdot a \equiv^? a \cdot (b \cdot a)^*$.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\item Given the regular expression $r = (a \cdot b + b)^*$. Compute what the derivative of $r$ is with respect to
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
$a$ and $b$. Is $r$ nullable?
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
\item What is a regular language?
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\item Prove that for all regular expressions $r$ we have
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
$\text{nullable}(r)$ \quad if and only if \quad $\texttt{""} \in L(r)$
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
%%% Local Variables: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
%%% End: