ALC Assignment I 2024
ALC Assignment I 2024
ALC Assignment I 2024
Please follow the College Instructions. Don’t forget to write your Name & ID#.
· Be Self-Seeking · You are requested to Answer all Questions. Answers in
English only ·
Grades will be depending on – Clarity, Creativity & Innovative …
SAQs
Q#1)
LAQs
Q#2)a) Draw a state diagram for a finite automaton that recognizes all strings
over {a, b} that contain the substring ‘ aaa’.
→S0 S0 S1
S1 S2 S1
*S2 S2 S2
Present State a b
q1 q3 ε
q2 q2, q3 q3
*q3 q3 q3
a) Design FA with ∑ = {a, b} accepts the set of all strings with three
consecutive a's.
Q#4)
{aacaa, bcb, abcba, bacab, abbcbba, ....} & derive a string "abbcbba"
1. S → aSa rule 1
2. S → bSb rule 2
3. S → c rule 3
1. S → AB | ε
2. A → aB
3. B → Sb
1. S → aB | bA
2. S → a | aS | bAA
By Syed Mutiullah Hussaini Sr.Faculty Member MCA_CSE_IT_DS_IoT@NSAKCET _Hyd 3
3. S → b | aS | aBB
d) Draw a derivation tree for the string "bab" from the CFG given by
1. S → bSb | a | b
e) Check whether the given grammar G is ambiguous or not.
1. A → AA
2. A → (A)
3. A → a
For the string "a(a)aa" the above grammar can generate two parse
trees:
***Good Luck***