GALGOTIAS COLLEGE OF ENGINEERING AND TECHNOLOGY
1, Knowledge Park-II, Greater Noida, U.P.
Even Semester 2024-25
Course/Branch: B.Tech /AIML
Semester: IV
Subject Name: Theory of Automata & Formal Languages
Subject Code: BCS 402
Assignment 3
CO 3: Demonstrate the understanding of key notions, such as algorithm, computability,
decidability, and complexity through problem solving.
1. Construct a grammar for the language L = { an bn |n ≥1 }. Identify the type of the
grammar obtained.
2. Find the leftmost, rightmost derivation and construct trees for yield 00110101 from
the following grammar:
S→0B|1A, A→1AA|0S|0, B→0BB|1S|1
3. Consider the grammar G = (V, T, S, P) with productions defined by:
S → aSbS | bSaS | ^
Is G ambiguous? Is L(G) ambiguous?
4. Give CFG for the language L = {0m1n0m+n |m,n>=0}
5. Simplify the following grammar:
S→AB |BC | aACb|a
A→AAB|BD|abD|C
C→cA|S|a
D→d
E→ab
6. Reduce the following grammar into Chomsky Normal Form
a. S→ 1A |0B , A→ 1AA|0S |0 , B→0BB|1S|1
b. S→ abSb | a |aAb , A→ bS | aAAb
7.
When a CFG is said to be in GNF? Convert the following grammar to
GNF
E→E+T |T
T→T*F |F
F→(E) |a