Universit¨at Duisburg-Essen SS 2012
Ingenieurwissenschaften / Informatik June 25, 2012
Professor: Dr. Sander Bruggink Exercise sheet 9
Teaching assistent: Jan St¨uckrath Deadline: 2 July 2012
Automaten und formale Sprachen
Exercise 26 Pumping and Shrinking of words (7 points) Let the context free grammarG= ({S, T, U, V, W},{a, b, c}, P, S) be given, where P is defined by
S →T U |W U V →c
T →a W →b
U →SV |T V |W V
Execute the following steps for the word babaccc:
(a) Give the syntax tree. (2 p)
(b) Give all possibilities, in which the word can be ”pumped”. For this purpose mark two occurences of a variable, which appear on a single path in the syntax tree. (2 p)
(c) ”Pump” and ”shrink” the word by doubling and removing parts of the syntax tree. (3 p)
Exercise 27 Pumping Lemma for context free languages (8 points) Show by means of the Pumping Lemma for context free languages, that the following languages are not context free:
(a) L1 ={a(m!) |m∈N0} (4 p)
(b) L2 ={ambk | ∃`:m·k = 2`∧m, k, ` ∈N0} (4 p)
(Note: If a good word is chosen only four cases have to be checked. Think about at which position in the word, the lasta or the first b occur.)
1
Exercise 28 Languages of pushdown automata (5 points)
Let the following pushdown automaton
K = ({s0, s1, s2, s3, se},{a, b, c},{A, B,#}, δ, s0,#) be given, where δ is defined as follows:
δ(s0, a,#) 3(s1, A#) δ(s2, b, B)3(s2, BB) δ(s0, b,#) 3(s2, B#) δ(s2, c, B)3(s3, ε) δ(s0, ε,#) 3(se, ε)
δ(s1, a, A)3(s1, AA) δ(s3, c, A)3(s3, ε) δ(s1, b, A)3(s2, BA) δ(s3, c, B)3(s3, ε) δ(s1, c, A)3(s3, ε) δ(s3, ε,#)3(se, ε)
Describe which tasks are undertaken by the particular states of the pushdown automaton.
Furthermore give the language N(K), which is accepted by the automaton K.
(Note: If δ(z, x, y)3(z0, y0) is not explicitly specified thenδ(z, x, y)63(z0, y0) holds.)
The solutions to this exercise sheet must be submitted before Monday, 2 July 2012 at 16:00.
Put your solutions in the letterbox labeled Automaten und formale Sprachen adjacent to roomlf, or hand them in through the onlinemoodle-platform. If you hand in online, please upload your solutions as a single pdf-file. Your name, student number, group number and the lecture name (“Automaten und formale Sprachen”) must be clearly written on your solutions.
2