You are on page 1of 52

Bina Nusantara University

1
Course : T0162 – Automata and Language Theory
Year : 2012

Session 2
FINITE AUTOMATA

Bina Nusantara University


2
Learning Outcomes
At the end of this meeting, students are
Expected will be able to:

Define and explain theory of Automata and


formal language

Bina Nusantara University


3
Outline Material
• Material 1 : An Informal picture of finite
Automata
• Material 2 : Definition of DFA
(Deterministic Finite Automata)
• Material 3 : How a string DFA processes
• Material 4 : The language of DFA

Bina Nusantara University


4
FINITE AUTOMATA
Finite State systems :
• Deterministic Finite Automaton
• Non-Deterministic Finite Automaton
• Push Down Automata
• Turing Machine
• Linear Bounded Automata

Bina Nusantara University


5
FINITE AUTOMATA
Contoh Finite State System :
• System Elevator
• Switching circuit
• Program text editor
Contoh :
Manusia (m), serigala (w), kambing (g),
sayur (c) menyeberang sungai :
Keadaan awal : MWGC --- 
Keadaan akhir :  --- MWGC

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.

Bina Nusantara University


8
Finite Automata(Cont...)

Protocol for each participant :

Bina Nusantara University


9
FINITE AUTOMATA

FINITE AUTOMATON (FA) :


• (Deterministic Finite Automaton - DFA)
• Model matematis
• Input Output Discrete
• Konfigurasi internal disebut “State”
• Transisi antar state atas simbol input
• Hanya satu transisi dari satu state dengan satu simbol input
tertentu (deterministic)
• Directed Graph menggambarkan FA disebut “Transition
Diagram”.

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

Bina Nusantara University


17
String input FINITE AUTOMATA

 (p, a)= q : dalam state ‘p’, membaca input ‘a’


berpindah ke state ‘q’

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:

Himp. State (Q) : q0, q1, q2, q3


Start state : q0
Final state (F) : q0 {Double circle}
Alphabet input () : {0, 1}

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;

 (q,w) = p, ada path berlabel w dari


 state q ke p.

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

LANGUAGE YANG DITERIMA :


Language yang diterima oleh FA M adalah
{x  (q0,x) dalam F}

REGULAR LANGUAGE / SET :
Language yang diterima oleh suatu FA.

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=???

Bina Nusantara University


40
1. Prove the desired state of a finite automata !
a. G(s)
S = A0 | S0
A = S1 | 0
b. G(r)
R = Ec
E = Ba
B = Aa | Ra
A = x | Bb
c. G(z)
z = Xø
Bina Nusantara University X= X0 | Z1 | ø 41
A).
A S

O0^m(10^m)*{m ≥1}; L{10^m(ø1)*|m ≥2,m ≥1}


atau L { 0 ^ m ( ø 1 ) * | m ≥ 2 }

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 :

Every contain Z is Final State

Bina Nusantara University


45
L={1ø(10)^mU0ø(10)^m} L = { ( 1 0 ^ m ) U 0 (1 0 ^ m ) ^
*}

Answer:
L = { 1 0 U 1 0 ^ * U 1 0 ^ * ( 1 0 ) ^ * 0 ^ * U 0 ^ * ( 1 0 ) ^ *}

Make a finite automata (regular = Type 3), which recognize sledge


{0, 1} that the number 1 followed immediately by the numbers
0. how languages ​are regular?

B=ø|Bø|Aø
A= B 1 | 1

Bina Nusantara University


46
Bina Nusantara University
47
2
Definikan pula tuple-tuple dari DFA tersebut

d) Definisikan RE yang sesuai dengan pola bahasa yang diterima oleh DFA di atas

You might also like