in Theory of Computation edited by
3,022 views
28 votes

Construct DFA's for the following languages:

  1. $L=\left\{w \mid w \in \{a,b\}^*, \text{ w has baab as a substring } \right\}$
  2. $L=\left\{w \mid w \in \{a,b\}^*,  \text{ w has an odd number of a's and an odd number of b's } \right\} $
in Theory of Computation edited by
3k views

1 comment

what if the remaining input will stand or loop within the state....................ie instead of giving b as back input let its loop there itself...............and same do for all????????
1

2 Answers

32 votes
 
Best answer

DFA for A:

Part (B):

edited by

2 Comments

How dfa A will accept baabbaab?? I think there should be transition from final stage to state 2???
0
@vupadhayayx86

Observe, after "baab" , there is a loop (a+b)*, so after once "baab" occurred, it will accept anything. so yout string "baabbaab" will definitely be accepted.
1
16 votes

DFA for (B)

edited by

2 Comments

q3 will be final.

q1 is for odd no of a's and even no of b's as it accepting a, bba, etc.
1
Updated.
0

Related questions