TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65...
Transcript of TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65...
![Page 1: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/1.jpg)
TDDD65Introduction to the Theory of Computation
Lecture 1
Gustav NordhDepartment of Computer and Information Science
2012-08-29
![Page 2: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/2.jpg)
Outline - Lecture 1
Objectives and MotivationContentsCourse OrganizationBasic Mathematical NotionsFinite Automata
![Page 3: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/3.jpg)
Objectives and Motivation
“Theoretical Computer Science (TCS) studies the inherentpowers and limitations of computation, that is broadly defined toinclude both current and future, man-made and naturally arisingcomputing phenomena.”
The objective of this course is to give an introduction to1 Formal Languages and Automata2 Computability3 Complexity
![Page 4: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/4.jpg)
Objectives and Motivation
“Theoretical Computer Science (TCS) studies the inherentpowers and limitations of computation, that is broadly defined toinclude both current and future, man-made and naturally arisingcomputing phenomena.”
The objective of this course is to give an introduction to1 Formal Languages and Automata2 Computability3 Complexity
![Page 5: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/5.jpg)
Formal Languages and Automata
What can be computed with very limited memory?
Such memory restricted devices are all around us
Many applications within CS ranging from compilerconstruction and text search to computer opponents invideo games
![Page 6: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/6.jpg)
Formal Languages and Automata
What can be computed with very limited memory?Such memory restricted devices are all around us
Many applications within CS ranging from compilerconstruction and text search to computer opponents invideo games
![Page 7: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/7.jpg)
Formal Languages and Automata
What can be computed with very limited memory?Such memory restricted devices are all around us
Many applications within CS ranging from compilerconstruction and text search to computer opponents invideo games
![Page 8: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/8.jpg)
Computability
What can be computed at all?
Understanding the fundamental limits of computationincluding the limits of
and any future “computers”There are fundamental problems that cannot be solved.
![Page 9: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/9.jpg)
Computability
What can be computed at all?Understanding the fundamental limits of computationincluding the limits of
and any future “computers”
There are fundamental problems that cannot be solved.
![Page 10: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/10.jpg)
Computability
What can be computed at all?Understanding the fundamental limits of computationincluding the limits of
and any future “computers”There are fundamental problems that cannot be solved.
![Page 11: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/11.jpg)
Complexity
What can be computed efficiently?
Understanding the fundamental limits of computationincluding the limits of
and any future “computers”Some problems seems to require more resources to solvethan others, for example coming up with a correct proof fora mathematical statement seems to take more time thanverifying the correctness of a proofOne of the most important open questions in all ofmathematics
![Page 12: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/12.jpg)
Complexity
What can be computed efficiently?Understanding the fundamental limits of computationincluding the limits of
and any future “computers”
Some problems seems to require more resources to solvethan others, for example coming up with a correct proof fora mathematical statement seems to take more time thanverifying the correctness of a proofOne of the most important open questions in all ofmathematics
![Page 13: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/13.jpg)
Complexity
What can be computed efficiently?Understanding the fundamental limits of computationincluding the limits of
and any future “computers”Some problems seems to require more resources to solvethan others, for example coming up with a correct proof fora mathematical statement seems to take more time thanverifying the correctness of a proof
One of the most important open questions in all ofmathematics
![Page 14: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/14.jpg)
Complexity
What can be computed efficiently?Understanding the fundamental limits of computationincluding the limits of
and any future “computers”Some problems seems to require more resources to solvethan others, for example coming up with a correct proof fora mathematical statement seems to take more time thanverifying the correctness of a proofOne of the most important open questions in all ofmathematics
![Page 15: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/15.jpg)
Contents
1 Formal Languages and Automata (6h)Finite Automata and Regular LanguagesPushdown Automata and Context-free Languages
2 Computability (3h)Turing machines and the notion of an AlgorithmProblems that cannot be solved (Undecidability)
3 Complexity (6h)Big-O notation and analysis of algorithmsTime-complexity classes, P, NPNP-completenessSpace complexity? P vs NP?
![Page 16: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/16.jpg)
Course Organization
Course Book:Michael Sipser. Introduction to the Theory of Computation,(2nd ed.), Thomson 2006
Webpage: www.ida.liu.se/∼TDDD65LecturesProblem Solving SessionsHomeworks (1 ECTS)Exam (3 ECTS)
![Page 17: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/17.jpg)
Course Organization: Homeworks (1 ECTS)
Two batches of obligatory homeworkThe grade is pass/fail and to pass (and get your 1 ECTS)you need to pass both batchesTo pass a batch of homeworks you need to make a realeffort on every problem and solve more than 2/3 of theproblems correctlyIf you fail, you will have to wait and do the homeworks fornext years courseYou need to sign up in webreg so that I can report yourgrade (follow the link on the homepage)
![Page 18: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/18.jpg)
Course Organization: Homeworks (1 ECTS)
Collaboration policy: “General discussions about the homeworkproblems is allowed (and encouraged). However, you mustwrite up your own solutions separately. If your solution isheavily inspired by someone else’s ideas, please give propercredit in your write-up to the people with whom you worked. Ifyou consult any reference material other than the textbook,please note on your homework which sources you used foreach problem. You MUST understand all the solutions in yourwrite-up and be prepared to explain them to me!”
![Page 19: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/19.jpg)
Course Organization: Exam (3 ECTS)
Written exam: October (January, August, October,...)The grades are Fail/3/4/5 and will be your final grade forthe course
![Page 20: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/20.jpg)
Basic Mathematical Notions: Strings and Languages
An alphabet is a finite set of symbols (denoted Σ, Γ)A string over Σ is a finite sequence of symbols from Σ
Example
1010 is a string over Σ1 = {0,1}theory is a string over Σ2 = {a,b, c, . . . , z}
![Page 21: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/21.jpg)
Basic Mathematical Notions: Strings and Languages
An alphabet is a finite set of symbols (denoted Σ, Γ)A string over Σ is a finite sequence of symbols from Σ
Example
1010 is a string over Σ1 = {0,1}theory is a string over Σ2 = {a,b, c, . . . , z}
![Page 22: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/22.jpg)
Basic Mathematical Notions: Strings and Languages
An alphabet is a finite set of symbols (denoted Σ, Γ)A string over Σ is a finite sequence of symbols from Σ
Example
1010 is a string over Σ1 = {0,1}theory is a string over Σ2 = {a,b, c, . . . , z}
![Page 23: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/23.jpg)
Basic Mathematical Notions: Strings and Languages
An alphabet is a finite set of symbols (denoted Σ, Γ)A string over Σ is a finite sequence of symbols from Σ
Example
1010 is a string over Σ1 = {0,1}theory is a string over Σ2 = {a,b, c, . . . , z}
The length of a string w (denoted |w |) is the number ofsymbols it contains. |1010| = 4, |theory | = 6The empty string (denoted ε) is the string of length 0The concatenation of strings x and y is written xy .x = slum and y = dog gives xy = slumdog.xk denotes the concatenation of x with itself k times.0150 = 0111110, x2y = slumslumdog.
![Page 24: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/24.jpg)
Basic Notions: Strings and Languages
A language is a set of strings over an alphabetΣ∗ is the language consisting of all strings over Σ
Union and intersection: A ∪ B = {x | x ∈ A or x ∈ B},A ∩ B = {x | x ∈ A and x ∈ B}Complement: A = {x ∈ Σ∗ | x /∈ A}Concatenation: AB = {xy | x ∈ A and y ∈ B}Ak denotes the concatenation of A with itself k times(note: A0 = {ε})Star: A∗ = A0 ∪ A1 ∪ A2 ∪ . . .
![Page 25: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/25.jpg)
Basic Notions: Strings and Languages
A language is a set of strings over an alphabetΣ∗ is the language consisting of all strings over Σ
Union and intersection: A ∪ B = {x | x ∈ A or x ∈ B},A ∩ B = {x | x ∈ A and x ∈ B}Complement: A = {x ∈ Σ∗ | x /∈ A}Concatenation: AB = {xy | x ∈ A and y ∈ B}
Ak denotes the concatenation of A with itself k times(note: A0 = {ε})Star: A∗ = A0 ∪ A1 ∪ A2 ∪ . . .
![Page 26: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/26.jpg)
Basic Notions: Strings and Languages
A language is a set of strings over an alphabetΣ∗ is the language consisting of all strings over Σ
Union and intersection: A ∪ B = {x | x ∈ A or x ∈ B},A ∩ B = {x | x ∈ A and x ∈ B}Complement: A = {x ∈ Σ∗ | x /∈ A}Concatenation: AB = {xy | x ∈ A and y ∈ B}Ak denotes the concatenation of A with itself k times(note: A0 = {ε})Star: A∗ = A0 ∪ A1 ∪ A2 ∪ . . .
![Page 27: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/27.jpg)
Examples of Languages
the set of odd binary numbersthe set of prime numbersthe set of syntactically correct Java programsthe set of positive integer solutions to xn + yn = zn forn > 2the set of true mathematical statements
![Page 28: TDDD65 Introduction to the Theory of Computation - …TDDD65/lectures/intro12.pdf · TDDD65 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer](https://reader031.fdocuments.net/reader031/viewer/2022031009/5b91ce0f09d3f210288c862f/html5/thumbnails/28.jpg)
Examples of Languages
the set of odd binary numbersthe set of prime numbersthe set of syntactically correct Java programsthe set of positive integer solutions to xn + yn = zn forn > 2the set of true mathematical statements