Automata Theory (ITC404) : SEIT-SEM-IV (R-2019) Deterministic Finite Automata (Dfa)
This document discusses deterministic finite automata (DFA). It defines DFAs as finite automata that read input symbols one at a time and have a unique transition from the current state to the next state based on the input. The document provides examples of DFAs over an alphabet of a and b, including ones that accept strings starting or ending with certain patterns. It also discusses representing DFAs as state diagrams and minimizing equivalent DFAs.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
59 views34 pages
Automata Theory (ITC404) : SEIT-SEM-IV (R-2019) Deterministic Finite Automata (Dfa)
This document discusses deterministic finite automata (DFA). It defines DFAs as finite automata that read input symbols one at a time and have a unique transition from the current state to the next state based on the input. The document provides examples of DFAs over an alphabet of a and b, including ones that accept strings starting or ending with certain patterns. It also discusses representing DFAs as state diagrams and minimizing equivalent DFAs.
DFA (DETERMINISTIC FINITE AUTOMATA) • DFA refers to Deterministic Finite Automata. Deterministic refers to the uniqueness of the computation. • The finite automata are called deterministic finite automata if the machine reads an input string one symbol at a time. • In DFA, there is only one path for specific input from the current state to the next state. • DFA does not accept the null move, i.e., the DFA cannot change state without any input character. • DFA can contain multiple final states. It is used in Lexical Analysis in Compiler.
Prof. Shashank S. Tolye 2
DFA EXAMPLE • In the diagram, we can see that from state q0 for input a, there is only one path which is going to q1. • Similarly, from q0, there is only one path for input b going to q2.
Prof. Shashank S. Tolye 3
FORMAL DEFINITION OF DFA •
Prof. Shashank S. Tolye 4
GRAPHICAL REPRESENTATION OF DFA • A DFA can be represented by digraphs called state diagram. In which: 1. The state is represented by vertices.
2. The arc labeled with an input character
show the transitions.
3. The initial state is marked with an arrow.
4. The final state is denoted by a double
circle.
Prof. Shashank S. Tolye 5
DFA EXAMPLE-1 •
Present Next state for Input 0 Next State of Input 1
State →q0 q0 q1 q1 q2 q1 *q2 q2 q2 DFA EXAMPLE-2 • Design a DFA with ∑ = {a, b} that accepts all strings starting with ‘a’. DFA EXAMPLE-3 • Design a DFA with ∑ = {a, b} that accepts all strings starting with ‘ba’. DFA EXAMPLE-4 • Design a DFA with ∑ = {a, b} that accepts all strings starting with ‘abb’. DFA EXAMPLE-5 • Design a DFA with ∑ = {a, b} that accepts all strings ending with ‘bb’. DFA EXAMPLE-6 • Design a DFA with ∑ = {a, b} that accepts all strings ending with ‘ab’. DFA EXAMPLE-7 • Design a DFA with ∑ = {a, b} that accepts all strings ending with ‘bab’. DFA SAMPLE EXERCISES • DFA EXAMPLE-(8-10) • Design a DFA over ∑ = {a, b} such that every string accepted must contain substring ‘w’ where: 1. w = ‘aa’ 2. w= ‘ba’ 3. w= ‘abb’ DFA EXAMPLE-11 • Design a DFA over ∑ = {a, b} such that every string accepted must start and end with ‘a’. DFA EXAMPLE-11 • Design a DFA over ∑ = {a, b} such that every string accepted must start with ‘a’ and end with ‘b’. DFA EXAMPLE-12 • Design a DFA over ∑ = {a, b} such that every string accepted must start and end with same symbol. DFA EXAMPLE-13 (HW) • Design a DFA over ∑ = {a, b} such that every string accepted must start and end with different symbol. DFA EXAMPLE-14 • Design a DFA over ∑ = {a, b} such that every string accepted must start with ‘aa’ or ‘bb’. DFA EXAMPLE-15 • Design a DFA over ∑ = {a, b} such that every string accepted must end with ‘aa’ or ‘bb’. DFA EXAMPLE-16 (HW) • Design a DFA over ∑ = {a, b} such that every string accepted must contain a substring ‘aa’ or ‘bb’. DFA EXAMPLE-17 • DFA EXAMPLE-18 • DFA EXAMPLE-19 • DFA EXAMPLE-20 • DFA EXAMPLE-21 • DFA EXAMPLE-22 • DFA SAMPLE EXERCISES • MINIMIZATION OF DFA MINIMIZATION OF DFA (Example-1) • Minimize the following DFA. MINIMIZATION OF DFA (Example-2) • Construct a minimal DFA equivalent to the DFA described by: MINIMIZATION OF DFA (Example-3) (More than one final states) • Minimize the following DFA: MINIMIZATION OF DFA (Example-4) (Unreachable states) • Minimize the following DFA: REFERENCES 1. Internet: Javatpoint.com