The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
777 views

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\} $
asked in Theory of Computation by Veteran (59.6k points)
edited by | 777 views
0
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????????

2 Answers

+22 votes
Best answer

DFA for A:

Part (B):

answered by Loyal (8.3k points)
edited by
0
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.
+15 votes

DFA for (B)

answered by Boss (43k points)
edited by
+1
q3 will be final.

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

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,599 questions
48,601 answers
155,674 comments
63,740 users