Finite Automata Course: Theory of Computation Date: Nov 16 th, 2011 Lin Liu lliu AT cs.kent.edu.

Slides:



Advertisements
Similar presentations
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Advertisements

Deterministic Finite Automata (DFA)
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
Chapter Two: Finite Automata
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
CS5371 Theory of Computation
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.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
1 Languages and Finite Automata or how to talk to machines...
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
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.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
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.
Great Theoretical Ideas in Computer Science.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Great Theoretical Ideas in Computer Science.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Deterministic Finite Automata COMPSCI 102 Lecture 2.
Computing Machinery Chapter 4: Finite State Machines.
Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 10Sept Carnegie Mellon University b b a b a a a b a b One.
Lecture Notes 
Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2006 Lecture 22 November 9, 2006Carnegie Mellon University b b a b a a a b a b.
Great Theoretical Ideas in Computer Science for Some.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Theory of Computation Automata Theory Dr. Ayman Srour.
Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2005 Lecture 9Feb Carnegie Mellon University b b a b a a a b a b One Minute.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Theory of Computation Automata Theory Dr. Ayman Srour.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Finite Automata.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CSCI 2670 Introduction to Theory of Computing
Finite Automata Alphabet word
Deterministic Finite Automata And Regular Languages.
Generalized Transition Graphs
Lecture2 Regular Language
CSE 105 theory of computation
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
Finite Automata Alphabet word
An Introduction to Finite Automata
CSE322 Finite Automata Lecture #2.
Non-Determinism 12CS45 Finite Automata.
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Chapter Two: Finite Automata
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Nondeterministic Finite Automata
Principles of Computing – UFCFA3-30-1
NFAs and Transition Graphs
Great Theoretical Ideas in Computer Science
One Minute To Learn Programming: Finite Automata
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
CSC312 Automata Theory Transition Graphs Lecture # 9
Finite-State Machines with No Output
CSC 4170 Theory of Computation Finite Automata Section 1.1.
Lecture One: Automata Theory Amjad Ali
Chapter # 5 by Cohen (Cont…)
LECTURE # 07.
Non Deterministic Automata
Presentation transcript:

Finite Automata Course: Theory of Computation Date: Nov 16 th, 2011 Lin Liu lliu AT cs.kent.edu

Why finite automata are important? Many real applications –elevators –coke machines –train track switches –complier design and parsing

Outline A Classic Riddle Man, Wolf, Goat and Cabbage Definition for Finite Automata (FA) The 5-Tuple The Language Accepted by FA Definition Examples

A Classic Riddle A man travels with wolf, goat and cabbage and wants to cross a river from east to west. A rowboat is available, but only large enough for the man plus one possession. Wolf eats goat if left alone together. Goat eats cabbage if left alone together. How can the man cross without loss?

Solutions As Strings Four moves can be encoded as four symbols: –Man crosses with wolf (w) –Man crosses with goat (g) –Man crosses with cabbage (c) –Man crosses with nothing (n) Then a sequence of moves is a string, such as the solution gnwgcng: –First cross with goat, then cross back with nothing, then cross with wolf, …

Transition Diagram Showing all legal moves All reachable states Start state and goal state

The Language Of Solutions Every path gives some x  {w,g,c,n}* The diagram defines the language of solutions to the problem: {x  {w,g,c,n}* | starting in the start state and following the transitions of x ends up in the goal state} This is an infinite language (The two shortest strings in the language are gnwgcng and gncgwng)

Definition for Finite Automaton A finite automaton is a 5-tuple (Q, , , q 0, F), where –Q is a finite set called the states; –  is a finite set called the alphabet; –  : Q x   Q is the transition function; –q 0  Q is the start state; –F  Q is the set of accepting states.

One finite automaton start state accepting state transition

After reading a string s… FA accepts the string s, if after reading the last symbol of s, FA ends up in an accepting state; FA rejects the string s, if after reading the last symbol of s, FA ends up in a non-accepting state; FA crashes, if FA fails during reading s.

Input strings Results abba Accept aabb Reject abbcCrash

The language accepted by FA L = {x   * | FA accepts x}, where –  * =  0 +  1 +  2 + … –  k = All length k strings over the alphabet .

Accepted language examples What is the language accepted by this FA? a, b L = {a,b}* = all finite strings of a’s and b’s

What language is accepted by this machine? a, b L=all even length strings containing a’s and b’s

What language is accepted by this machine? b a a, b L = All strings in {a, b}* with at least one a.

References ic/class/.../automata.ppt Michael Sipser. Introduction to the Theory of Computation, first edition, December theory slides/02.ppt