← RGPV CS-501-CBGS Theory of Computation June 2020 Solved Paper
← RGPV CS-501-CBGS Theory of Computation December 2020 Solved Paper
Question
Write given CFG for R.E (011+1)*(01)*.
Asked in: CS-501 | June 2020 | 7(b)
Give CFG for R.E. (011+1)*(01)*.
Asked in: CS-501 | December 2020 | 3(a)
Answer
Use S → 011S | 1S | T and T → 01T | ε. The first variable generates any finite sequence of blocks 011 and 1. The second generates any finite sequence of 01 blocks. The transition S → T is irreversible, so all first-phase blocks precede all second-phase blocks. Example: S ⇒ 011S ⇒ 0111S ⇒ 0111T ⇒ 011101T ⇒ 011101. Both phases can be empty, giving ε. Every derivation produces a word in the expression, and every word described by the expression has a derivation by choosing its blocks in order. Thus the grammar is correct.
← RGPV CS-501-CBGS Theory of Computation June 2020 Solved Paper
← RGPV CS-501-CBGS Theory of Computation December 2020 Solved Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion