Question

The question asks to design CFG for the following language {x over {a,b } x is...

The question asks to design CFG for the following language

{x over {a,b } x is not palindrome}

Homework Answers

Answer #1

CFG fot all sets of strings that are not palindroem over input alphabet {a,b} is:

S->aSa | bSb | aTb | bTa

T->aT | bT | ε

These production rules will generate all set of strings that are not palindrome.

Now try to derive any string from the mentioned productions say

S->aSa

S->aaTba

S->aaεba = aaba which is not palindrome

Palindrome String : A string is said to be a palindrome if the string read from left to right is equal to the string read from right to left.

CFG for palindrome string is:

S->a | b | aSa | bSb | ε

Know the answer?
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
Similar Questions
Consider the language L3 over alphabet Σ = { a, b }, L3 = { w...
Consider the language L3 over alphabet Σ = { a, b }, L3 = { w ∈ Σ* | w is a palindrome of any length}. Construct a PDA that recognizes L3. Implement that PDA in JFLAP
Use CFG or PDA to prove L= {0a1b0c : b ≠ a + c; a, b,...
Use CFG or PDA to prove L= {0a1b0c : b ≠ a + c; a, b, c ≥ _0} is a context-free language. Please add your explanation, thank you. If you can use the theorem(union of CFL and regular language = CFL) is also welcomed.
Design a DFA accepting the language of all strings over Σ = {0, 1} with the...
Design a DFA accepting the language of all strings over Σ = {0, 1} with the property that the number of 0s and the number of 1s in a string are both odd.
1. a) Rewrite the following rule base as a CFG and provide its formal definition (...
1. a) Rewrite the following rule base as a CFG and provide its formal definition ( S is the start state ) S → aSb | bAA A → b {aB} | a | Bc B → aB | c b) Generate the 10 smallest possible strings using the above rule base. ( from problem a) 2. Either show that the following strings are in this language or state why these strings can not be.. S → AB | BC...
Generate test cases for the following code by using MC/DC. a)       Draw the CFG. b)       What is MC/DC...
Generate test cases for the following code by using MC/DC. a)       Draw the CFG. b)       What is MC/DC logic coverage criteria? c)        List the test cases. d)       Validate the test cases can achieve MC/DC. public void TestValues( int a, int b, ref int x ) {     x = 0; if (a > 0 || b < 0)         x = 1;     else if (a > 10  && b > 10)         x = -1;                         }
Prove that the language A\B = {w: wx ∈ A, X ∈ B}, where A is...
Prove that the language A\B = {w: wx ∈ A, X ∈ B}, where A is a CFL and B is regular is a CFL.
DESIGN A FLOWCHART IN FLOWGORITHM Number Analysis Program Design a program that asks the user to...
DESIGN A FLOWCHART IN FLOWGORITHM Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
6. An experimenter performs a double bounded contingent valuation, where the first question asks the subject...
6. An experimenter performs a double bounded contingent valuation, where the first question asks the subject whether she would be willing to pay $5 for the product. Having answered no, the second question asks whether she would be willing to pay $6 for the product. Evaluate this design. Specifically, state whether it is a good or bad design and why.
Convert the following CFG to its equivalent CNF. S → aa S ddd | T T...
Convert the following CFG to its equivalent CNF. S → aa S ddd | T T → b T cc | ε
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m...
Prove the language of strings over {a, b} of the form (b^m)(a^n) , 0 ≤ m < n-2 isn’t regular. Use the pumping lemma for regular languages.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT