Learning Outcomes
• Mahasiswa
dpt
membandingkan
berbagai bentuk algoritma FA untuk
suatu ekspresi/Syntax program agar
dapat dianalisis diterima/ditolak..
Bina Nusantara
Outline Materi:
•
•
•
•
•
•
Bina Nusantara
FA sebagai model komputasi
Gambaran FA dgn digraph
Definisi formal
Analisis FA
NFA
Aplikasi state transduser
Deterministic Finite Automata (DFA)
For every state q in Q and every character in , one and only one
transition of the following form occurs:
q
> s
b
a
p
q’
b
a
b
q
r
a
a
a
Bina Nusantara
b
t
b
Expressiveness of DFA
•DFA are a type of programs
•Contains concepts of imperative languages: sequences,
branching and loops.
•Can implement a newspaper vendor machine (see Page 20
of the book)
•Can implement pattern matching: find all text containing
“Britney Spears” (or “Justin Timberlake”)
•Can only implement programs that require a constant
amount of memory
Bina Nusantara
Another Example
b
A
> s
b
a
q
a
L(A) is the set of all strings having
2 consecutive a’s
a
B
a
> s
q
b
L(B) is the set of all strings having
2 consecutive b’s
Bina Nusantara
a
r
b
a
b
r
b
a
Nondeterministic Finite Automata
b
a
q
b
r
a
> s
a
b
a
b
q
q’
b
r
r’
a
b
Automaton accepting strings containing 2 a’s or 2 b’s
Deterministic?
Bina Nusantara
Nondeterministic Finite Automata (NFA)
For every state q in S and every character in , one of the
following will happen:
•No transition: q
q’ occurs
•One or more transition: q
…
Bina Nusantara
q’
p
occurs
Nondeterministic Finite Automaton (NFA)
A deterministic finite automaton (NFA) is a 5-tuple (Q,,,s,F)
where:
•Q is a finite set of elements called states
• is a finite input alphabet
• Q × ( × {e}) × Q
•s Q called the initial state
•F Q called the favorable states
Bina Nusantara
Nondeterministic Finite Automata (NFA)
What else can occur in NFAs?
“the empty string”
e
q
q’
If we start with the configuration (q,aaabbb) and apply
this transition, what is the resulting configuration?
(q’, aaabbb)
“e-transitions” do not process any characters, they just
allow to “jump” between states
Bina Nusantara
String Accepted by NFA
Given an NFA A = (Q,,,s,F), and a string w *, we say
that w is accepted by A if at least one of the configurations
yielded by (s,w) is a configuration of the form (f,e) with f a
favorable state
What is the language accepted by an NFA?
L(A) = {w * : w is accepted by A}
Bina Nusantara
Example
>s
b
q
b
a
r
b
Bina Nusantara
Example # 2
b
a
q
b
a
r
a
> s
a
b
a
b
q
q’
b
r
r’
b
Bina Nusantara
a
NFA vs DFA
•Are deterministic automata, nondeterministic?
•The oracle explanation of NFAs: there is an oracle that
always makes the right choice
p
a
r
e
q
Suppose that while processing a
configuration (r,w) only by going
to state p, a favorable state can be
reached. Then, the oracle will
choose p
•Is the oracle explanation compatible with our definition
of acceptability in NFAs?
Bina Nusantara
NFA vs DFA (2)
Are NFAs more powerful than DFAs?
(i.e., are there languages that can be recognized by NFAs
but not by DFAs)
a
>s
b
q
b
r
b
Bina Nusantara
NFA vs DFA (3)
b
a
q
b
a
r
a
> s
a
b
a
b
q
q’
b
r
r’
b
Bina Nusantara
a
Bina Nusantara
© Copyright 2026 Paperzz