Grammar ambiguity and removal techniques
AnswerA CFG is ambiguous if some terminal word has two distinct parse trees. Equivalently, it has two distinct leftmost derivations for the…
Read more →AnswerA CFG is ambiguous if some terminal word has two distinct parse trees. Equivalently, it has two distinct leftmost derivations for the…
Read more →AnswerIn Chomsky normal form (CNF), each production has the form X→YZ, where Y and Z are variables, or X→t, where t is…
Read more →AnswerA pushdown automaton extends a finite automaton with an unbounded last-in-first-out stack. It is described by (Q,Σ,Γ,δ,q₀,Z₀,F), where Γ is the stack…
Read more →AnswerUse states p (push), r (pop), f (accept), stack alphabet {A,Z}, initial stack Z and initial state p. The stack top is…
Read more →RGPV | CS-501 (GS) | December 2025 | 7(a)Question (restated): Explain Turing machines and common design techniques.AnswerA Turing machine consists of finite…
Read more →AnswerUse states E (even), O (odd), accept and reject. E is initial. The tape alphabet is {0,1,□}. Scan the input from left…
Read more →AnswerA language is decidable (recursive) if a Turing machine halts on every input, accepting members and rejecting nonmembers. Regular and context-free languages…
Read more →AnswerThe paper omits the initial state and δ(q₁,a). Assume q₀ is initial and the missing transition is the empty set. Subset construction…
Read more →AnswerA regular expression denotes a regular language. The basic expressions ∅, ε and a denote the empty language, the language containing the…
Read more →AnswerThe required expression is (a+b)*ab, equivalently (a|b)*ab. The star allows any finite prefix, including ε, while the final concatenation forces the last…
Read more →Ask a study question in English or Hindi. I will find relevant passages from our notes.