
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
State the worst case number of states in DFA and NFA for a language?
A Deterministic Finite automata (DFA) is a five tuples
M=(Q, ∑, δ,q0,F)
Where,
Q − Finite set called states.
∑ − Finite set called alphabets.
δ − Q × ∑ → Q is the transition function.
q0 ∈ Q is the start or initial state.
F − Final or accept state.
Let’s see the worst case number of states in DFA for the language A∩B and A*
Let A and B be the two states,
|A| = number of states = nA
|B| = number of states = nB
DFA = |A∩B|
=nA.nB
|A ∪ B| =nA.nB
|A*|=3/4 2nA
|AB| = nA (2nB-2nB-1)
NFA
The non-deterministic finite automata (NFA) also have five states same as DFA, but with different transition function, as shown follows −
δ: Q X ∑ -> 2Q
Where,
Q − Finite set of states.
∑ − Finite set of the input symbol.
q0 − Initial state.
F − Final state.
δ − Transition function.
Let’s see the worst case number of states in NFA for the language A∩B and A*
Let A and B be the two states,
|A| = number of state = nA
|B|= number of state = nB
NFA:
|AUB| = nA+nB+1
|A*| = nA+1
|AB| = nA+nB
|A∩B| = nA.nB