0% found this document useful (0 votes)
55 views

02 FiniteAutomata PDF

The document discusses finite automata and defines: 1) Finite automata as state diagrams that capture all possible states and transitions of a machine in response to input symbols. They recognize regular languages. 2) Deterministic finite automata (DFAs) have a single state at any time, while non-deterministic finite automata (NFAs) can have multiple states. 3) DFAs are defined by a 5-tuple consisting of states, input symbols, transitions, start state, and accepting states. They read input strings and accept or reject based on reaching an accepting state. 4) Languages recognized by DFAs are called regular languages.

Uploaded by

Apoorva Naik
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

02 FiniteAutomata PDF

The document discusses finite automata and defines: 1) Finite automata as state diagrams that capture all possible states and transitions of a machine in response to input symbols. They recognize regular languages. 2) Deterministic finite automata (DFAs) have a single state at any time, while non-deterministic finite automata (NFAs) can have multiple states. 3) DFAs are defined by a 5-tuple consisting of states, input symbols, transitions, start state, and accepting states. They read input strings and accept or reject based on reaching an accepting state. 4) Languages recognized by DFAs are called regular languages.

Uploaded by

Apoorva Naik
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Finite Automata

1
Finite Automaton (FA)
 Informally, a state diagram that comprehensively
captures all possible states and transitions that a
machine can take while responding to a stream or
sequence of input symbols
 Recognizer for “Regular Languages”

 Deterministic Finite Automata (DFA)


 The machine can exist in only one state at any given time
 Non-deterministic Finite Automata (NFA)
 The machine can exist in multiple states at the same time

2
Deterministic Finite Automata
- Definition
 A Deterministic Finite Automaton (DFA)
consists of:
 Q -> a finite set of states
 ∑ -> a finite set of input symbols (alphabet)

q0 -> a start state
 F -> set of accepting states
 δ -> a transition function, which is a mapping
between Q x ∑ to Q
 A DFA is defined by the 5-tuple:
{Q, ∑ , δ, q0,F }

3
What does a DFA do on
reading an input string?
 Input: a word w in ∑*
 Question: Is w acceptable by the DFA?
 Steps:

Start at the “start state” q0
 For every input symbol in the sequence w do

Compute the next state from the current state, given the
current input symbol in w and the transition function
 If after all symbols in w are consumed, the current
state is one of the accepting states (F) then accept
w;
 Otherwise, reject w.
4
Regular Languages
 Let L(A) be a language recognized by a
DFA A.
 Then L(A) is called a “Regular Language”.

5
Example #1
 Build a DFA for the following language:
 L = {w | w is a binary string that contains 01 as a substring}
 Steps for building a DFA to recognize L:
 ∑ = {0,1}
 Decide on the states: Q
 Designate start state and final state(s)
 δ: Decide on the transitions:
 “Final” states -> same as “accepting states”
 Other states -> same as “non-accepting states”

6
Regular expression: (0+1)*01(0+1)*

DFA for strings containing 01

 What makes this DFA deterministic?


 Q = {q0,q1,q2}
 ∑ = {0,1}
1 0 0,1
 start state = q0
start 0 1
q0 q1 q2  F = {q2}
 Transition table
Accepting
symbols
state 0 1

states q0 q1 q0
q1 q1 q2
*q2 q2 q2

You might also like