The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+18 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

- $n$ states
- $n+1$ states
- $n+2$ states
- None of the above

+30 votes

Best answer

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

$=(0+1)(0+1)(0+1)$

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.

what u think .

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

should we consider (N+2) as default by DFA

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)

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.

A finite automata may be

(1) An NFA

(2)DFA

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.

(1) An NFA

(2)DFA

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?

@VS

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

nstates, but its minimal DFA has2states.^{n}

Read this : https://cs.stackexchange.com/questions/59431/size-comparison-of-nfa-and-minimal-dfa/59435

+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..

Length will be n..

No of states required for n length is n+1, one more for trap.. total n+2 states..

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.

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.

https://en.wikipedia.org/wiki/Deterministic_finite_automaton

- All categories
- General Aptitude 1.2k
- Engineering Mathematics 4.7k
- Digital Logic 1.9k
- Programming & DS 3.5k
- Algorithms 3k
- Theory of Computation 3.7k
- Compiler Design 1.5k
- Databases 2.8k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 837
- Others 1.2k
- Admissions 284
- Exam Queries 397
- Tier 1 Placement Questions 17
- Job Queries 51
- Projects 7

33,705 questions

40,253 answers

114,340 comments

38,861 users