| CS150 | October 28, 2004 |
| Youssef |
Problem 1: (25 points)
Construct a PDA for each of the following languages:
a) L={a3nb2n | n > 0}. Construct the PDA
without going through grammars.
b) L={a nbmcn+m | n > 0, m > 0}.
Again, do not go through grammars.
c) The language generated by the grammer in
Problem 5 in Homework 3.
For that, use the GNF grammar in the solution of that problem
to construct the PDA vy following the standard method.
Problem 2: (21 points)
Show that the following languages are not CFL's.
a) {an4 | n > 0}
d) {an2bn | n > 0}
e) {an! | n > 0}.
Problem 3: (24 points)
Using the closure properties of CFL's, show that the following languages
are CFL's:
a) L={a n b m | n > 2m}
b) L={a n b m | n != 2m}
c) L={a i b j c k | i != j or j != k}
d) L= the complement of {anbncn | n ≥ 0}.
Problem 4: (20 points)
Design Turing machines to recognize the following languages.
Your design (in this Problem and in Problem 5)
should start with a clear algorithmic description and end with a
formal definition of the
delta
function (with enough comments).
a) {anbm | n < m}.
b) {anbn+mcm | n>=0, m>=0}.
Problem 5: (10 points)
Design a TM that takes as input 0^n10^m
and gives output 0 |n-m| .