Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Pertemuan 2 Finite Automata Matakuliah: T0162/Teori Bahasa dan Automata Tahun: 2009.

Similar presentations


Presentation on theme: "1 Pertemuan 2 Finite Automata Matakuliah: T0162/Teori Bahasa dan Automata Tahun: 2009."— Presentation transcript:

1 1 Pertemuan 2 Finite Automata Matakuliah: T0162/Teori Bahasa dan Automata Tahun: 2009

2 2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Menjelaskan Finite Automata Menjelaskan dan memberikan contoh NFA dan DFA

3 Finite automaton As was metioned earlier, a finite automaton has a set of states, and its “control” moves from state to state in response to external “inputs” Deterministic meaning that automaton cannot be in more than one state at any one time, or nondeterministic that it may be in several states at once. 3

4 examples 4

5 example Interaction between participants : 5

6 The protocol The three participants must design their behaviors carefully. The back must behave responsibly, or it cannot be a bank It must make sure that two stores cannot both redeem the same money file, and it must not allow money to be both canceled and redeemed. Protocols of this type can be represented as finite automata. That is, the state “remembers” that certain important events havce happeded. 6

7 example 7

8 Explanation(c) First automaton(c) for the bank, the start state is state 1: it represents the situation where the bank has issued the money file in question but has not been requested either to redeem it or to cancel it. If a cancel request is sent to the bank by the customer, then the bank restores the money to the customer’s account and enters state 2. The latter state represents situtaion where the money has been cancelled. 8

9 Explanation (a) The automaton representing the actions of the store. While the bank always does the right thing, the store’s system has some defects. Imagine that the shipping and financial operations are done by separate processes, so there is the opportunity for the ship action to be done either before, after, or during the redemption of the electronic money. That policy allows the store to get into a situation where it has already shipped the goods and then finds out the money was bogus. 9

10 Explanation (b) This automaton has only one state, refrelcting the fact that the customer “can do anything”. The customer can perform the pay and cancel actions any number of times. 10

11 Enabling automata to ignore actions 11

12 solution 12

13 DFA The term deterministic refers to the fact that on each input there is one and only one state to which the automaton can transition from its current state 13

14 2 types of finite automata 14

15 Example DFA 15

16 example 16

17 17

18 example 18

19 Transition tables 19

20 NFA A nondeterministic finite automaton (NFA) has the power to be in several states at once. 20

21 Example NFA Terdapat lebih dari satu transisi untuk input yang sama dari suatu state. Contoh : 21

22 Example NFA 22

23 Example NFA 23

24 answer 24

25 example 25

26 example 26

27 27 Summary


Download ppt "1 Pertemuan 2 Finite Automata Matakuliah: T0162/Teori Bahasa dan Automata Tahun: 2009."

Similar presentations


Ads by Google