Question

2.3. For each of the NFA8 in Problem 2.2, construct the equivalent DFA

Ь а, {1, 2} {3} (а) Strings: aaab, baаab, ababab, baabb, aba {2, 3 1} 2 1, 2 {1} 3 ь а {4} {1} {3} {} 1 Strings: abaab, baabb

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

a).

The corresponding DFA is:

b a 1 12 12 12 23 3 1 12 23 123 12 123 12 123

Let us understand how this DFA is being constructed from the given NFA.

State 1, on getting input 'a', goes to two states: state 1 and state 2. So, we make a new state named "12", which is a combination of state 1 and state 2. State 1 on getting input 'b' goes to state 3, so that will remain the same.

Now, we will consider the newly created state "12". For this, we will take the union of the states 1 and 2. For e.g.,

  • On input 'a', state 1 goes to {1,2} while state 2 goes to {1}. The union of {1,2} and {1} is {1,2}. Thus, like the previous case, we should make a new state named "12". But, there is already a state 12. Therefore, we will not make a new state.
  • Similarly, on input 'b', state 1 goes to {3} while state 2 goes to {2,3}. The union of {3} and {2,3} is {2,3}. Therefore, we will make a new state named "23" which is a combination state 2 and state 3.

We will do this for all the states present in the DFA constructed till that point. For e.g., our DFA just got a new state "23". So, we will perform the same procedure for this state too.

This means that we will have to perform this procedure for any number of states being introduced in the DFA table.

Since 2 is the final state in the NFA, in the DFA, all the states containing 2 will be the final states. The states containing 2 are 12, 23, and 123. Thus, these are the final states.

This is how the above DFA is constructed.

b).

The corresponding DFA is:

b 4

(Refer to the part a) for detailed explanation).

Here, state 2 on input ε goes nowhere in the NFA. Thus, we create a new state named 5, which is also called as the dead state or the trap state. (I've named it 5 just because there are 4 states already present names 1-4. You can name it anything you want to.)

A dead state will always point to itself, no matter what the input is. That is why it is also called as the trap state. Thus, in the above case, state 5 will go to itself on getting any input.

Since 3 is the final state in the NFA, in the DFA, all the states containing 3 will be the final states. The state containing 3 is 3 itself. Thus, it will be the final state in the DFA too.

c).

The corresponding DFA is:

h C 1 12 2 13 5 12 123 23 13 4 4 2 3 23 1 13 123 23 1234 2 1234 1 1234 23 1234 14 34 23 124 14 34 3 2 24 1 4 1 2 3 5 23 1234

(Refer to the parts a) and b) for detailed explanation).

Here, as we go on constructing the DFA, we encounter more and more new states. Thus, the size of the DFA is very large. For 4 states in the NFA, we have 16 states in its equivalent DFA.

Since 3 is the final state in the NFA, in the DFA, all the states containing 3 will be the final states. The states containing 3 are 3, 13, 23, 123, 1234, 34, 134, and 234. Thus, these are the final states.

Hope it helped. If you have any doubts or queries, please feel free to ask in the comments section. If it helped in any way, please consider giving a thumbs up.

Add a comment
Know the answer?
Add Answer to:
2.3. For each of the NFA8 in Problem 2.2, construct the equivalent DFA Ь а, {1,...
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
  • I need to construct a deterministic finite automata, DFA M, such that language of M, L(M),...

    I need to construct a deterministic finite automata, DFA M, such that language of M, L(M), is the set of all strings over the alphabet {a,b} in which every substring of length four has at least one b. Note: every substring with length less than four is in this language. For example, aba is in L(M) because there are no substrings of at least 4 so every substring of at least 4 contains at least one b. abaaab is in...

  • 1) Assume ∑ = {a, b}, construct a DFA to recognize: {w | number of a's...

    1) Assume ∑ = {a, b}, construct a DFA to recognize: {w | number of a's in w ≥ 2 and number of b's in w ≤ 1}. (seven states) 2) Assume ∑ = {a, b}, construct a DFA to recognize: {w || w | ≥ 2, second to the last symbol of w is b}. (four states) 3) Write a regular expression for: All bit strings that contain at least three 1's.

  • 1.A: Let Sigma be {a,b}. Draw a DFA that will accept the set of all strings...

    1.A: Let Sigma be {a,b}. Draw a DFA that will accept the set of all strings x in which the last letter of x occurs exactly twice in a row. That is, this DFA should accept bbabbbaa (because there are two a's at the end), and aaabb (two b's), but should not accept aaa (3 a's in a row, and 3 is not exactly 2), nor single letter words such as 'b', nor baba, etc.

  • 1.         Construct a DFA for each of the following regular expressions: a)                     ab + c...

    1.         Construct a DFA for each of the following regular expressions: a)                     ab + c b)                    a*b + c c)                     ab*c*+ ac 2.         Construct an NFA for the following regular expression:             a)                     (a + b)*ab b)                    a*b* c)                     a*b* + c d)                    a* + b* e)                    a* + b* + ac*

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

  • 1. Construct a DFA that recognizes each of the following languages: a. L1 = {w €...

    1. Construct a DFA that recognizes each of the following languages: a. L1 = {w € {a, b}* | w contains at least two a's and at least two b’s} b. L2 = {w € {a,b}* | w does not contain the substring abba} C. L3 = {w € {a, b}* | the length of w is a multiple of 4}

  • Given below are three pairs of alkyl halides. In each pair, determine the halide that will...

    Given below are three pairs of alkyl halides. In each pair, determine the halide that will react less rapidly with a given nucleophile under identical conditions via SN2 mechanism. CH3CH2CH (CH3)2CHCH2CI CH3CH2CH2Br (CH3)2CHBO а нь 2 1 2 3 А. ь а В. ь ь а с. aь а E. а а а

  • Consider an NFA defined by the following transition table q        a         b        λ 1    {1}     &nbs

    Consider an NFA defined by the following transition table q        a         b        λ 1    {1}       Ф       {2,4} 2     {3}     {5}        Ф 3     Ф        {2}       Ф 4     {5}      {4}      Ф 5     Ф         Ф        Ф Convert this table to the corresponding table for the NFA without λ transitions Convert the resulting NFA into DFA.\ Consider an NFA defined by the following transition table 4 а ь 2 1 {1} {2,4} 2 {3} {5} 3 0 {2} 4 {5} {4} 5 ¢ (a)...

  • 22. A) Use the following data to construct a Control Chart with the UCL, LCL and...

    22. A) Use the following data to construct a Control Chart with the UCL, LCL and Central Line for the X Bar and R Chart. n- 5 Group 1: 2.1, 2.3, 2.5, 2.1, 2.0 Group 2: 2.2, 2.1, 2.0, 2.0, 2.1 Group 3: 2.0, 2.3, 2.1, 2.5, 2.2 Group 4: 2.0, 2.1, 2.1, 2.0, 2.1 Group 5: 2.3, 2.0, 2.3, 2.1, 2.2 Group 6: 2.2, 2.5, 2.1, 2.0, 2.0 Group 7: 2.1, 2.3, 2.5, 2.0, 2.1 Group 8: 2.0, 2.1,...

  • How many kinds of chemically non-equivalent hydrogens are there in each of the following compounds? а...

    How many kinds of chemically non-equivalent hydrogens are there in each of the following compounds? а trans-1-Chloro-1-butene The number of chemically non-equivalent hydrogens is HH b CH3-CH, CH2-CH, The number of chemically non-equivalent hydrogens is How many kinds of chemically non-equivalent hydrogens are there in each of the following compounds? The number of chemically non-equivalent hydrogens is . h 1,1-Dichlorocyclopentane The number of chemically non-equivalent hydrogens is How many kinds of chemically non-equivalent hydrogens are there in each of the...

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