InterviewSolution
Saved Bookmarks
| 1. |
The definition of a language L with alphabet {a} is given as following. L = { ank | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L?(a) k+1(b) n+1(c) 2n+1(d) 2k+1I have been asked this question during an interview for a job.This intriguing question comes from Transformation from NFA to DFA topic in division Finite Automata and Regular Expression of Compiler |
|
Answer» CORRECT CHOICE is (b) N+1 To explain I would SAY: NOTE that n is a constant and k is any positive integer. For example, let n=3, then the DFA must be able to accept aaa, aaaaaa, aaaaaaaaa, , .. build such a DFA, 4 states are required. |
|