Lecture #4 Thinking of designing an abstract machine acts as finite automata. Advanced Computation Theory.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
CS21 Decidability and Tractability
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Introduction to Computability Theory
CS5371 Theory of Computation
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Topics Automata Theory Grammars and Languages Complexities
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Lecture 03: Theory of Automata:08 Finite Automata.
REGULAR LANGUAGES.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Theory of Languages and Automata
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Pushdown Automata (PDAs)
Lecture 07: Formal Methods in SE Finite Automata Lecture # 07 Qaisar Javaid Assistant Professor.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing September 13.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Finite Automata Chapter 1. Automatic Door Example Top View.
Lecture Notes 
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
Lecture #5 Advanced Computation Theory Finite Automata.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
1 Chapter 2 Finite Automata (part a) Hokkaido, Japan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Lexical analysis Finite Automata
Non Deterministic Automata
CSE 105 theory of computation
Finite Automata a b A simplest computational model
Nondeterministic Finite Automata
Chapter 2 FINITE AUTOMATA.
Hierarchy of languages
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Introduction to Finite Automata
4b Lexical analysis Finite Automata
Deterministic Finite Automaton (DFA)
4b Lexical analysis Finite Automata
Chapter 1 Regular Language
Finite-State Machines with No Output
AUTOMATA THEORY.
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Lecture #4 Thinking of designing an abstract machine acts as finite automata. Advanced Computation Theory

Consider the problem of designing a "computer / controller" that controls a toll gate. When a car arrives at the toll gate, the gate is closed. The gate opens as soon as the driver has paid 50 piaster. Assume that only three coin denominations: 10, 20, and 50 piaster. Also assume that no excess change is returned.

After having arrived at the toll gate, the driver inserts a sequence of coins into the machine. At any time, the machine has to decide whether or not to open the gate, i.e., whether or not the driver has paid 50 piaster (or more). In order to decide this, the machine is in one of the following six states, At any time during the process:

The machine is in state q 0, if it has not collected any money yet. The machine is in state q 1, if it has collected exactly 10 piaster. The machine is in state q 2, if it has collected exactly 20 piaster. The machine is in state q 3, if it has collected exactly 30 piaster. The machine is in state q 4, if it has collected exactly 40 piaster. The machine is in state q 5, if it has collected 50 piaster or more.

Initially (when a car arrives at the toll gate), the machine is in state q 0. The machine will switch to state q 5 as soon as the driver inserts 50 piaster (or more) and the gate will open. The design of such machine as fa will look as:

Finite Automata: Informal Def. Informally, fa can considered as The machine M: States: q 1 and q 2 Start state: q 1 (arrow from nowhere) Accept state: q 2 (double circle) State transitions: arrows

Finite Automata: Informal Def. The machine M: On input string s = s 1 s 2 · · · s n, M operates as follows: Begins in start state q 1 and reads the string s from left to right. When reading symbol s i it follows the transition labeled s i from the current state After reading s n, the last symbol in the string, it accepts s if it is in an accept state rejects s if it is not in an accept state

Representation of Finite Automata fa can be represented by: State diagram Transition Table

Finite Automata: Formal Def.

Definition: a finite automata (fa) is a 5-tuples M = (Q, Σ, δ, q, F), where Q is a finite set, whose elements are called states. Σ is a finite set, called the alphabet, the element of Σ are called symbols. δ : Q × Σ → Q is a function, called a transition function.

q Q called start state. F Q, the elements of F are called accept states. Note1: δ (transition function) can be consider as the “program” that tells what M can do in “one step”. Note2: such fa that describe by M is known also as dfa (deterministic finite automata).

Example 3: the computer that designed for controlling the toll gate in example 1 above, can be considered as dfa, as follows: Q = {q 0, q 1, q 2, q 3, q 4, q 5 }, Σ = {5, 10, 50}, q = q 0 (start state), F = {q 5 }, and δ is given by the following table:

q0q0 q0q0 q1q1 q2q2 q1q1 q3q3 q1q1 q1q1 q2q2 q2q2 q2q2 q4q4 q3q3 q3q3 q3q3 q5q5 q4q4 q4q4 q4q4 q5q5 q5q5 q5q5 q5q5 q5q5

Example 4 Given Q =, Σ = { 0, 1 }, A = {10 }, the initial state q 0 =, as fa, its transition function is as shown in the following table Input (a) State (q)

The transition diagram representing the fa is

Example 5 design of fa that controls opening a door based on the following. Actually the door is opened if {0,..., 9} * 1234{0,..., 9} * is entered

The machine needs to remember if the input given so far contains the subsequence 1234

DEFINITIONS Trap State Consider the following dfa q1q1 q2q2 q3q3 a ba, b When ever the dfa goes into state q 3, then it can never escape. In this case q 3 is a trap state In this case q 3 is a trap state

Extending the notation: the function For any dfa, M = (Σ, Q, q, δ, A), If the machine M in state q and recieves input symbol a then it is δ(q,a). Which state M ends up, if it begins in state q, receives the string x of several input symbols. δ * can be thought of to replace δ, and the M state is denoted by δ*(q,x) δ * is considered as the extention function of δ.

The extended δ * on M can be given by δ * : Q x Σ * Q and recursively can be defined as follows: 1. For any 2. For any

Example 6 if and then proof Formally, Can be defined recursively by: for all Now let us apply it on the simple case. (use **) * **

but *** use ***, to get #

Example 7 Given transitions of a dfa as shown below Show that q1q1 q2q2 q3q3 q4q4 Q RF

some properties on Theorem 1: For any state q Є Q and any symbol a Є Σ for a dfa M = (Σ, Q, q, δ, A), proof since, then By definition of, Also by definition

hence # Theorem 2: For any state q of Q and any string x and y over Σ for a dfa M = (Σ, Q, q, δ, A), Proof: it is going to be proven by induction on string y. that is the statement to be proven is For any arbitrary fixed string x is true for any y

now, Let us recall, *.*. and for, and, then if, then also Hence the theorem is true for By the definition of

assume is true for any arbitrary string y. we are going to prove that: is true for any arbitrary string a of Σ. By the definition of Thus the theorem has proven

fa can be found in different forms such as dfa: Deterministic Finite Automata, DFA nfa: Nondeterministic Finite Automata, NFA pfa: Pushdown Finite Automata, PDA