28
TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department of Computer and Information Science [email protected] 2009-08-31

TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

TDDC95Introduction to the Theory of Computation

Lecture 1

Gustav NordhDepartment of Computer and Information Science

[email protected]

2009-08-31

Page 2: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Outline - Lecture 1

Objectives and MotivationContentsCourse OrganizationBasic NotionsFinite Automata

Page 3: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Course Organization

Course Book:Michael Sipser. Introduction to the Theory of Computation,(2nd ed.), Thomson 2006

Webpage: www.ida.liu.se/∼TDDC95LecturesProblem Solving SessionsHomeworks (1 ECTS)Exam (3 ECTS)

Page 17: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Course Organization: Homeworks (1 ECTS)

Two batches of obligatory homework (HW1 posted on web,deadline September 18)The 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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Course Organization: Exam (3 ECTS)

Written exam: 2009-10-20 (2010-01-12, Aug 2010, Oct2010, Jan 2011,...)The grades are fail/3/4/5 and will be your final grade for thecourse

Page 20: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Basic 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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Basic 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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Basic 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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

Basic 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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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: TDDC95 Introduction to the Theory of Computation - Lecture 1TDDC95/lectures/intro09.pdf · 2009-08-31 · TDDC95 Introduction to the Theory of Computation Lecture 1 Gustav Nordh Department

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