Question

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

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

a) search for "abbaab" and if it is present then whatever appears keep it in the final state otherwise redirect it to some other state

b)state 1 represents sum=0 or sum = multiple of 3, state 2 represents sum=1,state 3 represents sum=2. Hence, state 1 is the final state.

c) A number is divisible by three only if the sum of the digits of the number is divisible by 3. Therefore, both (b) and (c) are same.

d)for every a, if there are 2 bs which follow it then direct it to the final state. otherwise, direct it to state 4, which is a rejection state.

e)upper half represents aba as substring and lower half represents bab as substring. Combining both will give solution.

f)if there is 1 after o, direct it to the final state, otherwise, direct it to state 3, which is a rejection state.

g)state 1 represents even number of as and even number of bs, state 2 represents odd number of as and even number of bs, state 3 represents even number of as and odd number of bs, state 4 represents odd number of as and odd number of bs. According to the question, state 2 is the solution.

Add a comment
Know the answer?
Add Answer to:
1. Design an NFA (Not DFA) of the following languages. a) Lw E a, b) lw...
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
  • 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....

  • I am not sure where to begin... I know that DFA's are 5-tuple. I am having trouble drawing the DFA if someone could...

    I am not sure where to begin... I know that DFA's are 5-tuple. I am having trouble drawing the DFA if someone could help me draw the DFA I could do the rest. Thank you for your time. Give a formal definition of a DFA whose language is Li-(w E 10,1,2)z the first character of wis the same as the last character of w). (Think about what to do with the empty string and with strings of length 1.) *...

  • 3) Construct a regular expression defining each of the following languages over the alphabet {a, b}....

    3) Construct a regular expression defining each of the following languages over the alphabet {a, b}. (a) L = {aab, ba, bb, baab}; (b) The language of all strings containing exactly two b's. (c) The language of all strings containing at least one a and at least one b. (d) The language of all strings that do not end with ba. (e) The language of all strings that do not containing the substring bb. (f) The language of all strings...

  • 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...

  • Problem 4 Draw a DFA and an NFA for the following languages where = {a,b}. (a)...

    Problem 4 Draw a DFA and an NFA for the following languages where = {a,b}. (a) L={(ab)n; n 0} (b) L={an(bb); n 1} We were unable to transcribe this imageWe were unable to transcribe this imageWe were unable to transcribe this image

  • given ∑ = {a,b}: 1. describe in English the languages denoted by the regular expression: (a+b)*b(a+b)*...

    given ∑ = {a,b}: 1. describe in English the languages denoted by the regular expression: (a+b)*b(a+b)* 2. Write a regular expression: L(w) = {w | w has exactly a single substring abaa or exactly a single substring babb} 3. Write a regular expression for the following language: L(w) = {w | w ends in bb and does contain the substring aba}

  • 1. Construct a NESA with at least one s-moves to accept each of the following languages....

    1. Construct a NESA with at least one s-moves to accept each of the following languages. (a) (we 10,1)* | w corresponds to the binary encoding of a positive integer that is (b)(a"ba" | m, n 20 and n%3 m%3} For instance, b, aba, aabaa, aaab, abaaaa, (c) (we (a,b* | w contains two consecutive b's that are not immediately followed by an divisible by 16 or is odd. aaaaabaa are in the language, but abãa is not. a'). For...

  • UueSLIORS! 1. Find the error in logic in the following statement: We know that a b'...

    UueSLIORS! 1. Find the error in logic in the following statement: We know that a b' is a context-free, not regular language. The class of context-free languages are not closed under complement, so its complement is not context free. But we know that its complement is context-free. 2. We have proved that the regular languages are closed under string reversal. Prove here that the context-free languages are closed under string reversal. 3. Part 1: Find an NFA with 3 states...

  • Part A) Construct an NFA (non-deterministic finite automata) for the following language. Part B) ...

    Part A) Construct an NFA (non-deterministic finite automata) for the following language. Part B) Convert the NFA from the part A into a DFA L- E a, b | 3y, z such that yz, y has an odd number of 'b' symbols, and z begins with the string 'aa') (Examples of strings in the language: x = babbaa, and x = abaabbaa. However, x-bbaababaa is not in the language.) L- E a, b | 3y, z such that yz, y...

  • For each of the languages listed below, give a regular expression that generates the lan- guage....

    For each of the languages listed below, give a regular expression that generates the lan- guage. Briefly justify your answer. (a) The set of strings over (a, b such that any a in the string is followed by an odd number of b's. Examples: bbbab E L, but abb f L. (b) The set of strings over fa, b in which there is an a in every even position and the total number of b's is odd, where the first...

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