edited by
23,703 views
62 votes
62 votes

Let $w$ be any string of length $n$ in $\{0,1\}^*$. Let $L$ be the set of all substrings of $w$. What is the minimum number of states in non-deterministic finite automation that accepts $L$?

  1. $n-1$
  2. $n$
  3. $n+1$
  4. $2^{n-1}$
edited by

9 Answers

3 votes
3 votes
For example - string is 101 (n=3) then possible sub-strings are : (epsilon, 1,0,10,101,01,1) , so max length sub-string will be string itself.

And for accepting 'n' length string atleast 'n+1' states will be required ,either in DFA or NDFA (may require more states for acceptance of other sub-strings too)

So Answer is C)  n+1
edited by
2 votes
2 votes

In order to accept any string of length “n” with alphabet {0,1}, we require an NFA with “n+1” states. For example, consider a strings of length “3” such as “101”, the NFA with 4 states is given below:

Since L is set of all substrings of “w” (Substring of a string is obtained by deleting any prefix or any suffix from string), so if we consider “w” as “101” , then the substrings of w are { ϵ, 0, 1, 10, 01, 101}.
Since the string “101” is also its substring, so we require 4 states (i.e. for n length string, n+1 states are required) and the NFA would be:

0 votes
0 votes
I thought about this question as follows

Question is asking for set of all substrings to be accepted by nfa where a is of size n

So substrings possible are {€, 0,1,00,01,10,11} now draw nfa for this

q0---0,1-->q1--0,1-->q2 where all states are accepting state hence it's 3 for n=2 so n+1
Answer:

Related questions

40 votes
40 votes
1 answer
1
68 votes
68 votes
10 answers
2
27 votes
27 votes
3 answers
4
go_editor asked Apr 23, 2016
8,415 views
Consider the following Finite State Automaton:The minimum state automaton equivalent to the above FSA has the following number of states:$1$$2$$3$$4$