2 2 votes If we are having n states and m alphabets..how many DFAs and NFAs are possible? Theory of Computation theory-of-computation finite-automata number-of-dfa + – Vivek Jain 926 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
2 2 votes there are totally 'n' states, 'm' alphabets. Each state can be final or non-final state (2 choices). So, there are 2^n variations. for each state, there is 'm' out edges (alphabets) having 'n' destination nodes to choose from. So, each state will add 'n * m' variations which gives us n^n*m variations. In total, we will have 2^n * n^n*m DFA's. Surya Dhanraj answered Aug 10, 2017 Surya Dhanraj comment Share Follow See all 2 Comments 2 2 Comments reply Vivek Jain commented Aug 10, 2017 reply Follow flag and what about the no of NFAs? 0 0 replyShare Ritam_C commented Sep 20, 2019 reply Follow flag In the above case, there should be a factor of 'n' for the number of possible initial states.(Starting state can be chosen from n states in the dfa) Now for nfa case: each alphabet at each state has 2^n choices to chose from(total number of subsets of states possible).So total 2^mn at each state.Thus a total of 2^(n*n*m) combining all states together. n choices for initial state and 2^n choices for final states as well. This is what I think should happen! 0 0 replyShare Please log in or register to add a comment.