Question

Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form....

Convert the grammar G = ({S,A,B,C},{a,b},P,S), where P is given below, into the Chomsky Normal Form.
S −→ AaA | AB
A −→ BB | bAA | ε
B −→ bS | b | ε

Homework Answers

Answer #1

S → AaA | AB
A → BB | bAA | ε
B → bS | b | ε

Remove epsilon transitions

S → AaA | AB | A
A → BB | bAA | ε | B
B → bS | b

S → AaA | AB | A | aA | Aa | a | epsilon
A → BB | bAA | B | bA | b
B → bS | b

Remove UNIT rules

S → AaA | AB | aA | Aa | a | epsilon | BB | bAA | bS | bA | b
A → BB | bAA | bS | bA | b
B → bS | b

Remove mixed rules


S → AMA | AB | MA | AM | a | epsilon | BB | NAA | NS | NA | b
A → BB | NAA | NS | NA | b
B → NS | b
M -> a
N -> b

Change to final CNF

S → CA | AB | MA | AM | a | epsilon | BB | ND | NA | b | NS
A → BB | ND | NA | b | NS
B → NS | b
M -> a
N -> b
C -> AM
D -> AA

Please up vote. I need it very badly right now.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Obtain a grammar in Chomsky Normal Form (CNF) equivalent to the grammar G with productions P...
Obtain a grammar in Chomsky Normal Form (CNF) equivalent to the grammar G with productions P given S ->aAb | B A ->aA | a B-> bB | b
Convert the following CFL grammar to an equivalent grammar in Chomsky normal form. A → BAB...
Convert the following CFL grammar to an equivalent grammar in Chomsky normal form. A → BAB | B | ε B → OO | ε
1. Put the following grammar into Chomsky Normal Form. Note that this grammar has no useless...
1. Put the following grammar into Chomsky Normal Form. Note that this grammar has no useless symbols. S → iSE | a E → eS | ε
Convert the grammar below to Chromsky Normal Form: U --> Vab| S T--> abS|E
Convert the grammar below to Chromsky Normal Form: U --> Vab| S T--> abS|E
Given the following grammar G = (V, T, S, P) where S is the starting symbol....
Given the following grammar G = (V, T, S, P) where S is the starting symbol. (1) S → aS (2) S → aD (3) D → bD (4) D → λ (a) Give two strings of different lengths that are generated from G (b) Give two strings that cannot be generated from G (c) What is the language generated by G, that is L(G)
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S →...
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S → aSb / ∈ Grammar G2- S → aAb / ∈, A → aAb / ∈ a. is G1=G2 b. What is the grammar generated by the expression Problem 2: Let us consider the grammar. G2 = ({S, A}, {a, b}, S, {S → aAb, aA → aaAb, A → ε } ) Derive aaabbb Problem 3: Suppose we have the following grammar. G: N...
Given the following grammar and the right sentential form, draw a parse tree and then specify...
Given the following grammar and the right sentential form, draw a parse tree and then specify and write the phrases, simple phrase(s), and the handle. Grammar: S → aAb | bBA A → ab | aAB B → aB | b Sentential form: aaababb
For the given grammar below, find the first and follow function sets. Then, construct the parsing...
For the given grammar below, find the first and follow function sets. Then, construct the parsing table. By using the LL(1) parser and the parsing table, find if the given string “acfh” is accepted or rejected. S → aBDh B → cC | ε C → bC | ε D → EF E → g | ε F → f | ε
Given a grammar G, G = (Ν, Σ, Π, S), where Ν = { ... }...
Given a grammar G, G = (Ν, Σ, Π, S), where Ν = { ... } Σ = { ... } Π = { ... } S is ... What is the language L, L = L(G) ?
Given the following grammar and the right sentential form, draw a parse tree and then specify...
Given the following grammar and the right sentential form, draw a parse tree and then specify and write the phrases, simple phrase(s), and the handle. Grammar: S → AbB | bAc A → Ab | aBB B → Ac | cBb | c Sentential form: AbcacAbcbccb