Professional Documents
Culture Documents
1
Course : T0162 – Automata and Language Theory
Year : 2012
Session 2
FINITE AUTOMATA
6
FINITE AUTOMATA
An Informal Picture of FA
g m
Start MWGC- MC-MG MWC-G
c
W-MCG
g
MGW-C
w
g m
-MWGC MG-WC G-MWC
Final
State
Bina Nusantara University
7
FINITE AUTOMATA(Cont...)
Example 2 :
Protocol for e-commerce use e-money .
Allowed events :
1. The customer can pay the store (=send the money-file
to the store)
2. The customer can cancel the money (like putting a
stop on a check)
3. The store can ship the goods to the customer
4. The store can redeem the money (=cash the check)
5. The bank can transfer the money to the store.
14
Definition of FINITE AUTOMATA
Formal definition : DFA is quintuple
M = (Q, , , q0, F)
where :
Q : Set of state
: Alphabet input
q0 Q : start / initial state
F Q : Set of final state
: Q : Transition function
18
FINITE AUTOMATA
Contoh :
FA menerima string dimana jumlah ‘0’,
dan jumlah ‘1’-nya genap
1
Start q0 q1
1
0
0 0 0
1
q2 q3
19
FINITE AUTOMATA
Tuple-tuple dari DFA tersebut:
20
FINITE AUTOMATA
Fungsi Transisi untuk String :
: Q * Q
(q,) = q
1.
{tanpa membaca simbol input tidak bisa
berganti state}
32
FINITE AUTOMATA
2. Untuk
semua string w dan input a,
(q, wa) = ( (q,w),a) = (p,a)
(q,w)
jika p =
Untuk input w = a, dan selalu sejalan :
(q,a) = ( (q,),a) = (q,a)
33
FINITE AUTOMATA
(q,w) : adalah state dimana FA akan berada setelah
membaca string w, dengan start state q;
34
FINITE AUTOMATA
Konvensi simbol yang digunakan :
1. Q : himpunan state
q, p : state, q0 : start state
2. : alphabet input
a,b,digit : simbol input
3. : fungsi transisi
4. F : himpunan final / accepting state
5. w,x,y,z : string input
35
FINITE AUTOMATA
STRING YANG DITERIMA :
(q ,x) = p, p dalam F.
String x diterima bila 0
36
FINITE AUTOMATA
Contoh :
0 1
1 1 0
Start q0 q0 q0 q0
Q = {q0,q1,q2,q3}
= {0,1}
F = {q3}
: digambarkan tabel berikut
37
Tabel transisi ()
FINITE AUTOMATA
38
FINITE AUTOMATA
String Yang Diterima :
110, 01101, 00110111, …
• RE: 0*1101*
• Deskripsi Language: String yang terbentuk dari 110,
boleh diawali dengan deretan 0 dan boleh diakhiri
dengan deretan 1
39
Example:
Z = Ab
B = a | Aa | Ba
B = B | Bb
L=???
B)
L={x(a(ba)*ac)^m|m≥1}
C)
L = { 0 0* ( 1 0 ^m ) * | m ε N }
L = { 0 m ( 10 ^m ) * | m ε N , m ≥ 2}
Bina Nusantara University
42
Non Finite Automata to DFAutomata
L ( NFA ) -> L ( DFA )
NFA :
P = S0 | Z1 | Z0
S = S1
Z = S1 | P1
Bina Nusantara University
43
Bina Nusantara University
44
DFA :
Answer:
L = { 1 0 U 1 0 ^ * U 1 0 ^ * ( 1 0 ) ^ * 0 ^ * U 0 ^ * ( 1 0 ) ^ *}
B=ø|Bø|Aø
A= B 1 | 1
d) Definisikan RE yang sesuai dengan pola bahasa yang diterima oleh DFA di atas