Question

1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(abam I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. Give a context-free grammar for the set (abc il-j or j-l-k) - ie., the set of strings of as followed by bs followed by cs, such that there are either a different number of as and bs or a different number of-bs and cs, or both 5. Determine whether the following language L is a context free language. If ti is, give a CFG that generates L. If it is not, use the pumping lemma for Context Free Languages to prove that it is not. 6. L-s in lab,c,d, Is contains twice as many as as c%)

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

Solution:

Note: 1 and 2 are answered, please repost others.

1)

The grammar will be:

S=> {S} | [S] | (S) | \epsilon

2)

The PDA is given below:

Th ob

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Add a comment
Know the answer?
Add Answer to:
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three...
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