Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL
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-(a"b'am 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 (a'b'c il-j or j-l-k) - ie., the set of strings of a's followed by b's followed by c's, such that there are either a different number of a's and b's or a different number of-b's and c's, 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 a's as c%) 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-(a"b'am 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 (a'b'c il-j or j-l-k) - ie., the set of strings of a's followed by b's followed by c's, such that there are either a different number of a's and b's or a different number of-b's and c's, 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 a's as c%)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started