Question

Question 3 Give a context-free grammar for each of the following languages over = {a,b,c}. 1. {a^jen: n >0}. 2. {animck : k=n
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

Given, >= {a,b,c}

Let S is the starting Symbol.

1) Context free Grammar for (= {ab2n : n > 0

$aSbble

This production will give the the above grammar.

2. Context free Grammar for    (= {abck: K= n+m

     $ → ScT

  T \rightarrow bTc | \epsilon

Here c is generated for every a and b to give the required grammar.

3) Context free grammar for , L={ a's are as twice as many as b's}

  S \rightarrow aSbSa | bSaa | aaSb | SS | \epsilon

Here every b is associated with two a to give the required grammar.

Add a comment
Know the answer?
Add Answer to:
Question 3 Give a context-free grammar for each of the following languages over = {a,b,c}. 1....
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