LIACS
Leiden University
Examination Fundamentele Informatica
216 March 2018, l4:00
-
17:00Question
1:
[2 points]a)
Give a regular expressionfbr
the language consistingof all
strings over the alphabet{
a,b,
c}that contain exactly two b's and ending with one c.
b)
Give a regular expressionfor
the language consistingof all
strings over the alphabet{
a, b, c}that do notbegin with bb.
c)
Give a deterministicfinite
automatonM
accepting the language consistingof all
strings over the alphabet{
a, b,c}
that contain exactly two b's and at most one c.Question
2:
[2 points]Consider the following non-deterministic fìnite automaton
M
over the alphabet{
a,b }:a)
Give a non-deterministic finite automaton N without r\-transitions such thatL(N)
=L(M).
b)
Give a regular grammar G such that L(G) =L(M).
c)
Construct a de.temúnisficfinite
automaton accepting the same language.d)
Use c'rne of the method taught in class to find a regular expression r such thatL(r)
=L(M).
Question
3:
[1'5 points]Give counterexamples showing that the
lbllowing
statements on languages over the alphabet{
a,b }are wrong:
a)
Any subset of a regular language is regular.b)
The infinite union of regular languages is regular.c) If Lr
and Lz arc different regular languages andL¡
is not regular thenLtLzLt
is regular.Question
4:
[1point]
Give agrammarGsuch
thatL(G) = {
anbanb'akln, m,k >0
andm <k
}.Question
5:
[1.5 points]Consider a context-free grammar G with starting symbol S and productions:
S
-+
aSalX X+
aYalY Y-+
bYb I aa)
Show that G is ambiguous.b)
Give another grammar in Chomsky normal form generating the same language of G.Question
6:
[2 points]a)
Draw a pushdown automaton accepting by empty stackwith
one single stack symbols{X}
(thatis thus also the
initial
stack symbol) which recognizes the language consistingof all
strings over the alphabet{
a, b,c}
with c appearing only as the fìrst, the last and the middle symbol.b)
Use the pumping lemma to show that L cannol be a regular language.a
b
The final score is given by the sum of the points obtained.