# GATE2001-5

1.6k 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\}$

edited
1
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????????

DFA for A:

Part (B):

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

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.

DFA for (B)

edited
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

1
6k views
Given an arbitrary non-deterministic finite automaton (NFA) with $N$ states, the maximum number of states in an equivalent minimized DFA at least $N^2$ $2^N$ $2N$ $N!$
Let a decision problem $X$ be defined as follows: $X$: Given a Turing machine $M$ over $\Sigma$ and any word $w \in \Sigma$, does $M$ loop forever on $w$? You may assume that the halting problem of Turing machine is undecidable but partially decidable. Show that $X$ is undecidable Show that $X$ is not even partially decidable
Consider a DFA over $\Sigma=\{a,b\}$ accepting all strings which have number of a's divisible by $6$ and number of $b$'s divisible by $8$. What is the minimum number of states that the DFA will have? $8$ $14$ $15$ $48$