Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
THEORY OF
COMPUTATION AND
Norwegian University of Science
and Technology
COMPUTATIONAL
Institutt for matematiske fag COMPLEXITY
Spring 2007
1 This problem has turned out to be somewhat easier than originally intended. Let
r = (a∗ ∪ b∗ ∪ aba)∗ and L be the language determined by r. Then
¡ ¢ ¡ ¢
{a, b}∗ ⊇ L = L (a∗ ∪ b∗ ∪ aba)∗ ⊇ L (a ∪ b)∗ = {a, b}∗
Therefore, L = {a, b}∗ and a correct answer to both a) and b) is for example:
¯ a,b
>}
1 0
¼ 0 1 ¦
8?9
>2=
:;<o /8?>
9=:;< /8?>
9:=<;
1 o 3
0 O 1
1 e
²
0 / 89:;
?>=<
7654
0123
>8?>
9s=
:;< f
Note that M has exactly one final state, f , and there are neither arrows ending at s
or starting at f , so M it has the necessary properties for us to start with the node
elimination. We can eliminate nodes in the order 2, 3, 1:
Step I:
01∗ 0 0
¼ 1 ¦
8?>
91= :;<o /8?9
>=:;<
3
O 1
1 e
²
0 / ?>=<
89:;
7654
0123
>8?>
9s=
:;< f
01∗ 0∪10∗ 1
¼
8?9
>1=:;<
O ;;;
;;
;;
;; 10∗
1 ;;
;;
;;
;;
À
0 / 89:;
?>=<
7654
0123
>8?9
>s=:;< f
Step III:
¡ ¢
0∪ 1(01∗ 0 ∪ 10∗ 1)∗ 10∗
>8?9
>s=
:;< / ?>=<
89:;
7654
0123
f
Remark: Note that the automaton M accepts exacly those numbers in binary nota-
tion that are divisible by 3.
{wzw | w, z ∈ Σ∗ } ⊇ {z | z ∈ Σ∗ } = Σ∗
4 None of the strings is in L(G). For a) and c), note that no number beginning with
1 can be derived from N . For b), the symbol “-” is not contained in V .
p S PPPP
ppppp PPP
PPP
ppp PPP
pp PP
pp
S + S@
~~ @@
~ @@
~~~ @@
~~ @
N S ∗ S
0 N N
0 0
and
nn S NNNN
nnnnn NNN
n nnn NNN
NNN
n
nnn
S@ ∗ S
~~ @@
~~ @@@
~~ @@
~~
S + S N
N N 0
0 0
° b ° a °
> R NN /R /R
NNN ppp
NNN
N t ppppp b
t NNN p t
N& ² xpppp ²
y n
b)
a,b
/
>Ro R
a,b
t t
² ²
ho Lt o a