← RGPV CD-501 Theory of Computation November 2023 Solved Paper
Question
Find an equivalent CNF grammar for S→bA|Ab, A→bAA|aS|a, B→aBB|bS|b.
Asked in: CD-501 | November 2023 | 5(a)
Answer
B is unreachable from S and can be removed. Introduce X→a, Y→b, D→AA. Then S→YA|AY; A→YD|XS|a; D→AA; X→a; Y→b. If the convention prohibits the start symbol on right sides, introduce S0→YA|AY and use S0 as start. Every rule now has two variables or one terminal.
← RGPV CD-501 Theory of Computation November 2023 Solved Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion