• edited by
46,334 views
76 76 votes
Consider the language $L$ given by the regular expression $(a+b)^{*} b (a+b)$ over the alphabet $\{a,b\}$. The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting $L$ is ___________ .

16 Answers

Best answer
98 98 votes
$\text{NFA}$

NFA to DFA Conversion:
In the State Transition Table below we can see 4 states $(\text{A}, \text{AB}, \text{*AC}, \text{*ABC},$ the $\text{*}$ ones being FINAL$)$ are there but before confirming the ans lets try to minimize. $\text{A}, \text{AB}$ cannot be minimized further because $A$ goes to non-final state on $a$ where as $\text{AB}$ goes to a final state.  Similarly $\text{*AC}$ goes to a non-final state on $\textbf{a}$ whereas $\text{*ABC}$ goes to a final state. Hence, none of the states can be merged.

$$\begin{array}{|c|c|c|} \hline \text{$\delta$} & \text{a} & \text{b} \\\hline \text{A} & \text{A} & \text{AB}\\ \text{AB} & \text{*AC} & \text{*ABC} \\ \text{*AC} & \text{A} & \text{AB}\\ \text{*ABC} & \text{*AC} & \text{*ABC} \\\hline \end{array}$$

Answer: $4.$

• edited by
47 47 votes

Solution......

8 8 votes

Given Regular expression Accept all strings over alphabet {a,b} which end with either ba or bb.

Because,(a+b)*b(a+b)=(a+b)*(ba+bb).

So, to recognise this we have to see the strings which have ba or bb at end .

Below is the Required Dfa. and we can't further minimize it.

By equivalance theorem we have two sets of final and non-final states.

[a,b] [ba,bb]   

[a] [b] [ba] [bb]  //Because a,b goes to diffrent sets on a-transitions and  ba,bb also goes to diffrent sets on a-transitions.

8 8 votes

Answer  : 4 states

Explanation :

the given regular expression is for the language "2nd symbol from the right is b"

in such cases where the kth symbol from the right is asked, the no. of states in the dfa will always be 2k as we got to calculate/ keep memory of all possible strings ending combinations (2k)

Thus in our question, all possible strings from the right will give the answer 22=4 states

Answer:
Position:
Show:

Related questions

65 65 votes
10 answers 10 answers
28.6k
28.6k views
Madhav asked Feb 14, 2017
28,573 views
The minimum possible number of states of a deterministic finite automaton that accepts the regular language $L$ = {$w_{1}aw_{2}$ | $w_{1},w_{2}$ $\in$ $\left \{ a,b \righ...
3 3 votes
1 answers 1 answer
1.1k
1.1k views
Bikram asked Aug 12, 2017
1,073 views
Let L be the set of strings on $\Sigma = (0,1)$ such that $z$ belongs to $L$ if number of $0$' s in $z$ is divisible by $k. \ k \geq 2$ and number of $1$' s in $z$ is odd...
88 88 votes
15 answers 15 answers
31.0k
31.0k views
Misbah Ghaya asked Feb 13, 2015
31,044 views
Consider the DFAs $M$ and $N$ given above. The number of states in a minimal DFA that accept the language $L(M) \cap L(N)$ is_____________.
46 46 votes
5 answers 5 answers
24.5k
24.5k views
Akash Kanase asked Feb 12, 2016
24,487 views
The number of states in the minimum sized DFA that accepts the language defined by the regular expression.$(0+1)^{*} (0+1) (0+1)^{*}$is ________.