Question


UueSLIORS! 1. Find the error in logic in the following statement: We know that a b is a context-free, not regular language.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Class of CFL are not closed under complementation does not mean that if L is CFL then \bar{L} is always not context-free. It could either be context-free or not context-fred.

2. For every CFL L, there is a CFG G such that L(G)= L.

Now LR i.e. reverse of L can be produced by grammar G' such that G' has all the production rules of G in reverse order. This means that if G has production rule N na where a € {NUV} I.e. any combination of terminal and non-terminal, then G' will have rule N → Reverse(a)

Now G' will produce language which is reverse of language produced by G. Since CFG G' exist for Reverse(L), hence Reverse(L) is context-free.

3. Below is the NFA for it.

Yes this can be accepted by NFA with 2 states as well shown below

4. The regular expression for this NFA is

(0+1)*01(0+011)*11*

Here string ending with 1 could only be accepted by this NFA with some other property. Here string b will only be accepted by this NFA.

Please post 2 questions 5 and 6 separately.

Add a comment
Know the answer?
Add Answer to:
UueSLIORS! 1. Find the error in logic in the following statement: We know that a b'...
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
  • 1(a)Draw the state diagram for a DFA for accepting the following language over alphabet {0,1}: {w...

    1(a)Draw the state diagram for a DFA for accepting the following language over alphabet {0,1}: {w | the length of w is at least 2 and has the same symbol in its 2nd and last positions} (b)Draw the state diagram for an NFA for accepting the following language over alphabet {0,1} (Use as few states as possible): {w | w is of the form 1*(01 ∪ 10*)*} (c)If A is a language with alphabet Σ, the complement of A is...

  • Automata Theory I've given my answer to 3d. Is it correct? If not, please correct it. Thanks

    Automata Theory I've given my answer to 3d. Is it correct? If not, please correct it. Thanks 3. Context-free languages are useful for the definition of programming languages. For example, we have looked at grammars for defining Lisp and C. (a) Give a context-free language that is not regular, establishing the added power of CFL (b) What language is accepted by the following grammar: (c) Build a context-free grammar for the language (wb w-wR, k 0 a,by (d) Build a...

  • 1. Write regular expressions to capture the following regular languages: (a) The set of binary strings...

    1. Write regular expressions to capture the following regular languages: (a) The set of binary strings which have a 1 in every even position. (Note: odd positions may be either 0 or 1.) (b) The set of binary strings that do not contain 011 as a substring. (c) Comments in Pascal. These are delimited by (* and *) or by { and }, and can contain anything in between; they are NOT allowed to nest, however. 2. Write a DFA...

  • Part B - Automata Construction Draw a DFA which accepts the following language over the alphabet...

    Part B - Automata Construction Draw a DFA which accepts the following language over the alphabet of {0,1}: the set of all strings such that the number of 0s is divisible by 2 and the number of 1s is divisible by 5. Your DFA must handle all intput strings in {0,1}*. Here is a methodical way to do this: Figure out all the final states and label each with the shortest string it accepts, work backwards from these states to...

  • Regular expressions, DFA, NFA, grammars, languages Regular Languages 4 4 1. Write English descriptions for the...

    Regular expressions, DFA, NFA, grammars, languages Regular Languages 4 4 1. Write English descriptions for the languages generated by the following regular expressions: (a) (01... 9|A|B|C|D|E|F)+(2X) (b) (ab)*(a|ble) 2. Write regular expressions for each of the following. (a) All strings of lowercase letters that begin and end in a. (b) All strings of digits that contain no leading zeros. (c) All strings of digits that represent even numbers. (d) Strings over the alphabet {a,b,c} with an even number of a's....

  • 3. [20 points] Give short answers to each of the following parts. Each answer should be...

    3. [20 points] Give short answers to each of the following parts. Each answer should be at most three sentences. Be sure to define any notation that you use. (a) Explain the difference between a DFA and an NFA. (b) Give a regular expression for the language consisting of strings over the alphabet 2-(0, 1) that contains an even number of 0's and an odd number of 1's and does not contain the substring 01. (c) Give the formal definition...

  • Question 1: Every language is regular T/F Question 2: There exists a DFA that has only...

    Question 1: Every language is regular T/F Question 2: There exists a DFA that has only one final state T/F Question 3: Let M be a DFA, and define flip(M) as the DFA which is identical to M except you flip that final state. Then for every M, the language L(M)^c (complement) = L( flip (M)). T/F Question 4: Let G be a right linear grammar, and reverse(G)=reverse of G, i.e. if G has a rule A -> w B...

  • Only 5-9 please 1. (10 points) True/False. Briefly justify your answer for each statement. 1) Any subset of a decidable...

    Only 5-9 please 1. (10 points) True/False. Briefly justify your answer for each statement. 1) Any subset of a decidable set is decidable 2) Any subset of a regular language is decidable 3) Any regular language is decidable 4) Any decidable set is context-free 5) There is a recognizable but not decidable language 6) Recognizable sets are closed under complement. 7) Decidable sets are closed under complement. 8) Recognizable sets are closed under union 9) Decidable sets are closed under...

  • 1. Design an NFA (Not DFA) of the following languages. a) Lw E a, b) lw...

    1. Design an NFA (Not DFA) of the following languages. a) Lw E a, b) lw contain substring abbaab) b) L- [w E 10,1,2) lsum of digits in w are divisible by three) c) L-(w E {0,1,2)' |The number is divisible by three} d) The language of all strings in which every a (if there are any) is followed immediately by bb. e) The language of all strings containing both aba and bab as substrings. f L w E 0,1every...

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