Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.

Slides:



Advertisements
Similar presentations
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Advertisements

8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
Deterministic Finite Automata (DFA)
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CS21 Decidability and Tractability
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof Latex files on ella.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
NFAs and DFAs Sipser 1.2 (pages 47-63). Last time…
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof
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.
Finite Automata and Non Determinism
CS5371 Theory of Computation
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
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.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
CSCI 2670 Introduction to Theory of Computing August 24, 2005.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
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.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Athasit Surarerks THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1.
Great Theoretical Ideas in Computer Science.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
CHAPTER 1 Regular Languages
Formal Definition of Computation Let M = (Q, ∑, δ, q 0, F) be a finite automaton and let w = w 1 w w n be a string where each wi is a member of the.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Deterministic Finite Automata COMPSCI 102 Lecture 2.
Great Theoretical Ideas in Computer Science for Some.
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
Conversions Regular Expression to FA FA to Regular Expression.
 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.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Theory of Computation Automata Theory Dr. Ayman Srour.
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 Σ:
Foundations of Computing Science
Languages.
Lecture2 Regular Language
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
CSE 2001: Introduction to Theory of Computation Fall 2009
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
CSC 4170 Theory of Computation Finite Automata Section 1.1.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: ={0,1},
Presentation transcript:

Introduction to the Theory of Computation John Paxton Montana State University Summer 2003

Textbook Introduction to the Theory of Computation Michael Sipser PWS Publishing Company 1997

Humor One night, Bill Clinton was awakened by George Washington's ghost in the White House. Clinton saw him and asked, "George, what is the best thing I could do to help the country?" "Set an honest and honorable example, just as I did," advised George. The next night, the ghost of Thomas Jefferson moved through the dark bedroom. "Tom, what is the best thing I could do to help the country?" Clinton asked. "Cut taxes and reduce the size of government," advised Tom. Clinton didn't sleep well the next night, and saw another figure moving in the shadows. It was Abraham Lincoln's ghost. "Abe, what is the best thing I could do to help the country?" Clinton asked. "Go to the theatre."

Chapter 1: Regular Languages Very simple model of computation

1.1 Finite Automaton A finite state automaton (FSA) is a very simple model of computation. Studying an FSA allows us to better understand more complex models of computation. An FSA can be used in a compiler to tokenize the input.

Example q0q0 q1q1

Example 1 Questions What is the start state? What is the set of accept states? What sequence of states are gone through on input ? Is the empty string input (  ) accepted?

Formal Definition A finite automaton is a 5-tuple (Q, , , q 0, F) where 1.Q is a finite set called the states  is a finite set called the alphabet  : Q x   Q is the transition function 4.q 0  Q is the start state 5.F  Q is the set of accept states

Example 1 Formal Definition Q = { q 0, q 1 }  = {0, 1} F = { q 1 }   0 1 q 0 q 0 q 1 q 1 q 0 q 1

Language of Machine M L(M) = A where A is the set of all strings that machine M accepts. L(Example 1) = { w | w ends in a 1 } M “recognizes” A

Acceptance Let M = (Q, , , q 0, F) be a finite automaton and w = w 1 w 2 …w n be a string over the alphabet . Then M “accepts” w if a sequence of states r 0 r 1 …r n exists in Q with the following three conditions: 1.r 0 = q 0  (r i, w i+1 ) = r i+1 for 0 <= i <= n – 1 3.r n  F

Regular Language A language is called a “regular language” if some finite automaton recognizes it.

Exercises Design a finite automaton that recognizes the regular language of all strings that contain the string 001 as a substring. The alphabet is {0, 1, 2}. Design a finite automaton that recognizes all binary numbers that are multiples of 3. Design a finite automaton that recognizes all binary strings with a 1 in the k th position where k > 0.

Regular Operations Union A U B = { x | x  A or x  B} Concatenation A B = { xy | x  A and y  B} Star A* = {x 1 x 2 …x k | k >= 0 and x i  A}

Theorem The class of regular languages is closed under the union operation. In other words, if A 1 and A 2 are regular languages, so is A 1 U A 2.

Proof M 1 = (Q 1, ,  , q 1, F 1 ) M 2 = (Q 2, ,  , q 2, F 2 ) Construct M = (Q, , , q 0, F)

Proof (by construction) Q = {(r 1, r 2 ) | r 1  Q 1 and r 2  Q 2 q 0 = (q 1, q 2 ) F = {(r 1, r 2 ) | r 1  F 1 or r 2  F 2 }  (r 1,r 2 ), a) = (  1  (r 1, a),  2  (r 2, a) )

Exercise Use the preceding construction to construct a FSA that accepts the union of L(A 1 ) = { w | w ends in 1 } and L(A 2 ) = { w | w contains the substring 00 }

More Theorems The class of regular languages is closed under the concatenation operation. The class of regular languages is closed under the star operation. Proofs: easier with the concept of nondeterminism!