0% found this document useful (0 votes)
189 views12 pages

MG 02 1 FiniteAutomata Anim

The document discusses finite automata and deterministic finite automata (DFAs). It defines a DFA as a 5-tuple (Q, Σ, q0, F, δ) where Q is a set of states, Σ is an input alphabet, q0 is the starting state, F is a set of accepting states, and δ is the transition function. It provides examples of building DFAs to recognize specific regular languages over the binary alphabet {0,1}.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views12 pages

MG 02 1 FiniteAutomata Anim

The document discusses finite automata and deterministic finite automata (DFAs). It defines a DFA as a 5-tuple (Q, Σ, q0, F, δ) where Q is a set of states, Σ is an input alphabet, q0 is the starting state, F is a set of accepting states, and δ is the transition function. It provides examples of building DFAs to recognize specific regular languages over the binary alphabet {0,1}.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Finite Automata

Reading: Chapter 2

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 ∑ ==> 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”.

 Locate regular languages in the


Chomsky Hierarchy

5
The Chomsky Hierachy
• A containment hierarchy of classes of formal languages

Regular Context-
(DFA) Context-
free Recursively-
sensitive
(PDA) enumerable
(LBA) (TM)

6
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”

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

DFA for strings containing 01

• What makes this DFA deterministic? • Q = {q0,q1,q2}


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

• What if the language allows q1 q1 q2


empty strings? *q2 q2 q2

8
Example #2
Clamping Logic:
 A clamping circuit waits for a ”1” input, and turns on forever.
However, to avoid clamping on spurious noise, we’ll design
a DFA that waits for two consecutive 1s in a row before
clamping on.
 Build a DFA for the following language:
L = { w | w is a bit string which contains the
substring 11}
 State Design:
 q0 : start state (initially off), also means the most recent input
was not a 1
 q1: has never seen 11 but the most recent input was a 1
 q2: has seen 11 at least once
9
Example #3
 Build a DFA for the following language:
L = { w | w is a binary string that has even
number of 1s and even number of 0s}
 ?

10
Extension of transitions (δ) to
Paths (δ)
 δ (q,w) = destination state from state q
on input string w

 δ (q,wa) = δ (δ(q,w), a)

 Work out example #3 using the input


sequence w=10010, a=1:

 δ (q0,wa) = ?
11
Language of a DFA
A DFA A accepts string w if there is a
path from q0 to an accepting (or final)
state that is labeled by w

 i.e., L(A) = { w | δ(q0,w)  F }

 I.e., L(A) = all strings that lead to an


accepting state from q0

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy