Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm).

Size: px
Start display at page:

Download "Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm)."

Transcription

1 Finite Automata

2 Announcements Problem Set Four due Thursday at 7:PM (right before the midterm). Stop by OH with questions! with questions! Review session tonight, 7PM until whenever people are done asking questions, in Covers practice midterm questions. Alternate time tomorrow as well; we'll announce a location once we have a room reserved.

3 Problem Set 2 Scores Mean: 8 Median: 2 Stdev: 6

4 Midterm Details Midterm is Thursday, 7:-:PM in Hewlett 2 (right next door). Alternate: Wednesday, 7: :PM, room TBA Alternate: Thursday, 9:AM Noon, room TBA Open-book, open-note, open-computer, closed-network. Feel free to download lecture slides. Do not Google the answers, your friends, read xkcd, etc. If you can disable your network connection, please do so. Material is up through and including Wednesday's lecture. Don't panic; any question on this week's material will be extremely easy and should not require much thought.

5 What problems can we solve with a computer?

6 What problems can we solve with a computer? What kind of computer?

7 Computers are Messy

8 Computers are Messy

9 Computers are Messy

10 Computers are Messy

11 We need a simpler way of discussing computing machines.

12 An automaton (plural: automata) is a mathematical model of a computing device.

13 Automata make it possible to reason about computability by abstracting away the implementation complexity of real computing systems.

14 Computers are Messy

15 Automata are Clean q q

16 Computers are Messy

17 Automata are Clean q q

18 Computers are Messy

19 Automata are Clean q q

20 Computers are Messy

21 Automata are Clean q q

22 Why Build Models? The models of computation we will explore in this class correspond to different conceptions of what a computer could do. Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines that we can actually build. Turing machines (later) are an abstraction of computers with unbounded resources. Provide upper bounds for what we could ever hope to accomplish.

23 What problems can we solve with a computer?

24 What problems can we solve with a computer? What is a problem?

25 Problems with Problems Before we can talk about what problems we can solve, we need a formal definition of a problem. We want a definition that corresponds to the problems we want to solve, captures a large class of problems, and is mathematically simple to reason about. No one definition has all three properties.

26 Decision Problems In this class, we will consider decision problems, problems with yes/no answers. Examples: Does have 3 as a divisor? Is P the shortest path from u to v? If the velociraptors can run at 3m/s, will I survive for more than ten minutes? Do we have to get down on Friday?

27 Decision Problems are Powerful Many questions that are not decision problems can be phrased as decision problems. Example: What is ? can be phrased as a decision problem Is = 77? There are much better ways to do this; we'll see them later on. In this sense, decision problems are at least as hard as any other problem. If we can't solve decision problems, we certainly can't solve these other problems.

28 Strings An alphabet is a finite set Σ of characters. A string is a finite sequence of characters drawn from some alphabet. Example: Σ = {, }, some valid strings include The empty string contains no characters and is denoted ε.

29 Languages A formal language is a set of strings. We say that L is a language over Σ if it is a set of strings formed from the characters of Σ. Example: The language of palindromes over Σ = {,, 2} is the set {ε,,, 2,,, 22,,, 2,,, } The set of all strings composed from letters in Σ is denoted Σ*.

30 Decision Problems and Languages Languages give a compact and flexible way to encode decision problems. Consider these examples: { p p is an encoding of a prime number } { w w is an encoding of (x, y), where x < y } { x x is an encoding of a graph G and a path P, where P is the longest path in G } Any decision problem can be represented by a language of strings encoding inputs to which the answer is yes. All the automata we will discuss in this class will be machines for answering the question is string x in language L?

31 To Summarize An automaton is an idealized mathematical computing machine. A language is a set of strings. A decision problem is a yes/no question (though it can be quite complex). The automata we will study will accept as input a string and (attempt to) output whether that string is contained in a particular language.

32 Finite Automata

33 A finite automaton is a mathematical machine for determining whether a string is contained within some language.

34 Each finite automaton consists of a set of states connected by transitions.

35 A Simple Finite Automaton q q

36 A Simple Finite Automaton q q Each circle represents a state of the automaton.

37 A Simple Finite Automaton q q

38 A Simple Finite Automaton q q One special state is designated as the state.

39 A Simple Finite Automaton q q

40 A Simple Finite Automaton q q

41 A Simple Finite Automaton q q The automaton is run on an input string and answers yes or no.

42 A Simple Finite Automaton q q

43 A Simple Finite Automaton q q

44 A Simple Finite Automaton q q The automaton can be in one state at a time. It begins in the state.

45 A Simple Finite Automaton q q

46 A Simple Finite Automaton q q

47 A Simple Finite Automaton q q The automaton now begins processing characters in the order in which they appear.

48 A Simple Finite Automaton q q

49 A Simple Finite Automaton q q

50 A Simple Finite Automaton q q Each arrow in this diagram represents a transition. The automaton always follows the transition corresponding to the current symbol being read.

51 A Simple Finite Automaton q q

52 A Simple Finite Automaton q q

53 A Simple Finite Automaton q q

54 A Simple Finite Automaton q q

55 A Simple Finite Automaton q q After transitioning, the automaton considers the next symbol in the input.

56 A Simple Finite Automaton q q

57 A Simple Finite Automaton q q

58 A Simple Finite Automaton q q

59 A Simple Finite Automaton q q

60 A Simple Finite Automaton q q

61 A Simple Finite Automaton q q

62 A Simple Finite Automaton q q

63 A Simple Finite Automaton q q

64 A Simple Finite Automaton q q

65 A Simple Finite Automaton q q

66 A Simple Finite Automaton q q

67 A Simple Finite Automaton q q

68 A Simple Finite Automaton q q

69 A Simple Finite Automaton q q

70 A Simple Finite Automaton q q

71 A Simple Finite Automaton q q

72 A Simple Finite Automaton q q

73 A Simple Finite Automaton q q

74 A Simple Finite Automaton q q

75 A Simple Finite Automaton q q

76 A Simple Finite Automaton q q

77 A Simple Finite Automaton q q Now that the automaton has looked at all this input, it can decide whether to say yes or no.

78 A Simple Finite Automaton q q The double circle Now that the automaton has looked at all this input, it can decide whether to say yes or no. indicates that this state is an accepting state, so the automaton outputs yes.

79 A Simple Finite Automaton q q The double circle Now that the automaton has looked at all this input, it can decide whether to say yes or no. indicates that this state is an accepting state, so the automaton outputs yes.

80 A Simple Finite Automaton q q The double circle Now that the automaton has looked at all this input, it can decide whether to say yes or no. indicates that this state is an accepting state, so the automaton outputs yes.

81 A Simple Finite Automaton q q

82 A Simple Finite Automaton q q

83 A Simple Finite Automaton q q

84 A Simple Finite Automaton q q

85 A Simple Finite Automaton q q

86 A Simple Finite Automaton q q

87 A Simple Finite Automaton q q

88 A Simple Finite Automaton q q

89 A Simple Finite Automaton q q

90 A Simple Finite Automaton q q

91 A Simple Finite Automaton q q

92 A Simple Finite Automaton q q

93 A Simple Finite Automaton q q

94 A Simple Finite Automaton q q

95 A Simple Finite Automaton q q

96 A Simple Finite Automaton q q

97 A Simple Finite Automaton q q

98 A Simple Finite Automaton q q

99 A Simple Finite Automaton q q

100 A Simple Finite Automaton q q

101 A Simple Finite Automaton q q

102 A Simple Finite Automaton q q

103 A Simple Finite Automaton q q

104 A Simple Finite Automaton q q

105 A Simple Finite Automaton q q

106 A Simple Finite Automaton q q

107 A Simple Finite Automaton q q

108 A Simple Finite Automaton q q

109 A Simple Finite Automaton This state is not q q an accepting state, so the automaton says no.

110 A Simple Finite Automaton This state is not q q an accepting state, so the automaton says no.

111 A Simple Finite Automaton This state is not q q an accepting state, so the automaton says no.

112 A Simple Finite Automaton q q

113 A Simple Finite Automaton q q Try it yourself! Does the automaton accept (say yes) or reject (say no)?

114 The Story So Far A finite automaton is a collection of states joined by transitions. Some state is designated as the state. Some states are designated as accepting states. The automaton processing a string by beginning in the state and following the indicated transitions. If the automaton ends in an accepting state, it accepts the input. Otherwise, the automaton rejects the input.

115 Accepting States, Revisited q q q 5

116 Accepting States, Revisited q q q 5

117 Accepting States, Revisited q q q 5

118 Accepting States, Revisited q q q 5

119 Accepting States, Revisited q q q 5

120 Accepting States, Revisited q q q 5

121 Accepting States, Revisited q q q 5

122 Accepting States, Revisited q q q 5

123 Accepting States, Revisited q q q 5

124 Accepting States, Revisited q q q 5

125 Accepting States, Revisited q q q 5

126 Accepting States, Revisited q q q 5

127 Accepting States, Revisited q q q 5

128 Accepting States, Revisited q q q 5

129 Accepting States, Revisited q q q 5

130 A finite automaton does not accept as soon as the input enters an accepting state. A finite automaton accepts if the it ends in an accepting state.

131 What Does This Accept? q q q 5

132 What Does This Accept? q q q 5

133 What Does This Accept? q q q 5

134 What Does This Accept? q q q 5

135 What Does This Accept? q q q 5

136 What Does This Accept? q q q 5

137 What Does This Accept? q q q 5

138 What Does This Accept? q No matter where we q in the automaton, after seeing two 's, we end up in accepting state. q 5

139 What Does This Accept? q q q 5

140 What Does This Accept? q q q 5

141 What Does This Accept? q q q 5

142 What Does This Accept? q q q 5

143 What Does This Accept? q q q 5

144 What Does This Accept? q q q 5

145 What Does This Accept? q No matter where we q in the automaton, after seeing two 's, we end up in accepting state q 5. q 5

146 What Does This Accept? q q q 5

147 What Does This Accept? q q This automaton accepts any string ending in or. q 5

148 The language of an automaton is the set of strings that it accepts. We denote this L(A)

149 A language L is called a regular language if there is some finite automaton A for which L(A) = L

150 A Small Problem q q

151 A Small Problem q q

152 A Small Problem q q

153 A Small Problem q q

154 A Small Problem q q

155 A Small Problem q q

156 A Small Problem q q

157 A Small Problem q q

158 A Small Problem q q Problem?

159 Another Small Problem, q, q,

160 Another Small Problem, q, q,

161 Another Small Problem, q, q,

162 Another Small Problem, q, q,

163 Another Small Problem, q, q,

164 Another Small Problem, q, q,

165 Another Small Problem, q, q,

166 Another Small Problem, q, q, Problem?

167 The Need for Formalism In order to reason about the limits of what finite automata can and cannot do, we need to formally specify their behavior in all cases. All of the following need to be defined or disallowed: What happens if there is no transition out of a state on some input? What happens if there are multiple transitions out of a state on some input?

168 DFAs A DFA is a Deterministic Finite Automaton DFAs are the simplest type of automaton that we will see in this course.

169 DFAs, Informally A DFA is defined relative to some alphabet Σ. For each state in the DFA, there must be exactly one transition defined for each symbol in the alphabet. This is the deterministic part of DFA. There is a unique state. There may be multiple accepting states.

170 Is this a DFA?

171 Is this a DFA? q q

172 Is this a DFA?

173 Is this a DFA? q q q 5

174 Is this a DFA?

175 Is this a DFA? q q

176 Is this a DFA? q q

177 Is this a DFA?

178 Is this a DFA? q, q,, q,

179 Is this a DFA?

180 Is this a DFA?, q, q,

181 Is this a DFA?, q, q,

182 Is this a DFA?

183 Is this a DFA?

184 Is this a DFA? Deadly Futuristic Assassin

185 Recognizing Languages with DFAs L = { w w contains as a substring }

186 Recognizing Languages with DFAs L = { w w contains as a substring } q

187 Recognizing Languages with DFAs L = { w w contains as a substring } q q

188 Recognizing Languages with DFAs L = { w w contains as a substring } q q

189 Recognizing Languages with DFAs L = { w w contains as a substring } q q

190 Recognizing Languages with DFAs L = { w w contains as a substring } q q

191 Recognizing Languages with DFAs L = { w w contains as a substring } q q

192 Recognizing Languages with DFAs L = { w w contains as a substring } q q,

193 Recognizing Languages with DFAs L = { w every even character of w is a }

194 Recognizing Languages with DFAs L = { w every even character of w is a } YES NO

195 Recognizing Languages with DFAs L = { w every even character of w is a }

196 Recognizing Languages with DFAs L = { w every even character of w is a } q

197 Recognizing Languages with DFAs L = { w every even character of w is a } q q

198 Recognizing Languages with DFAs L = { w every even character of w is a } q q

199 Recognizing Languages with DFAs L = { w every even character of w is a } q q,

200 Recognizing Languages with DFAs L = { w every even character of w is a } q q,,

201 Recognizing Languages with DFAs L = { w every even character of w is a } q q, This state is sometimes called a dead state.,

202 Recognizing Languages with DFAs L = { w every even character of w is a } q q,,

203 More Elaborate DFAs L = { w w is a legal address }

204 More Elaborate DFAs L = { w w is a legal @,. q 8 q a q a a q 4. q 5 a q 6 a a a

205 More Elaborate DFAs L = { w w is a C-style comment }

206 More Elaborate DFAs L = { w w is a C-style comment } a, *, / a, * q 5 a, *, / /, a q / q * * a / q 4 a, / *

207 More Elaborate DFAs L = { w w is a C-style comment } a, *, / a, * q 5 a, *, / /, a q / q * * a / q 4 a, / *

208 More Elaborate DFAs L = { w w is a C-style comment } Σ a, * q 5 Σ /, a q / q * * a / q 4 a, / *

209 More Elaborate DFAs L = { w w is a C-style comment } Σ a, * q 5 Σ /, a q / q * * a / q 4 a, / *

Finite Automata Part One

Finite Automata Part One Finite Automata Part One Computability Theory What problems can we solve with a computer? What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm

More information

Finite Automata Part One

Finite Automata Part One Finite Automata Part One Computability Theory What problems can we solve with a computer? What kind of computer? Computers are Messy http://en.wikipedia.org/wiki/file:eniac.jpg Computers are Messy That

More information

Finite Automata Part One

Finite Automata Part One Finite Automata Part One Computability Theory What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm We need a simpler

More information

Finite Automata Part One

Finite Automata Part One Finite Automata Part One Computability Theory What problems can we solve with a computer? What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm

More information

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

More information

Finite Automata Part Two

Finite Automata Part Two Finite Automata Part Two DFAs A DFA is a Deterministic Finite Automaton A DFA is defined relative to some alphabet Σ. For each state in the DFA, there must be exactly one transition defined for each symbol

More information

Chapter Two: Finite Automata

Chapter Two: Finite Automata Chapter Two: Finite Automata In theoretical computer science, automata theory is the study of abstract machines (or more appropriately, abstract 'mathematical' machines or systems) and the computational

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

Finite Automata Part Two

Finite Automata Part Two Finite Automata Part Two Recap from Last Time Old MacDonald Had a Symbol, Σ-eye-ε-ey, Oh! You may have noticed that we have several letter- E-ish symbols in CS103, which can get confusing! Here s a quick

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov CMP 309: Automata Theory, Computability and Formal Languages Adapted from the work of Andrej Bogdanov Course outline Introduction to Automata Theory Finite Automata Deterministic Finite state automata

More information

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal CSE 3 Lecture 3: Finite State Machines Emina Torlak and Kevin Zatloukal Topics Finite state machines (FSMs) Definition and examples. Finite state machines with output Definition and examples. Finite state

More information

Decision, Computation and Language

Decision, Computation and Language Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata

More information

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

CSCI 2670 Introduction to Theory of Computing

CSCI 2670 Introduction to Theory of Computing CSCI 267 Introduction to Theory of Computing Agenda Last class Reviewed syllabus Reviewed material in Chapter of Sipser Assigned pages Chapter of Sipser Questions? This class Begin Chapter Goal for the

More information

Proofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007.

Proofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007. Proofs, Strings, and Finite Automata CS154 Chris Pollett Feb 5, 2007. Outline Proofs and Proof Strategies Strings Finding proofs Example: For every graph G, the sum of the degrees of all the nodes in G

More information

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo INF28 1. Introduction and Regular Languages Daniel Lupp Universitetet i Oslo 18th January 218 Department of Informatics University of Oslo INF28 Lecture :: 18th January 1 / 33 Details on the Course consists

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Define push down automata Trace the computation of a push down automaton Design

More information

Finite Automata. Finite Automata

Finite Automata. Finite Automata Finite Automata Finite Automata Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers Parsers, Push-down Automata Context Free Grammar Finite State

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata

More information

Concatenation. The concatenation of two languages L 1 and L 2

Concatenation. The concatenation of two languages L 1 and L 2 Regular Expressions Problem Problem Set Set Four Four is is due due using using a late late period period in in the the box box up up front. front. Concatenation The concatenation of two languages L 1

More information

Finite-state machines (FSMs)

Finite-state machines (FSMs) Finite-state machines (FSMs) Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada January 10, 2017 1/19 Finite-state machines (FSMs) and state

More information

Chapter Five: Nondeterministic Finite Automata

Chapter Five: Nondeterministic Finite Automata Chapter Five: Nondeterministic Finite Automata From DFA to NFA A DFA has exactly one transition from every state on every symbol in the alphabet. By relaxing this requirement we get a related but more

More information

Decidability and Undecidability

Decidability and Undecidability Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an

More information

Nonregular Languages

Nonregular Languages Nonregular Languages Recap from Last Time Theorem: The following are all equivalent: L is a regular language. There is a DFA D such that L( D) = L. There is an NFA N such that L( N) = L. There is a regular

More information

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by

More information

Turing Machines Part One

Turing Machines Part One Turing Machines Part One What problems can we solve with a computer? Regular Languages CFLs Languages recognizable by any feasible computing machine All Languages That same drawing, to scale. All Languages

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 Automata Theory Lecture Note 2 - Nondeterminism COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly

More information

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam Version A December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Languages Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable Languages We

More information

Finite Automata (contd)

Finite Automata (contd) Finite Automata (contd) CS 2800: Discrete Structures, Fall 2014 Sid Chaudhuri Recap: Deterministic Finite Automaton A DFA is a 5-tuple M = (Q, Σ, δ, q 0, F) Q is a fnite set of states Σ is a fnite input

More information

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

Complexity Theory Part I

Complexity Theory Part I Complexity Theory Part I Outline for Today Recap from Last Time Reviewing Verifiers Nondeterministic Turing Machines What does nondeterminism mean in the context of TMs? And just how powerful are NTMs?

More information

Deterministic Finite Automaton (DFA)

Deterministic Finite Automaton (DFA) 1 Lecture Overview Deterministic Finite Automata (DFA) o accepting a string o defining a language Nondeterministic Finite Automata (NFA) o converting to DFA (subset construction) o constructed from a regular

More information

CS 581: Introduction to the Theory of Computation! Lecture 1!

CS 581: Introduction to the Theory of Computation! Lecture 1! CS 581: Introduction to the Theory of Computation! Lecture 1! James Hook! Portland State University! hook@cs.pdx.edu! http://www.cs.pdx.edu/~hook/cs581f10/! Welcome!! Contact Information! Jim Hook! Office:

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata. CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

More information

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

Computational Tasks and Models

Computational Tasks and Models 1 Computational Tasks and Models Overview: We assume that the reader is familiar with computing devices but may associate the notion of computation with specific incarnations of it. Our first goal is to

More information

Formal Definition of Computation. August 28, 2013

Formal Definition of Computation. August 28, 2013 August 28, 2013 Computation model The model of computation considered so far is the work performed by a finite automaton Finite automata were described informally, using state diagrams, and formally, as

More information

Join. Visit us at the HMC club fair and the 5c turf dinner. Company sponsored tech talks and events Resume Workshops / Interview Prep

Join. Visit us at the HMC club fair and the 5c turf dinner. Company sponsored tech talks and events Resume Workshops / Interview Prep Join Company sponsored tech talks and events Resume Workshops / Interview Prep Meet other students in CS! Dinners with cool profs (like the one standing in front of you!) Students of all gender identities

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation 1 / 38 Lecture 21: Overview Big-Oh notation. Little-o notation. Time Complexity Classes Non-deterministic TMs The Class

More information

(Refer Slide Time: 0:21)

(Refer Slide Time: 0:21) Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata

More information

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices Introduction to Theoretical Computer Science Motivation Automata = abstract computing devices Turing studied Turing Machines (= computers) before there were any real computers We will also look at simpler

More information

CS 154 Introduction to Automata and Complexity Theory

CS 154 Introduction to Automata and Complexity Theory CS 154 Introduction to Automata and Complexity Theory cs154.stanford.edu 1 INSTRUCTORS & TAs Ryan Williams Cody Murray Lera Nikolaenko Sunny Rajan 2 Textbook 3 Homework / Problem Sets Homework will be

More information

3130CIT Theory of Computation

3130CIT Theory of Computation GRIFFITH UNIVERSITY School of Computing and Information Technology 3130CIT Theory of Computation Final Examination, Semester 2, 2006 Details Total marks: 120 (40% of the total marks for this subject) Perusal:

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) September,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.  ETH Zürich (D-ITET) September, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) September, 24 2015 Last week was all about Deterministic Finite Automaton We saw three main

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

A Note on Turing Machine Design

A Note on Turing Machine Design CS103 Handout 17 Fall 2013 November 11, 2013 Problem Set 7 This problem explores Turing machines, nondeterministic computation, properties of the RE and R languages, and the limits of RE and R languages.

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automata (FA or DFA) CHAPTER Regular Languages Contents definitions, examples, designing, regular operations Non-deterministic Finite Automata (NFA) definitions, euivalence of NFAs and DFAs, closure

More information

CSCE 551: Chin-Tser Huang. University of South Carolina

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

Computational Models - Lecture 1 1

Computational Models - Lecture 1 1 Computational Models - Lecture 1 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. February 29/ March 02, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames

More information

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA) Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine

More information

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Deterministic Finite Automata 1 Pop quiz What is

More information

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.eecs.yorku.ca/course/2001 9/10/2013

More information

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY YOU NEED TO PICK UP THE SYLLABUS, THE COURSE SCHEDULE, THE PROJECT INFO SHEET, TODAY S CLASS NOTES

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6a REVIEW for Q2 Q2 covers Lecture 5 and Lecture 6 Chapter 2 - Deterministic Finite Automata DFA Chapter 2 - Nondeterministic

More information

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

Nondeterministic Finite Automata and Regular Expressions

Nondeterministic Finite Automata and Regular Expressions Nondeterministic Finite Automata and Regular Expressions CS 2800: Discrete Structures, Spring 2015 Sid Chaudhuri Recap: Deterministic Finite Automaton A DFA is a 5-tuple M = (Q, Σ, δ, q 0, F) Q is a finite

More information

CSC236 Week 11. Larry Zhang

CSC236 Week 11. Larry Zhang CSC236 Week 11 Larry Zhang 1 Announcements Next week s lecture: Final exam review This week s tutorial: Exercises with DFAs PS9 will be out later this week s. 2 Recap Last week we learned about Deterministic

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Design an automaton that recognizes a given language. Specify each of

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2012 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/2001 9/6/2012 CSE

More information

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Turing Machines Now for a machine model of much greater power.

More information

ECS 120 Lesson 15 Turing Machines, Pt. 1

ECS 120 Lesson 15 Turing Machines, Pt. 1 ECS 120 Lesson 15 Turing Machines, Pt. 1 Oliver Kreylos Wednesday, May 2nd, 2001 Before we can start investigating the really interesting problems in theoretical computer science, we have to introduce

More information

NP-Completeness Part II

NP-Completeness Part II NP-Completeness Part II Please evaluate this course on Axess. Your comments really do make a difference. Announcements Problem Set 8 due tomorrow at 12:50PM sharp with one late day. Problem Set 9 out,

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) CS/ECE 374: Algorithms & Models of Computation, Fall 28 Deterministic Finite Automata (DFAs) Lecture 3 September 4, 28 Chandra Chekuri (UIUC) CS/ECE 374 Fall 28 / 33 Part I DFA Introduction Chandra Chekuri

More information

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa CS:4330 Theory of Computation Spring 2018 Regular Languages Finite Automata and Regular Expressions Haniel Barbosa Readings for this lecture Chapter 1 of [Sipser 1996], 3rd edition. Sections 1.1 and 1.3.

More information

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS 1. [6 POINTS] For language L 1 = {0 n 1 m n, m 1, m n}, which string is in L 1? ANSWER: 0001111 is in L 1 (with n =

More information

Nondeterminism. September 7, Nondeterminism

Nondeterminism. September 7, Nondeterminism September 7, 204 Introduction is a useful concept that has a great impact on the theory of computation Introduction is a useful concept that has a great impact on the theory of computation So far in our

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

(Note that these points are to give a relative sense of the weights on the final exam and have no bearing on extra credit points)

(Note that these points are to give a relative sense of the weights on the final exam and have no bearing on extra credit points) CS103 Handout 24 Fall 2012 December 3, 2012 Extra Credit: Practice CS103 Final Exam This practice exam is worth 5 extra credit points. We will not give points based on whether or not your answers are correct,

More information

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture.

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture. Turing Machines Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing machine

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

Theory of Computation Lecture 1. Dr. Nahla Belal

Theory of Computation Lecture 1. Dr. Nahla Belal Theory of Computation Lecture 1 Dr. Nahla Belal Book The primary textbook is: Introduction to the Theory of Computation by Michael Sipser. Grading 10%: Weekly Homework. 30%: Two quizzes and one exam. 20%:

More information

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! N P NP Announcements Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! Now in cabinets in the Gates open area near the drop-off box. The Complexity Class

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

More information

Author: Vivek Kulkarni ( )

Author: Vivek Kulkarni ( ) Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-2: Finite State Machines Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Construct Mealy and Moore

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Announcements Problem Set 9 due right now. Final exam this Monday, Hewlett 200 from 12:15PM- 3:15PM Please let us know immediately after lecture if you want to take the final at

More information

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF) CS5371 Theory of Computation Lecture 7: Automata Theory V (CFG, CFL, CNF) Announcement Homework 2 will be given soon (before Tue) Due date: Oct 31 (Tue), before class Midterm: Nov 3, (Fri), first hour

More information

Quantum Computing Lecture 8. Quantum Automata and Complexity

Quantum Computing Lecture 8. Quantum Automata and Complexity Quantum Computing Lecture 8 Quantum Automata and Complexity Maris Ozols Computational models and complexity Shor s algorithm solves, in polynomial time, a problem for which no classical polynomial time

More information

Course 4 Finite Automata/Finite State Machines

Course 4 Finite Automata/Finite State Machines Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

More information

Optimizing Finite Automata

Optimizing Finite Automata Optimizing Finite Automata We can improve the DFA created by MakeDeterministic. Sometimes a DFA will have more states than necessary. For every DFA there is a unique smallest equivalent DFA (fewest states

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Deterministic finite Automata

Deterministic finite Automata Deterministic finite Automata Informatics 2A: Lecture 3 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 21 September, 212 1 / 29 1 Languages and Finite State Machines What is

More information