49
Theory of computation B. Srivathsan Chennai Mathematical Institute 1/31

Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Theory of computation

B. Srivathsan

Chennai Mathematical Institute

1/31

Page 2: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

http://www.cmi.ac.in/~sri/Courses/TOC2013

2/31

Page 3: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Why do this course?

3/31

Page 4: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Credits

Contents of this talk are picked from / inspired by:

I Wikipedia

I Sipser: Introduction to the theory of computation

I Kleene: Introduction to metamathematics

I Emerson: The beginning of model-checking: A personal perspective

I Scott Aaronson’s course at MIT: Great ideas in theoretical CS

4/31

Page 5: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940

5/31

Page 6: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

(Illustrations from Logicomix. Published by Bloomsbury)

6/31

Page 7: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

“ Those who don’t shave themselves are shaved by the barber ”

Who will shave the barber ?

Bertrand Russell (1872 - 1970)

Russell’s paradox (1901)

questioned Cantor’s set theory

7/31

Page 8: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

“ Those who don’t shave themselves are shaved by the barber ”

Who will shave the barber ?

Bertrand Russell (1872 - 1970)

Russell’s paradox (1901)

questioned Cantor’s set theory

7/31

Page 9: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

“ Those who don’t shave themselves are shaved by the barber ”

Who will shave the barber ?

Bertrand Russell (1872 - 1970)

Russell’s paradox (1901)

questioned Cantor’s set theory

7/31

Page 10: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Foundational crisis of mathematics

New schools of thought emerged in early 20th century

Intuitionist: Brouwer

Formalist: Russell, Whitehead, Hilbert

8/31

Page 11: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Hilbert’s programme

David Hilbert (1862 - 1943)

Goal: convert Mathematics to mechanical manipulation of symbols

9/31

Page 12: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

∀ : for all ∃ : there exists ∧ : and

I There are infinitely many primes

∀q ∃p ∀x, y [ p > q ∧ (x, y > 1→ xy 6= p) ]

I Fermat’s last theorem

∀a, b, c, n [ (a, b, c > 0 ∧ n > 2)→ an + bn 6= cn ]

I Twin prime conjecture

∀q ∃p ∀x, y [ p > q ∧ (x, y > 1→ (xy 6= p ∧ xy 6= p + 2) ) ]

Hilbert’s Entscheidungsproblem (1928)

Is there an “algorithm” that can take such a mathematical statement asinput and say if it is true or false?

10/31

Page 13: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

∀ : for all ∃ : there exists ∧ : and

I There are infinitely many primes

∀q ∃p ∀x, y [ p > q ∧ (x, y > 1→ xy 6= p) ]

I Fermat’s last theorem

∀a, b, c, n [ (a, b, c > 0 ∧ n > 2)→ an + bn 6= cn ]

I Twin prime conjecture

∀q ∃p ∀x, y [ p > q ∧ (x, y > 1→ (xy 6= p ∧ xy 6= p + 2) ) ]

Hilbert’s Entscheidungsproblem (1928)

Is there an “algorithm” that can take such a mathematical statement asinput and say if it is true or false?

10/31

Page 14: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Alonzo Church (1903 - 1995)

λ-calculus

Alan Turing (1912 - 1954)

Turing machines

Answer to Entscheidungsproblem is No (1935 - 1936)

11/31

Page 15: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Intuitively, an algorithm meant

“a process that determines the solution in a finite number of operations”

Intuitive notion not adequate to show that an algorithm does not existfor a problem!

12/31

Page 16: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Intuitively, an algorithm meant

“a process that determines the solution in a finite number of operations”

Intuitive notion not adequate to show that an algorithm does not existfor a problem!

12/31

Page 17: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Church-Turing thesis

Intuitive notion of algorithms

Turing machine algorithms

A prototype for a computing machine!

Advent of digital computers in the 40’s

13/31

Page 18: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Church-Turing thesis

Intuitive notion of algorithms

Turing machine algorithms

A prototype for a computing machine!

Advent of digital computers in the 40’s

13/31

Page 19: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Church-Turing thesis

Intuitive notion of algorithms

Turing machine algorithms

A prototype for a computing machine!

Advent of digital computers in the 40’s

13/31

Page 20: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940Precise notion of algorithm

14/31

Page 21: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1940 - 1975

15/31

Page 22: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

How “efficient” is an algorithm?

What is the “optimal” way of solving a problem?

Can we do better than just “brute-force”?

16/31

Page 23: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Computational complexity

Juris Hartmanis ( Born: 1928 ) Richard Stearns ( Born: 1936 )

Classification of algorithms based on time and space (1965)

17/31

Page 24: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

NP-completeness (1971 - 1973)

Stephen Cook ( Born: 1939 ) Leonid Levin ( Born: 1948 ) Richard Karp ( Born: 1935 )

Identified an important class of intrinsically difficult problems

An easy solution to one would give an easy solution to the other!

18/31

Page 25: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Some examples...

I Easy problems: sorting, finding shortest path in a graph

I Hard problems: scheduling classes for university

Computationally hard problems very important for cryptographers!

19/31

Page 26: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940Precise notion of algorithm

1940 - 1975Hardness of problems

20/31

Page 27: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1975 - present

21/31

Page 28: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Computer programs (esp. large ones)

are prone to ERRORS

Is there a way to

specify formally what a program is intended to do, and

verify automatically if the program satisfies the specification

22/31

Page 29: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Computer programs (esp. large ones)

are prone to ERRORS

Is there a way to

specify formally what a program is intended to do, and

verify automatically if the program satisfies the specification

22/31

Page 30: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Amir Pnueli ( 1941 - 2009 )

Temporal logic

Introduced a formalism to specify intended behaviours of programs (1977)

23/31

Page 31: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Edmund Clarke ( Born: 1945 ) Allen Emerson ( Born: 1954 ) Joseph Sifakis ( Born: 1946 )

Model-checking

Automatically verify a program against its specification (1981)

24/31

Page 32: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940Precise notion of algorithm

1940 - 1975Hardness of problems

1975 - presentCorrectness of programs

This course: Theory of computation + bit of Computational complexity

25/31

Page 33: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940Precise notion of algorithm (Theory of computation)

1940 - 1975Hardness of problems (Computational complexity theory)

1975 - presentCorrectness of programs (Formal verification)

This course: Theory of computation + bit of Computational complexity

25/31

Page 34: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

1900 - 1940Precise notion of algorithm (Theory of computation)

1940 - 1975Hardness of problems (Computational complexity theory)

1975 - presentCorrectness of programs (Formal verification)

This course: Theory of computation + bit of Computational complexity

25/31

Page 35: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Problems→ languages

26/31

Page 36: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problems

Questions for which the answer is either Yes or No

I Is the sum of 5 and 8 equal to 12?

I Is 19 a prime number?

I Is the graph G1 connected?

Figure: G1

27/31

Page 37: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Is the sum of 5 and 8 equal to 12 ?

Ladd = { (a, b, c) ∈ N× N× N | a + b = c }

{ (1, 3, 4), (5, 9, 14), (0, 2, 2), . . . }

Is (5, 8, 12) ∈ Ladd ?

Is 19 a prime number ?

Lprime = { x ∈ N | x is prime }

{ 1, 2, 3, 5, 7, 11, . . . }

Is 19 ∈ Lprime ?

28/31

Page 38: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Is the sum of 5 and 8 equal to 12 ?

Ladd = { (a, b, c) ∈ N× N× N | a + b = c }

{ (1, 3, 4), (5, 9, 14), (0, 2, 2), . . . }

Is (5, 8, 12) ∈ Ladd ?

Is 19 a prime number ?

Lprime = { x ∈ N | x is prime }

{ 1, 2, 3, 5, 7, 11, . . . }

Is 19 ∈ Lprime ?

28/31

Page 39: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Is the sum of 5 and 8 equal to 12 ?

Ladd = { (a, b, c) ∈ N× N× N | a + b = c }

{ (1, 3, 4), (5, 9, 14), (0, 2, 2), . . . }

Is (5, 8, 12) ∈ Ladd ?

Is 19 a prime number ?

Lprime = { x ∈ N | x is prime }

{ 1, 2, 3, 5, 7, 11, . . . }

Is 19 ∈ Lprime ?

28/31

Page 40: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Is the sum of 5 and 8 equal to 12 ?

Ladd = { (a, b, c) ∈ N× N× N | a + b = c }

{ (1, 3, 4), (5, 9, 14), (0, 2, 2), . . . }

Is (5, 8, 12) ∈ Ladd ?

Is 19 a prime number ?

Lprime = { x ∈ N | x is prime }

{ 1, 2, 3, 5, 7, 11, . . . }

Is 19 ∈ Lprime ?

28/31

Page 41: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Encoding graphs

〈 graph 〉 := no. of vertices $ edge relation

〈 〉0

1

2

3 $ (0, 1)(1, 2)(0, 2)

〈 〉0

1

2

3

4 $ (0, 1)(1, 2)(0, 2)

29/31

Page 42: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

0

1

2

Is graph G1 connected?

Lconn = { 〈G〉 | G is connected }

Is 〈G1〉 ∈ Lconn ?

Is 3 $ (0, 1)(1, 2)(0, 2) ∈ Lconn ?

30/31

Page 43: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

0

1

2

Is graph G1 connected?

Lconn = { 〈G〉 | G is connected }

Is 〈G1〉 ∈ Lconn ?

Is 3 $ (0, 1)(1, 2)(0, 2) ∈ Lconn ?

30/31

Page 44: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

0

1

2

Is graph G1 connected?

Lconn = { 〈G〉 | G is connected }

Is 〈G1〉 ∈ Lconn ?

Is 3 $ (0, 1)(1, 2)(0, 2) ∈ Lconn ?

30/31

Page 45: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problem P

Inputinstance

Yes?

No?

ALGORITHM

Language L

Inputword w

w ∈ L?

w /∈ L?

??

We answer “ ?? ” in this course

Main challenge: How to get a finite representation for languages?

31/31

Page 46: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problem P

Inputinstance

Yes?

No?

ALGORITHM

Language L

Inputword w

w ∈ L?

w /∈ L?

??

We answer “ ?? ” in this course

Main challenge: How to get a finite representation for languages?

31/31

Page 47: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problem P

Inputinstance

Yes?

No?

ALGORITHM

Language L

Inputword w

w ∈ L?

w /∈ L?

??

We answer “ ?? ” in this course

Main challenge: How to get a finite representation for languages?

31/31

Page 48: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problem P

Inputinstance

Yes?

No?

ALGORITHM

Language L

Inputword w

w ∈ L?

w /∈ L?

??

We answer “ ?? ” in this course

Main challenge: How to get a finite representation for languages?

31/31

Page 49: Theory of computationsri/Courses/TOC2013/Slides/lecture0.pdf · This course: Theory of computation + bit of Computational complexity 25/31. Problems !languages 26/31. Decision problems

Decision problem P

Inputinstance

Yes?

No?

ALGORITHM

Language L

Inputword w

w ∈ L?

w /∈ L?

??

We answer “ ?? ” in this course

Main challenge: How to get a finite representation for languages?

31/31