Computational Models (0382.2200) (Inroduction to the Theory of Computing) http://www.cs.tau.ac.il/∼bchor/CM/compute.html Instructor: Prof. Benny Chor (benny@cs.tau.ac.il) Teaching Assistant: Dr. Gad Kimmel ([email protected]) Tel-Aviv University Fall Semester, 2003-2004 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.1
94
Embed
Computational Models (Inroduction to the Theory …bchor/CM/Compute1_Intro.pdfMichael Sipser, Introduction to the theory of computation. Slides modified by Benny Chor, based on original
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.
External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.
Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.
Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTriviaCourse Requirements:
6-7 problem sets (10-15% of grade).Homework should be solved independently.External sources (books, journal articles, webpages) can be used but should be clearlyquoted.Answers should be readable, concise, andcorrect.Late submition will not be accepted.
Midterm exam (20-25% of grade).
Final exam (60-70% of grade).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.2
AdministraTrivia IIPrerequisites:
Extended introduction to computer science(aka Scheme course).Students from other disciplines with somemathematical background are encouraged tocontact the instructor.
Textbook (extensively used, highlyrecommended):
Michael Sipser, Introduction to the theory ofcomputation.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
AdministraTrivia IIPrerequisites:
Extended introduction to computer science(aka Scheme course).
Students from other disciplines with somemathematical background are encouraged tocontact the instructor.
Textbook (extensively used, highlyrecommended):
Michael Sipser, Introduction to the theory ofcomputation.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
AdministraTrivia IIPrerequisites:
Extended introduction to computer science(aka Scheme course).Students from other disciplines with somemathematical background are encouraged tocontact the instructor.
Textbook (extensively used, highlyrecommended):
Michael Sipser, Introduction to the theory ofcomputation.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
AdministraTrivia IIPrerequisites:
Extended introduction to computer science(aka Scheme course).Students from other disciplines with somemathematical background are encouraged tocontact the instructor.
Textbook (extensively used, highlyrecommended):
Michael Sipser, Introduction to the theory ofcomputation.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
AdministraTrivia IIPrerequisites:
Extended introduction to computer science(aka Scheme course).Students from other disciplines with somemathematical background are encouraged tocontact the instructor.
Textbook (extensively used, highlyrecommended):
Michael Sipser, Introduction to the theory ofcomputation.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.3
Why Study Theory?
Basic Computer Science Issues
What is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?
Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?
What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic Reasons
Avoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.
Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.
Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Why Study Theory?
Basic Computer Science IssuesWhat is a computation?Are computers omnipotent?What are the fundemental capabilities andlimitations of computers?
Pragmatic ReasonsAvoid intractable or impossible problems.Apply efficient algorithms when possible.Learn to tell the difference.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.4
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.Fixed parameter algorithms.Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.Fixed parameter algorithms.Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.Fixed parameter algorithms.Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.
Fixed parameter algorithms.Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.Fixed parameter algorithms.
Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Course Topics
Automata Theory: What is a computer?
Computability Theory: What can computers do?
Complexity Theory: What makes some problemscomputationally hard and others easy?
Coping with intractability:Approximation.Randomization.Fixed parameter algorithms.Heuristics.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.5
Automata Theory - Simple Models
Finite automata.
Related to controllers and hardware design.Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.
Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.Useful in text processing and finding patternsin strings.
Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.
Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.
Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Automata Theory - Simple Models
Finite automata.Related to controllers and hardware design.Useful in text processing and finding patternsin strings.Probabilistic (Markov) versions useful inmodeling various natural phenomena (e.g.speech recognition).
Push down automata.Titely related to a family of languages knownas context free languages.Play important role in compilers, design ofprogramming languages, and studies ofnatural languages.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.6
Computability Theory
In the first half of the 20th century, mathematicianssuch as Kurt Göedel, Alan Turing, and AlonzoChurch discovered that some fundemental problemscannot be solved by computers.
Proof verication of statements can be automated.
It is natural to expect that determining validitycan also be done by a computer.
Theorem: A computer cannot determine ifmathematical statement true or false.
Results needed theoretical models for computers.
These theoretical models helped lead to theconstruction of real computers.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
Computability Theory
In the first half of the 20th century, mathematicianssuch as Kurt Göedel, Alan Turing, and AlonzoChurch discovered that some fundemental problemscannot be solved by computers.
Proof verication of statements can be automated.
It is natural to expect that determining validitycan also be done by a computer.
Theorem: A computer cannot determine ifmathematical statement true or false.
Results needed theoretical models for computers.
These theoretical models helped lead to theconstruction of real computers.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
Computability Theory
In the first half of the 20th century, mathematicianssuch as Kurt Göedel, Alan Turing, and AlonzoChurch discovered that some fundemental problemscannot be solved by computers.
Proof verication of statements can be automated.
It is natural to expect that determining validitycan also be done by a computer.
Theorem: A computer cannot determine ifmathematical statement true or false.
Results needed theoretical models for computers.
These theoretical models helped lead to theconstruction of real computers.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
Computability Theory
In the first half of the 20th century, mathematicianssuch as Kurt Göedel, Alan Turing, and AlonzoChurch discovered that some fundemental problemscannot be solved by computers.
Proof verication of statements can be automated.
It is natural to expect that determining validitycan also be done by a computer.
Theorem: A computer cannot determine ifmathematical statement true or false.
Results needed theoretical models for computers.
These theoretical models helped lead to theconstruction of real computers.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
Computability Theory
In the first half of the 20th century, mathematicianssuch as Kurt Göedel, Alan Turing, and AlonzoChurch discovered that some fundemental problemscannot be solved by computers.
Proof verication of statements can be automated.
It is natural to expect that determining validitycan also be done by a computer.
Theorem: A computer cannot determine ifmathematical statement true or false.
Results needed theoretical models for computers.
These theoretical models helped lead to theconstruction of real computers.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.7
Computability Theory
a simplicial complexSlides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.8
Paths and Loops
a path is a sequence of vertices connected byedges
a loop is a path that ends and ends at the samevertex
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.9
Paths and Loops can be Deformed
(v0, v1) ⇔ (v0, v2, v1)
(v0, v0) ⇔ (v0)
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.10
Contractibility
contractible
notcontractible
No algorithm can determine whether an arbitraryloop in an arbitrary finite complex is contractible.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.11
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Some Other Undecidable ProblemsDoes a program run forever?
Is a program correct?
Are two programs equivalent?
Is a program optimal?
Does an equation with one or more variables andinteger coefficients (5x + 15y = 12) have aninteger solution (Hilbert’s 10th problem).
Is a finitely-presented group trivial?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.12
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:
description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parameters
description of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedure
a recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipe
a computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer program
a mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithms
fastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)
most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)
expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Complexity Theory
Key notion: tractable vs. intractable problems.
A problem is a general computational question:description of parametersdescription of solution
An algorithm is a step-by-step procedurea recipea computer programa mathematical object
We want the most efficient algorithmsfastest (usually)most economical with memory (sometimes)expressed as a function of problem size
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.13
Example: Traveling Salesman Problem
10 9
36
9
a
b
c
d
5
Roger WilliamsZoo
Brown UniversityAl FornoRestaurant
StateCapitol
(not drawn to scale)
Parameters:
set of cities
set of inter-city distances
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.14
Example: Traveling Salesman Problem
10 9
36
9
a
b
c
d
5
Roger WilliamsZoo
Brown UniversityAl FornoRestaurant
StateCapitol
(not drawn to scale)
Parameters:
set of cities
set of inter-city distancesSlides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.14
Example: Traveling Salesman Problem
10 9
36
9
a
b
c
d
5
Roger WilliamsZoo
Brown UniversityAl FornoRestaurant
StateCapitol
(not drawn to scale)
Solution:
want the shortest tour through the cities
example: a, b, d, c, a has length 27.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.15
Example: Traveling Salesman Problem
10 9
36
9
a
b
c
d
5
Roger WilliamsZoo
Brown UniversityAl FornoRestaurant
StateCapitol
(not drawn to scale)
Solution:
want the shortest tour through the cities
example: a, b, d, c, a has length 27.Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.15
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?
m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problem
alphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbols
strings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
Measures
Problem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).
Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Problem SizeWhat is an appropriate measure of problem size?
m nodes?m(m + 1)/2 distances?
Use an encoding of the problemalphabet of symbolsstrings: a/b/c/d//10/5/9//6/9//3.
MeasuresProblem Size: length of encoding (here: 23ascii characters).Time Complexity: how long an algorithmruns, as function of problem size?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.16
Time Complexity - What is tractable?
A function f(n) is O(g(n)) whenever|f(n)| ≤ c · |g(n)| for large enough n.
A polynomial-time algorithm is one whose timecomplexity is O(p(n)) for some polynomial p(n).
An exponential-time algorithm is one whose timecomplexity cannot be bounded by a polynomial(e.g., nlog n).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.17
Time Complexity - What is tractable?
A function f(n) is O(g(n)) whenever|f(n)| ≤ c · |g(n)| for large enough n.
A polynomial-time algorithm is one whose timecomplexity is O(p(n)) for some polynomial p(n).
An exponential-time algorithm is one whose timecomplexity cannot be bounded by a polynomial(e.g., nlog n).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.17
Time Complexity - What is tractable?
A function f(n) is O(g(n)) whenever|f(n)| ≤ c · |g(n)| for large enough n.
A polynomial-time algorithm is one whose timecomplexity is O(p(n)) for some polynomial p(n).
An exponential-time algorithm is one whose timecomplexity cannot be bounded by a polynomial(e.g., nlog n).
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.17
Tractability – Basic distinction:
Polynomial time = tractable.
Exponential time = intractable.
10 20 30 40 50 60
n .00001 .00002 .00003 .00004 .00005 .00006
second second second second second second
n2
.00001 .00004 .00009 .00016 .00025 .00036
second second second second second second
n3
.00001 .00008 .027 .064 .125 .216
second second second second second second
n5
.1 3.2 24.3 1.7 5.2 13.0
second seconds seconds minute minutes minutes
2n
.001 1.0 17.9 12.7 35.7 366
second second minutes days years centuries
3n
.059 58 6.5 3855 2 · 108 1.3 · 1013
second minutes years centuries centuries centuriesSlides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.18
Effect of Speed-Ups
Let’s wait for faster hardware! Consider maximumproblem size you can solve in an hour.
present 100 times faster 1000 times faster
n N1 100N1 1000N1
n2
N2 10N2 31.6N2n3
N3 4.64N3 10N3
n5
N4 2.5N4 3.98N42n
N5 N5 + 6.64 N5 + 9.97
3n
N6 N6 + 4.19 N6 + 6.29
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.19
NP-Completeness
Your boss says:
“Get me an efficient traveling-salesmanalgorithm, or else.”
What are you going to do?
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.20
Response
“Yes Ma’am, expect it this afternoon!”
Problem is
All known algorithms (essentially) check allpossible paths.
Exhaustive checking is exponential.
Good luck!
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.21
Response
“Yes Ma’am, expect it this afternoon!”
Problem is
All known algorithms (essentially) check allpossible paths.
Exhaustive checking is exponential.
Good luck!
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.21
Response
“Yes Ma’am, expect it this afternoon!”
Problem is
All known algorithms (essentially) check allpossible paths.
Exhaustive checking is exponential.
Good luck!
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.21
Response
“Hah!, I will prove that no such algorithm is possible”
Problem is, proving intractability is very hard.
Many important problems have
no known tractable algorithms
no known proof of intractability.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.22
Response
“Hah!, I will prove that no such algorithm is possible”
Problem is, proving intractability is very hard.
Many important problems have
no known tractable algorithms
no known proof of intractability.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.22
Response
“I can’t find an efficient algorithm.I guess I’m just a pathetic loser. ”
Bad for job security.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.23
Response
“The problem is NP-complete. I can’t findan efficient algorithm, but neither can anyof these famous people . . . ”
Advantage is:
The problem is “just as hard” as other problemssmart people can’t solve efficiently.
So it would do your boss no good to fire you andhire a Technion/Hebrew Univ./MIT graduate.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.24
Response
“The problem is NP-complete. I can’t findan efficient algorithm, but neither can anyof these famous people . . . ”
Advantage is:
The problem is “just as hard” as other problemssmart people can’t solve efficiently.
So it would do your boss no good to fire you andhire a Technion/Hebrew Univ./MIT graduate.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.24
Response
“Would you settle for a pretty good, but not the best,algorithm?”
Intractability isn’t everything.
Find an approximate solution (is a solution within10% of optimum good enough, ma’am?).
Use randomization.
Fixed parameter algorithms may be applicable.
Heuristics can also help.
Approximation, randomization, etc. are amongthe hottest areas in complexity theory andalgorithmic research today.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.25
Response
“Would you settle for a pretty good, but not the best,algorithm?”
Intractability isn’t everything.
Find an approximate solution (is a solution within10% of optimum good enough, ma’am?).
Use randomization.
Fixed parameter algorithms may be applicable.
Heuristics can also help.
Approximation, randomization, etc. are amongthe hottest areas in complexity theory andalgorithmic research today.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.25
Response
“Would you settle for a pretty good, but not the best,algorithm?”
Intractability isn’t everything.
Find an approximate solution (is a solution within10% of optimum good enough, ma’am?).
Use randomization.
Fixed parameter algorithms may be applicable.
Heuristics can also help.
Approximation, randomization, etc. are amongthe hottest areas in complexity theory andalgorithmic research today.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.25
Response
“Would you settle for a pretty good, but not the best,algorithm?”
Intractability isn’t everything.
Find an approximate solution (is a solution within10% of optimum good enough, ma’am?).
Use randomization.
Fixed parameter algorithms may be applicable.
Heuristics can also help.
Approximation, randomization, etc. are amongthe hottest areas in complexity theory andalgorithmic research today.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.25
Response
“Would you settle for a pretty good, but not the best,algorithm?”
Intractability isn’t everything.
Find an approximate solution (is a solution within10% of optimum good enough, ma’am?).
Use randomization.
Fixed parameter algorithms may be applicable.
Heuristics can also help.
Approximation, randomization, etc. are amongthe hottest areas in complexity theory andalgorithmic research today.
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. – p.25