CT-2 QB[1]
CT-2 QB[1]
i. S🡪XA | BB,
B🡪b | SB,
X🡪b,
A🡪a.
ii. S 🡪 AB
A 🡪BS | b
B 🡪 SA | a
iii. S → ABA
A→aA | ε
B →bB| ε
2. Prove that S🡪aS | aSbS | ε is ambiguous. Find the LMD and RMD for
the string w=aab and the corresponding parse tree.
3. Explain about Simplification of CFG and simplify the given
grammars
i) S🡪aS | AB, A🡪 ε,B🡪 ε, D🡪b.
ii)S->ABC,A->BC|a,B->bAC| ε.
iii) S🡪Aa|B,B🡪A|bb,A🡪a|bc|B
iv)S→aAa|aB, A→aS|bD, B→aBa|b,C→ abb | DD,
D→aDA
Representation
An ID can be represented in the format: (q,w,𝛂)where:
- q = current state of the PDA.
- w = remaining input string (input not yet processed).
- 𝛂 = contents of the stack (top of the stack is on the left).
Principles of ID
1. Initial State:
- The ID starts from an initial configuration, representing the beginning of
computation with the initial state, full input string, and an initial stack configuration.
2. Transitions:
- The PDA transitions from one ID to another based on input symbols, the current
stack top, and the defined transition function. A transition can modify the state,
consume input, and change stack contents.
3. Final State:
- An ID represents acceptance when it reaches a configuration with an empty input
string and either an empty stack or a specified final stack condition, depending on the
PDA design.
The DFA minimization algorithm effectively reduces the complexity of the automaton
while maintaining its language, improving efficiency in processing and memory
usage.
11. Give the leftmost and rightmost derivation for the string ‘aabbbbaa’
using the grammar S 🡪aB | bA, A 🡪a | aS | bAA, B 🡪 b | bS | aBB.
12. Explain in detail about Chomsky language classification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15