Question
CFG questions
1. True or false? Given G: S → aSbSÍ bSaS | λ, L(G) = EQUAL. 2. Provide a grammar for all words that are not palindromes. 3. Provide a grammar for L = { a,b : is js 2 4. Provide a grammar for L = { aibak: i + j = k }. 5. Provide a grammar for L = { aba: i + k = j).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

Answer: TRUE

Because, Each production generates one a and one b otherwise empty string, So in string exactly same number of a's and b's.

2.

Grammer for non-palindromes:

Σ = {a, b)

The grammar:

SaSa bSblaXblbXa

Add a comment
Know the answer?
Add Answer to:
CFG questions 1. True or false? Given G: S → aSbSÍ bSaS | λ, L(G) =...
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
  • help 3. Answer each part for the following CFG G (The * symbom in the derivation...

    help 3. Answer each part for the following CFG G (The * symbom in the derivation means with any number of steps): R + XRXS S + aTb | b Ta T→ XTX | x | 6 X + ab (a) What are the variables of G? (b) What are the terminals of G? (c) Which is the start variable of G? (d) Give three strings in L(G) (e) Give three strings not in L(G) (f) True or False: T...

  • Please answer True or False on the following: 1. Let L = { w ε Σ^*...

    Please answer True or False on the following: 1. Let L = { w ε Σ^* | w = w^R }, where Σ = {a, b}. In other words, L is the set of all palindromes (including the empty string). A palindrome is a string that reads the same from left-to-right as from right-to-left. Let w = aababbbabb. Is w ε L^* ? (that is, is w an element of the Kleene closure of L?) 2. Let L = {...

  • Hello, I need help solving these two computer science questions. 3. Give a CFG for each...

    Hello, I need help solving these two computer science questions. 3. Give a CFG for each of the following: (a) The language {0416 with a +b}. (b) All binary palindromes with exactly three 1's (such as 001010100). 4. Consider the following CFG with start state S: SOAS 1BS € A → OAA 1 B + 1BBO Determine the language generated by S. Justify your answer.

  • i designed cfg form describe L. S -> aaSb | aaaSb | abb can you convert...

    i designed cfg form describe L. S -> aaSb | aaaSb | abb can you convert to cfg to pda and draw automata :) Let L = {a0<j<i< 3;}.

  • Please answer any 7 of them ТОС Answer any 7 from the followings: 1. Regular expression...

    Please answer any 7 of them ТОС Answer any 7 from the followings: 1. Regular expression to NFA: i) ab(aUb)* ii) (aba U a)*ab 2. Explain and construct a generalized NFA, 3. NFA to regular expression 0 3 91 93 8 a 4. DFA to regular expression 011 5. Explain the rules of pumping lemma briefly with an example. 6. Give an example of right linear grammar and left linear grammar. 7. L(G) = {1*20 m >= 1 and >=1}....

  • Automata and Computability Problems Please check my work. Make necessary edits/corrections to my work. Please add...

    Automata and Computability Problems Please check my work. Make necessary edits/corrections to my work. Please add more detail to number 2 for better understanding :) 1. Give a context-free grammar (CFG) for each of the following languages over the alphabet = (a, b): (a) All nonempty strings that start and end with the same symbol. 2. Answer each part for the following context-free grammar. I. II. III. IV. V. R> XRXS S -ать | bТа T → XTX | X...

  • 1. (20 points) Given the following Grammar G, S->ASB A -> aAS | a | λ...

    1. (20 points) Given the following Grammar G, S->ASB A -> aAS | a | λ B -> SbS | A|bb (a) Identify and remove the λ-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form. 1. (20 points) Given the following Grammar G, S->ASB A -> AS | a 1a B -> Sbs | Albb (a) Identify and remove the -productions. (b) Identify and remove unit-productions from the result of (a)....

  • Give a context free grammar for the language L where L = {a"bam I n>:O and...

    Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 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. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...

  • true/false 21 Uncountable infinity (for example, the cardinality of the real numbers). No Countable infinity (for...

    true/false 21 Uncountable infinity (for example, the cardinality of the real numbers). No Countable infinity (for example, the cardinality of the integers) ? All strings over the alphabet ?. CFG Context-free Grammar CFL Context-free Language L(G) The language generated by a CFG G. L(M) The language accepted by the automaton M. PDA Pushdown Automaton/Automata ISI The cardinality of set S. For example, I01 -o, and if S is an infinite set, ISI could be No or J1 L <M> L(M)...

  • Consider the given CFG: S ⟶ a X a X a , X ⟶ a X...

    Consider the given CFG: S ⟶ a X a X a , X ⟶ a X | b X | Λ What is the language this CFG generates? a) a language with all strings of at least 3 a's b) a language with all strings of a's and b's c) a language with all strings that start and end with a's with at most 3 a's d) a language with all strings of at most 3 a's e) None of...

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