Fachbereich Mathematik
Kord Eickmeyer
Summer Term 2015
Mock Exam – Formal Foundations of Computer Science
(EM.1) [multiple choice, 8 credits]
Decide whether the following statements are true or false in general. No justification is
needed.
(i) For regular languages L1 , L2 , L3 ⊆ {0, 1}∗ one can algorithmically check if L1 =
L2 ∩ L3 .
(ii) If L is a regular language and M ⊆ L, then M is regular.
(iii) If L is a regular language and M ⊆ L, then M is context-free.
(iv) If L1 , L2 ⊆ Σ∗ are context-free, then L1 ∩L2 is decidable (i.e. one can algorithmically
check for w ∈ Σ∗ whether w ∈ L1 ∩ L2 ).
(v) If L1 , L2 ⊆ Σ∗ are context-free, then L1 ∩ L2 is also context-free.
(vi) Every context-free grammar is context-sensitive.
(vii) Every context-free language is context-sensitive.
(viii) If L is context-sensitive, then L∗ is context-sensitive.
(EM.2) [minimisation/conversion, 12 credits]
Consider the following NFA with four states:
1
0
1
0
q0
0
(i) Convert this NFA into a DFA.
(ii) Minimise the resulting DFA.
q1
1
q2
0
q3
(EM.3) [regular languages, 12 credits]
For a word a1 a2 . . . a` ∈ {0, 1}∗ let
f (a1 a2 . . . a` ) :=
`
X
ai 2i−1 ,
i=1
and f () := 0. In other words, f (w) is the numerical value of w if it is interpreted as a
natural number in binary representation, with the least significant bit first.
(i) Show that the language
L1 := {a1 b1 c1 a2 b2 c2 . . . a` b` c` f (a1 . . . a` ) + f (b1 . . . b` ) = f (c1 . . . c` )} ⊆ {0, 1}∗
is regular by giving a DFA that accepts L1 .
(ii) Show that the language
L2 := {uvw u, v, w ∈ {0, 1}n for some n ≥ 0 and f (u) + f (v) = f (w)} ⊆ {0, 1}∗
is not regular.
(EM.4) [rotated regular language, 10 credits]
For a language L ⊆ Σ∗ we define Rot(L) as
Rot(L) := {a2 a3 . . . a` a1 a1 a2 . . . a` ∈ L}.
Show that if L is regular, then Rot(L) is regular as well.
(EM.5) [context-free grammar, 12 credits]
Let G = ({f, g, x}, {T }, P, T ) be the context-free grammar with production rules
T → x f T gT T
(i) Convert this grammar into Chomsky normal form.
(ii) Use the CYK algorithm to check that f gf xx ∈ L(G).
© Copyright 2026 Paperzz