The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+22 votes

Consider the regular expression $(0 + 1) (0+1) \dots N$ times. The minimum state finite automaton that recognizes the language represented by this regular expression contains

  1. $n$ states
  2. $n+1$ states
  3. $n+2$ states
  4. None of the above
asked in Theory of Computation by Veteran (59.5k points)
edited by | 3.2k views
Minimal DFA includes dead states also, but not having unreachable or equal states. So here, MFA contains (n+2) states.

3 Answers

+36 votes
Best answer

As far as for above problem say regular expression for $(0+1)(0+1)...3$ times 


Having DFA:

So, for regular expression $(0+1)(0+1)...N$ times  have $\mathbf{N+2}$ states  in DFA 

$N+1$ states in NFA ( we can remove dead state) 

When question is about minimum state finite automata (and nothing is mentioned NFA/DFA) then which ever having minimum no.  

$N+1$ states. 

answered by Veteran (55k points)
edited by

sir as stated in this link . should we consider dfa if nothing is given . 

what u think .

@Praveen sir then what answer was given in the official key?

should we consider (N+2) as default by DFA
No,if you put one state then there need to be a self-loop,right? and self loop can contain infinite length of string!

So, if n=1 then you need 2 states,(A-->B)

@Praveen sir I think Minimum Finite Automata means DFA without ( unreachable and equal states ).

But my above concept contradicts with ur ans

"When question is about minimum state finite automata (and nothing is mentioned NFA/DFA) then which ever having minimum no.  take that"

sir plz can u give any reference regarding ur statement. It would really a great help.

quite frequently asked question in one or other form
A finite automata may be

(1) An NFA


They are asking that finite automata which has minimum number of states.

clearly for any regular language, NFA would have less number of states as compared to DFA because in NFA dead configuration is allowed and through use of dead configuration we can model the reject state of DFA .

So, here they are asking minimum number of states in NFA.

@Bikram sir

"When question is about minimum state finite automata (and nothing is mentioned NFA/DFA) then which ever having minimum no.  take that"

Any reference for this?

If this is true then an equivalent MINIMAL nfa would always have no. of states less than or equal to the equivalent dfa.

Then, in effect in such situations when nothing is mentioned we should take it to be nfa.

Is my conclusion right?



yes your conclusion is correct.

NFA have less state than DFA if we don't consider dead states.

For every n there is a language over {a,b} which is accepted by an NFA having n states, but its minimal DFA has 2n states.

Read this :

if an NFA having n states, then

1<= no of states in DFA <= 2^n

shouldn't the statement be n<= no of states in DFA <= 2^n ??

i too think the same



Praveen Saini Sir please explain this in more detail and expalnation
Above NFA in comments having 2 states but its corresponding minimized dfa having 1 states.

nfa having n states, can have maximum of $2^n$ states in corresponding DFA.

say $\{q_0,q_1\}$ are states in nfa, then its corresponding DFA have maximum of 4 states, $\{\{\},\{q_1\},\{q_2\},\{q_1,q_2\}\}$
+9 votes
(0+1)(0+1)......... n times

Length will be n..

No of states required for n length is n+1, one more for trap.. total n+2 states..
answered by Veteran (55.1k points)
Suppose a string of length n+1 is given, it'll reach which state in end?
Kkk one more state ..

Corrected now !!
but is it necessary that you will always need a dead state for dfa ,as you are adding 1 dead state every time for the dfa (minimal) asked.
DFA needs to cover all possibilities so sometimes we need dead or trap ..

Not sometimes - we need to cover all possible transitions in a DFA- because the definition says "transition function" and not "transition relation" as for a PDA.

But here in question they are asking for minmal state FA means 'nfa' . So, it need not cover all transitions. So, here answer shud be n+1
–4 votes

See this link: It says- By default, FA is deterministic

answered by Active (1.1k points)
so what is your point?

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

37,939 questions
45,453 answers
48,207 users