Question

1)Convert the following context free grammar to Chomsky Normal Form S → a X | Yb...

1)Convert the following context free grammar to Chomsky Normal Form

S → a X | Yb

X → S | λ

Y → b Y | λ

2)Some languages distinguish between uppercase and lowercase in identifiers. What are the pros and cons of this design decision?

3)Use the pumping lemma to prove that the following languages are not regular.     (The alphabet is Σ = {a, b}.)

a) L = {an b1 ak: k >= n+ l}

b) L = {ww: w ∈ Σ *}

c) L= {ak2} // this is k square

d) L ={uwwrv :u,v,w ∈ Σ+, |u| >= |v|}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)Convert the following context free grammar to Chomsky Normal Form

S → a X | Yb
X → S | λ
Y → b Y | λ

-> Remove λ productions
S → a X | Yb | a | b
X → S
Y → b Y | b

-> Remove unit productions
S → a S | Yb | a | b
Y → b Y | b

-> Replace all productions with non-terminals except for unit productions
Below is the final CNF grammar

S → AS | YB | a | b
Y → BY | b
A → a
B → b

Note: One question at a time please -- HOMEWORKLIB RULES

Add a comment
Know the answer?
Add Answer to:
1)Convert the following context free grammar to Chomsky Normal Form S → a X | Yb...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT