Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the CFG with {S,A,B) as the non-term... Start Learning for Free
Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF?
Most Upvoted Answer
Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) a...
Conversion of CFG to CNF

Step 1: Elimination of ε productions
- The given grammar has ε production in the production rules of B. We need to eliminate it.
- We can replace B → ε with two productions B → b and B → BB.
- After this step, the production rules become:
- S → ASA | aB | b
- A → B
- B → b | B B

Step 2: Elimination of unit productions
- There are no unit productions in the given grammar.

Step 3: Elimination of non-terminal symbols with more than 2 terminals
- There are no production rules with more than 2 non-terminals in the given grammar.

Step 4: Conversion of remaining productions to CNF
- We need to convert the remaining production rules to CNF.
- The production S → ASA has 3 non-terminals. We can introduce a new non-terminal symbol C and replace S → ASA with S → AC and C → SA.
- After this step, the production rules become:
- S → AC | aB | b
- A → B
- B → b | BB
- C → SA

Final CNF form of the given grammar
- The final form of the given grammar in CNF is:
- S → AC | aB | b
- A → B
- B → b | BB
- C → SA
- A → C
- S → A
- S → B
- C → B
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF?
Question Description
Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF?.
Solutions for Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? defined & explained in the simplest way possible. Besides giving the explanation of Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF?, a detailed solution for Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? has been provided alongside types of Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? theory, EduRev gives you an ample number of questions to practice Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b, ε) as the terminal alphabet, S as the start symbol and the following set of production rules S → ASA | aB | b A → B B → b | ∈ Convert the given grammar into CNF? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev