Professional Documents
Culture Documents
Computation
Lecture 1
Finite Automat I
11/24/2015 2
What is Theory of computation?
11/24/2015 3
Why study theory of computation?
11/24/2015 4
A first look at an application
11/24/2015 5
A first look at an application
CLOSED OPEN
Neither
11/24/2015 6
A first look at an application
11/24/2015 7
Software for TCS3511
11/24/2015 8
What is automata theory?
11/25/2015 TCS3511 10
Your First Automaton
1. The state diagram of a finite automaton M1
If A is the set of all strings that machine M accepts, we say that A is the
language of machine M and write L(M) = A. We say that M recognizes or
accepts
11/25/2015 A. TCS3511 11
Your second Automaton
12
Your Third Automaton
14
Your Fifth Automaton
M6 = (Q, S, d, po, F)
with Q = {q0,q1,q2}
S = {0,1,2}
d: Q x S Q
p0 = q 0
F = {q0}
17
Defining an accepting computation
1 0,1
q1 q2 q3
0
0 1
Language? All words having first the 0s and at least one 1.
0
1 1
q1 q2 q3
1
0 0
Language? All words having an even number of 1’s.
20
NonDeterministic finite automata (NFA)
1. The state diagram of a finite automaton
Every state of a DFA always has exactly one exiting transition arrow for
each symbol in the alphabet. The NFA shown in Figure above violates that
rule. Ex: State q1 has one exiting arrow for 0, but it has two for 1. q2 has
one arrow for 0, but it has none for 1. In an NFA, a state may have zero,
one, or many exiting arrows for each alphabet symbol. 21
NonDeterministic finite automata (NFA)
22
NonDeterministic finite automata (NFA)
Nondeterministic automata are good for shorter descriptions, good for building an
automaton accepting or not accepting special cases.
23
(NFA) with e -transitions (e-NFA)
(Remember that the superscript denotes repetition, not numerical exponentiation.) For
example, This NFA accepts the strings e, 00, 000, 0000, and 000000, … but not 0 or
00000.
NOTE: The above NFA has an input alphabet {0} consisting of a single symbol. An
alphabet containing only one symbol is called a unary alphabet. 24
DFA vs. NFA
Important: the NFA is defined in the same way as the DFA but with
the following two exceptions:
o Multiple next state.
o e- transitions.
Multiple next state. in a DFA there is exactly one start state and exactly
one transition out of every state for each symbol in Ʃ. In contrast to a DFA,
the next state is not necessarily uniquely determined by the current state and
input symbol in case of an NFA. In an NFA, a state may have zero, one, or
many (including e- transitions) exiting arrows for each alphabet symbol.
Two machines
are equivalent if
they recognize
the same
language
Finite automata and regular language RL
Finite automata are good models for computers with an extremely
limited amount of memory.
A machine may accept several strings, but it always recognizes only
one language. If the machine accepts no strings, it still recognizes
one language namely, the empty language q.
language of machine M and write L(M) = A. We say that M
recognizes language A
We say that M recognizes language A if A = {w | M accepts w}.
Learning Outcomes
28