Irving's Blog

– The best way to learn –

Archive for March 9th, 2014

RE – DFA

without comments

Soal:

Buat RE -> DFA dengan 2 cara:

  • Menggunakan cara tree
  • Cara ε – NFA

Setelah itu lakukan DFA minimized.

Constraint:

  • State dari DFA minimal 5 state maksimal 8 state.
  • Final state minimal 2 state dan maksimal 3 state

Jawaban:

RE

1. Menggunakan cara tree

Tentukan index terlebih dahulu:

RE cara tree

Buat tree-nya:

Tree

Kemudian, tentukan followpost masing – masing index:

  • Follow post 1 = 2, 4, 5, 6
  • Follow post 2 = 3
  • Follow post 3 = 2, 4, 5, 6
  • Follow post 4 = 4, 5, 6
  • Follow post 5 = 4, 5, 6
  • Follow post 6 = 7
  • Follow post 7 = 6, 8
  • Follow post 8 = –

Berdasarkan followpost di atas, tentukan state – statenya:

Followpost Table

Hasil DFA:

DFA

DFA di atas masih dapat kita minimalisasi dengan melakukan grouping, sebagai berikut:

Table Minimized DFA

Hasil DFA setelah diminimized:

Capture

2. Menggunakan cara ε – NFA

Pertama, buat ε – NFAnya:

e - nfa

Kemudian cari ε-closure movenya:

  • ε-closure (0) = 0 → {S0}
  • ε-closure (move(S0, a)) = ε-closure {1} = {1, 2, 5, 6, 7, 9, 12} → {S1}
  • ε-closure (move(S0, b)) = {}
  • ε-closure (move(S1, a)) = ε-closure {3, 8, 13} = {3, 6, 7, 8, 9, 11, 12, 13} → {S2}
  • ε-closure (move(S1, b)) = ε-closure {10} = {6, 7, 9, 10, 11, 12} → {S3}
  • ε-closure (move(S2, a)) = ε-closure {8, 13} = {6, 7, 8, 9, 11, 12, 13} → {S4}
  • ε-closure (move(S2, b)) = ε-closure {4, 10, 14} = {2, 4, 5, 6, 7, 9, 10, 11, 12, 14} → {S5*}
  • ε-closure (move(S3, a)) = ε-closure {8, 13} = {S4}
  • ε-closure (move(S3, b)) = ε-closure {10} ={S3}
  • ε-closure (move(S4, a)) = ε-closure {8, 13} = {S4}
  • ε-closure (move(S4, b)) = ε-closure {10, 14} = {6, 7, 9, 10, 11, 12, 14} → {S6*}
  • ε-closure (move(S5, a)) = ε-closure {3, 8, 13} = {S2}
  • ε-closure (move(S5, b)) = ε-closure {10} = {S3}
  • ε-closure (move(S6, a)) = ε-closure {8, 13} = {S4}
  • ε-closure (move(S6, b)) = ε-closure {10} = {S3}

Dari langkah di atas dapat ditentukan jalur masing – masing statenya:

Table e-closure

Hasil DFA:

DFA

http://binus.ac.id

Written by vinkz28

March 9th, 2014 at 2:22 am