• edited by
27,766 views
89 89 votes

Definition of a language $L$ with alphabet $\{a\}$ is given as following.$$ L = \left\{a^{nk} \mid k > 0, \:\: and \:\: n \text{ is a positive integer constant} \right\}$$What is the minimum number of states needed in a DFA to recognize $L$?

  1. $k+1$
  2. $n+1$
  3. $2^{n+1}$
  4. $2^{k+1}$

4 Answers

Best answer
59 59 votes

(B) $n+1$
We need a state for strings of length $0, 1, 2, ... n$ (and their respective multiples with $k$). Each of these set of strings form an equivalence class as per Myhill-Nerode relation and hence needs a separate state in min-DFA.
$$\begin{array}{|c|c|c|c|}\hline \textbf{Myhill-Nerode} & \textbf{Myhill-Nerode} & \textbf{Myhill-Nerode} & \textbf{Myhill-Nerode}\\\textbf{Class 1} & \textbf{Class 2} & \textbf{Class n} & \textbf{Class n+1}
 \\\hline \text{$\epsilon$} & \text{a,} & \text{#a=n-1,}& \text{#a=n,}\\ & \text{#a=n+1,}& \text{#a=2n-1,} &\text{#a=2n,}\\ & \text{#a=2n+1,}& \text{#a=3n-1,} &\text{#a=3n,}\\ &\text{...}&\text{...}& \text{...} \\\hline  \end{array}$$One thing to notice here is $k > 0$. Because of this we are not able to combine Class $1$ and Class $n+1$. Had it been $k \geq 0$, we would have had only $n$ equivalent classes and equivalently $n$ states in the minimal DFA. 

• edited by
15 15 votes

The language \( L \) is defined as:

\[
L = \{ a^{nk} \mid k > 0,\ \text{and } n \text{ is a positive integer constant} \}
\]

This means the strings in \( L \) are of the form:

\[
L = \{ a^n,\ a^{2n},\ a^{3n},\ \ldots \}
\]

So, the regular expression representing the language is:

\[
(a^n)^+
\]

---

DFA Construction:

To accept the minimum string \( a^n \), we need a path of \( n \) transitions. For this, we need \(n+1\) states and the last state as final state.
Now, from the final state, create a cycle of length \(n\). Here is an example.

 

---

Hence, the minimum number of states required in the DFA is: \[\boxed{n + 1}\]

 

9 9 votes

Given that n is a constant.
So lets check of n = 2,
L = a2k, k>0
Since k>0 than zero.
So L is the language accepting even no. of a's except 'ε'.
So DFA will be,

So, no. of states required is 2+1 = 3.
So for ank, (n+1) states will be required.

Answer:
Position:
Show:

Related questions

75 75 votes
4 answers 4 answers
24.6k
24.6k views
go_editor asked Sep 29, 2014
24,611 views
On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to transfer $500$ bytes from an I/O device to mem...
46 46 votes
7 answers 7 answers
16.9k
16.9k views
go_editor asked Sep 29, 2014
16,869 views
A deterministic finite automaton ($\text{DFA}$) $D$ with alphabet $\Sigma = \{a, b\}$ is given below.Which of the following finite state machines is a valid minimal $\tex...
41 41 votes
6 answers 6 answers
15.0k
15.0k views
go_editor asked Sep 29, 2014
14,950 views
Consider the languages $L1, \:L2 \:and \: L3$ as given below.$L1=\{0^p 1^q \mid p, q \in N\}, \\ L2 = \{0^p 1^q \mid p, q \in N \:and \:p=q\} \: and, \\ L3 = \{0^p 1^q 0^...
40 40 votes
4 answers 4 answers
12.8k
12.8k views
go_editor asked Apr 23, 2016
12,800 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$