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

Lecture 8 Finite Automata FA

The document is a lecture on Automata Theory from COMSATS University Islamabad, covering topics such as Regular Expressions and Finite Automata, specifically Deterministic Finite Automata (DFA). It defines the language EVEN-EVEN, which consists of words with an even number of a's and b's, and provides examples of various regular expressions. Additionally, it includes formal definitions, graphical representations, and examples of DFAs, illustrating their structure and function.

Uploaded by

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

Lecture 8 Finite Automata FA

The document is a lecture on Automata Theory from COMSATS University Islamabad, covering topics such as Regular Expressions and Finite Automata, specifically Deterministic Finite Automata (DFA). It defines the language EVEN-EVEN, which consists of words with an even number of a's and b's, and provides examples of various regular expressions. Additionally, it includes formal definitions, graphical representations, and examples of DFAs, illustrating their structure and function.

Uploaded by

ayeshanadeem2408
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

CUI WAH CAMPUS

 COMSATS University Islamabad,


Wah Campus
Department of Computer Science
 LECTURE # 8
 SUBJECT NAME: Automata Theory

 INSTRUCTOR: Waheed Ahmad Khan


 Topic Covered
 Revision Regular Expression
 Finite Automata/ FA , Deterministic Finite
Automata / DFA
EVEN-EVEN.
Language EVEN-EVEN defined by the
expression:
[aa + bb + (ab + ba)(aa+bb)*(ab + ba)]*
Every word in EVEN-EVEN has an even
number
of a’s and b’s.
Every word that contains an even number of
a’s
and b’s is a member of EVEN-EVEN.
More Examples of RE
 Even number of a’s
 Odd Number of a’s
 All words of length 4
 All words in which a never double
 All words do not contain ab
 All words having substring aab or baa
 All words of length 3 or more
 All words of length 5 or less
Finite Automata/ FA ,
Deterministic Finite
Automata / DFA
 DEFINITION: A finite automaton is a collection of three
things:
1. A finite set of states, one of which is designated as the initial
state, called the start state, and some (maybe none)
of which are designated as final states.
2. An alphabet I of possible input letters, from which are formed
strings, that are to be read one letter at a time.
3. A finite set of transitions that tell for each state and for each
letter of the input alphabet which state to go to next.
Deterministic Finite
Automaton (DFA)
 Finite Automaton can be classified
into two types −
 Deterministic Finite Automaton (DFA)
 Non-deterministic Finite Automaton
(NDFA / NFA
Deterministic Finite
Automaton (DFA)
 In DFA, for each input symbol, one
can determine the state to which the
machine will move. Hence, it is
called Deterministic Automaton. As it
has a finite number of states, the
machine is called Deterministic Finite
Machine or Deterministic Finite
Automaton.
Formal Definition of a
DFA
 A DFA can be represented by a 5-tuple (Q, ∑,
δ, q0, F) where −
1. Q is a finite set of states.
2. ∑ is a finite set of symbols called the
alphabet.
3. δ is the transition function where δ: Q × ∑ → Q
4. q0 is the initial state from where any input is
processed (q0 ∈ Q).
5. F is a set of final state/states of Q (F ⊆ Q).
Graphical
Representation of a DFA
 A DFA is represented by digraphs
called state diagram.
 The vertices represent the states.
 The arcs labeled with an input alphabet
show the transitions.
 The initial state is denoted by an empty
single incoming arc or - sign.
 The final state is indicated by double circles
or + sign.
Examples
Let a deterministic finite automaton be →
•Q = {a, b, c},
•∑ = {0, 1},

•q = {a},
0
•F = {c}, and

Transition function δ as shown by the following table −

Present State Next State for Input 0 Next State for Input 1

a a b

b c a

c b c
Deterministic Finite
Automaton (DFA)

cc
Deterministic Finite
Automaton (DFA)
 Construct DFA that Accepts all
strings without two consecutive 1’s
0 0,1

- 1 - 1
C
+A +B

Previous Previous Consecutive


string OK, string OK, 1's have
does not does not been seen.
end in 1 end in 1
Deterministic Finite
Automaton (DFA)
 The below FA will accept all strings that have the
letter b in them. Therefore, the language
associated with (or accepted by) this FA is the
one defined by the regular expression (a + b)*b(a
+ b)*
Thank You…

You might also like