author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Sat, 11 Oct 2014 13:54:18 +0100 | |
changeset 271 | b9b54574ee41 |
parent 267 | a1544b804d1e |
child 292 | 7ed2a25dd115 |
permissions | -rw-r--r-- |
23 | 1 |
\documentclass{article} |
264
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
2 |
\usepackage{../style} |
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
3 |
\usepackage{../graphics} |
23 | 4 |
|
5 |
\begin{document} |
|
6 |
||
7 |
\section*{Homework 3} |
|
8 |
||
9 |
\begin{enumerate} |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
10 |
\item What is a regular language? Are there alternative ways to define this |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
11 |
notion? If yes, give an explanation why they define the same notion. |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
12 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
13 |
\item Why is every finite set of strings a regular language? |
132
04264d0c43bb
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
102
diff
changeset
|
14 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
15 |
\item Assume you have an alphabet consisting of the letters $a$, $b$ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
16 |
and $c$ only. (1) Find a regular expression that recognises the two |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
17 |
strings $ab$ and $ac$. (2) Find a regular expression that matches |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
18 |
all strings \emph{except} these two strings. Note, you can only use |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
19 |
regular expressions of the form |
258
1e4da6d2490c
updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
146
diff
changeset
|
20 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
21 |
\begin{center} $r ::= |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
22 |
\varnothing \;|\; \epsilon \;|\; c \;|\; r_1 + r_2 \;|\; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
23 |
r_1 \cdot r_2 \;|\; r^*$ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
24 |
\end{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
25 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
26 |
\item Define the function \textit{zeroable} which takes a regular |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
27 |
expression as argument and returns a boolean. The function should |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
28 |
satisfy the following property: |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
29 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
30 |
\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
31 |
$\textit{zeroable(r)} \;\text{if and only if}\; L(r) = \varnothing$ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
32 |
\end{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
33 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
34 |
\item Given the alphabet $\{a,b\}$. Draw the automaton that has two |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
35 |
states, say $q_0$ and $q_1$. The starting state is $q_0$ and the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
36 |
final state is $q_1$. The transition function is given by |
258
1e4da6d2490c
updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
146
diff
changeset
|
37 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
38 |
\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
39 |
\begin{tabular}{l} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
40 |
$(q_0, a) \rightarrow q_0$\\ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
41 |
$(q_0, b) \rightarrow q_1$\\ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
42 |
$(q_1, b) \rightarrow q_1$ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
43 |
\end{tabular} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
44 |
\end{center} |
258
1e4da6d2490c
updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
146
diff
changeset
|
45 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
46 |
What is the language recognised by this automaton? |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
47 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
48 |
\item Give a non-deterministic finite automaton that can recognise the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
49 |
language $L(a\cdot (a + b)^* \cdot c)$. |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
50 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
51 |
\item Given a deterministic finite automata $A(Q, q_0, F, \delta)$, |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
52 |
define which language is recognised by this automaton. Can you |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
53 |
define also the language defined by a non-deterministic automaton? |
23 | 54 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
55 |
\item Given the following deterministic finite automata over the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
56 |
alphabet $\{a, b\}$, find an automaton that recognises the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
57 |
complement language. (Hint: Recall that for the algorithm from the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
58 |
lectures, the automaton needs to be in completed form, that is have |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
59 |
a transition for every letter from the alphabet.) |
264
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
60 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
61 |
\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
62 |
\begin{tikzpicture}[scale=2, line width=0.7mm] |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
63 |
\node[state, initial] (q0) at ( 0,1) {$q_0$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
64 |
\node[state, accepting] (q1) at ( 1,1) {$q_1$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
65 |
\path[->] (q0) edge node[above] {$a$} (q1) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
66 |
(q1) edge [loop right] node {$b$} (); |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
67 |
\end{tikzpicture} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
68 |
\end{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
69 |
|
264
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
70 |
|
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
71 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
72 |
%\item Given the following deterministic finite automaton |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
73 |
% |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
74 |
%\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
75 |
%\begin{tikzpicture}[scale=3, line width=0.7mm] |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
76 |
% \node[state, initial] (q0) at ( 0,1) {$q_0$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
77 |
% \node[state,accepting] (q1) at ( 1,1) {$q_1$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
78 |
% \node[state, accepting] (q2) at ( 2,1) {$q_2$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
79 |
% \path[->] (q0) edge node[above] {$b$} (q1) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
80 |
% (q1) edge [loop above] node[above] {$a$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
81 |
% (q2) edge [loop above] node[above] {$a, b$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
82 |
% (q1) edge node[above] {$b$} (q2) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
83 |
% (q0) edge[bend right] node[below] {$a$} (q2) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
84 |
% ; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
85 |
%\end{tikzpicture} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
86 |
%\end{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
87 |
%find the corresponding minimal automaton. State clearly which nodes |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
88 |
%can be merged. |
31 | 89 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
90 |
\item Given the following non-deterministic finite automaton over the |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
91 |
alphabet $\{a, b\}$, find a deterministic finite automaton that |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
92 |
recognises the same language: |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
93 |
|
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
94 |
\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
95 |
\begin{tikzpicture}[scale=3, line width=0.7mm] |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
96 |
\node[state, initial] (q0) at ( 0,1) {$q_0$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
97 |
\node[state] (q1) at ( 1,1) {$q_1$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
98 |
\node[state, accepting] (q2) at ( 2,1) {$q_2$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
99 |
\path[->] (q0) edge node[above] {$a$} (q1) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
100 |
(q0) edge [loop above] node[above] {$b$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
101 |
(q0) edge [loop below] node[below] {$a$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
102 |
(q1) edge node[above] {$a$} (q2); |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
103 |
\end{tikzpicture} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
104 |
\end{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
105 |
|
271
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
106 |
\item Given the following deterministic finite automaton over the |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
107 |
alphabet $\{0, 1\}$, find the corresponding minimal automaton. In |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
108 |
case states can be merged, state clearly which states can be merged. |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
109 |
|
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
110 |
\begin{center} |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
111 |
\begin{tikzpicture}[scale=2, line width=0.7mm] |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
112 |
\node[state, initial] (q0) at ( 0,1) {$q_0$}; |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
113 |
\node[state] (q1) at ( 1,1) {$q_1$}; |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
114 |
\node[state, accepting] (q4) at ( 2,1) {$q_4$}; |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
115 |
\node[state] (q2) at (0.5,0) {$q_2$}; |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
116 |
\node[state] (q3) at (1.5,0) {$q_3$}; |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
117 |
\path[->] (q0) edge node[above] {$0$} (q1) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
118 |
(q0) edge node[right] {$1$} (q2) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
119 |
(q1) edge node[above] {$0$} (q4) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
120 |
(q1) edge node[right] {$1$} (q2) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
121 |
(q2) edge node[above] {$0$} (q3) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
122 |
(q2) edge [loop below] node {$1$} () |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
123 |
(q3) edge node[left] {$0$} (q4) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
124 |
(q3) edge [bend left=95, looseness = 2.2] node [left=2mm] {$1$} (q0) |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
125 |
(q4) edge [loop right] node {$0, 1$} (); |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
126 |
\end{tikzpicture} |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
127 |
\end{center} |
b9b54574ee41
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
267
diff
changeset
|
128 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
129 |
\item Given the following finite deterministic automaton over the alphabet $\{a, b\}$: |
264
4deef8ac5d72
uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
258
diff
changeset
|
130 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
131 |
\begin{center} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
132 |
\begin{tikzpicture}[scale=2, line width=0.5mm] |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
133 |
\node[state, initial, accepting] (q0) at ( 0,1) {$q_0$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
134 |
\node[state, accepting] (q1) at ( 1,1) {$q_1$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
135 |
\node[state] (q2) at ( 2,1) {$q_2$}; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
136 |
\path[->] (q0) edge[bend left] node[above] {$a$} (q1) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
137 |
(q1) edge[bend left] node[above] {$b$} (q0) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
138 |
(q2) edge[bend left=50] node[below] {$b$} (q0) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
139 |
(q1) edge node[above] {$a$} (q2) |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
140 |
(q2) edge [loop right] node {$a$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
141 |
(q0) edge [loop below] node {$b$} () |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
142 |
; |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
143 |
\end{tikzpicture} |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
144 |
\end{center} |
31 | 145 |
|
267
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
146 |
Give a regular expression that can recognise the same language as |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
147 |
this automaton. (Hint: If you use Brzozwski's method, you can assume |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
148 |
Arden's lemma which states that an equation of the form $q = q\cdot r + s$ |
a1544b804d1e
updated homeworks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
264
diff
changeset
|
149 |
has the unique solution $q = s \cdot r^*$.) |
23 | 150 |
\end{enumerate} |
151 |
||
152 |
\end{document} |
|
153 |
||
154 |
%%% Local Variables: |
|
155 |
%%% mode: latex |
|
156 |
%%% TeX-master: t |
|
157 |
%%% End: |