Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.

Similar presentations


Presentation on theme: "Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat."— Presentation transcript:

1 Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat

2 Finite Automata The finite state machine(FSM) or finite automaton (FA) is the simplest computational model of limited memory computers. Example: an automatic door opener at a supermarket decides when to open or close the door, depending on the input provided by its sensors. Tasneem Ghnaimat

3 Finite Automata Finite automata are designed to solve decision problems, i.e., whether an input satisfies some conditions. Examples of decision problems: – Does a given string have an even number of 1‘s – Is the number of 0's (in a string) multiple of 4 – Does a given string end in 00. Tasneem Ghnaimat

4 Example – Door opener States: closed, open Input conditions: front, rear, both, neither Transitions: – closed  open on front – open  closed on neither Rear, Both, Neither Front, Rear, Both Front Neither Closed Open

5 Formal Definition A deterministic finite automaton (DFA) or (FSM) is a 5-tuple M= (Q, ∑, σ, q 0, F ), where: Q: is a finite set whose members are called states ∑ : is a finite alphabet whose members are called symbols σ : Q X ∑  Q is the transition function q 0 Q : is the start state F : is the set of accept states (or final states). Tasneem Ghnaimat

6 Formal Definition Given an input string over ∑ (written on the input tape), an automaton reads its symbols one-by-one and changes its state (starting from q 0 ) according to σ The automaton “accepts” the input if its resulting state (after reading the input string is complete) belongs to F, otherwise “rejects”. Tasneem Ghnaimat

7 Apply Definitions on Door Opener Q= {Closed, Open} ∑={Front, Rear, Both, Neither} State Transition Table Tasneem Ghnaimat NeitherBothRearFront Closed OpenClosed Open

8 Drawing State Diagram Draw a state diagram of a DFA M1 with state set Q={q1,q2,q3}, ∑={0,1}, start state q1, final state set F={q2}, and state transition table is: Tasneem Ghnaimat 10 q2q1 q2q3q2 q1q2q3

9 Examples Example 1: Consider the following Automata (M2): 0 1 1 0 The machine accepts all strings that leave it in an accept state when it has finished reading. Note: because start state is the final state, M2 will accepts the string (Epsilon) Tasneem Ghnaimat q1 q2 q1

10 Examples The Language of Machine M2 is described as: L(M2)= {w|w is the empty string or ends with 0}. Example 2: Consider the following Automata (M3) Tasneem Ghnaimat

11 Examples Example 2: Consider the following Automata (M3) Tasneem Ghnaimat q1 q2

12 Examples The Language of Machine M2 is described as: L(M2)= {w|w is a string ends with 1}. Example 2: Consider the following Automata (M3) Tasneem Ghnaimat


Download ppt "Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat."

Similar presentations


Ads by Google