Download presentation

Presentation is loading. Please wait.

Published byDenisse Newman Modified over 2 years ago

2
Bina Nusantara Finite Automata II (FA) Pertemuan 24: Mata kuliah:K0144/ Matematika Diskrit Tahun:2008

3
Bina Nusantara Learning Outcomes Mahasiswa dpt membandingkan berbagai bentuk algoritma FA untuk suatu ekspresi/Syntax program agar dapat dianalisis diterima/ditolak..

4
Bina Nusantara Outline Materi: FA sebagai model komputasi Gambaran FA dgn digraph Definisi formal Analisis FA NFA Aplikasi state transduser

5
Bina Nusantara Deterministic Finite Automata (DFA) q For every state q in Q and every character in , one and only one transition of the following form occurs: q’ sp b a q > b a r b a t ba ab

6
Bina Nusantara 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” Can only implement programs that require a constant amount of memory (or “Justin Timberlake”)

7
Bina Nusantara Another Example sq b a b a r a b q b a a r > sq a r a b q a b b r > L(A) is the set of all strings having 2 consecutive a’s A B L(B) is the set of all strings having 2 consecutive b’s

8
Bina Nusantara Nondeterministic Finite Automata s q b a r a b q b a a r > a q r b q’ b a b r’ a Automaton accepting strings containing 2 a’s or 2 b’s Deterministic?

9
Bina Nusantara Nondeterministic Finite Automata (NFA) For every state q in S and every character in , one of the following will happen: qq’ No transition: occurs One or more transition:qq’ occurs p …

10
Bina Nusantara 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 s Q called the initial state F Q called the favorable states Q × ( × {e}) × Q

11
Bina Nusantara Nondeterministic Finite Automata (NFA) What else can occur in NFAs? qq’ e “the empty string” 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

12
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}

13
Bina Nusantara Example sq r q b r > b a b

14
Bina Nusantara Example # 2 s q b a r a b q b a a r > a q r b q’ b a b r’ a

15
Bina Nusantara NFA vs DFA Are deterministic automata, nondeterministic? The oracle explanation of NFAs: there is an oracle that always makes the right choice 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? p r a q e

16
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) sq r q b r > b a b

17
Bina Nusantara NFA vs DFA (3) s q b a r a b q b a a r > a q r b q’ b a b r’ a

18
Bina Nusantara

Similar presentations

Presentation is loading. Please wait....

OK

CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.

CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google