Diapositive 1

Complexity theory and combinatorial optimization
Class #2 – 17th of March
…. where we deal with decision problems, finite automata, Turing machines
pink dogs, ….
But also P, NP, NP-completeness, …..
Introduction to computational intractability
Is my problem efficiently solved by aan
computer?
algorithm?
What’s a problem?
That is the problem ….
Decision problems: each instance is a question
Formal definition with language theory
encoding scheme
More natural problems: “meta-language”
What’s an algorithm?
• The pink dog question
WillDoes
ever
exist
any
pink dog
outside London?
Does
abepink
a dog
pink
exist
dog
exist?
(outside
London)?
Since the answer is yes, it can be answered
To answer
it one
a formal
model
of dogs.
Since
there are
onlyneeds
a finite
number
of dogs
(outside London)
and since for each one a can decide whether it is pink or not
it can be answered.
What’s an algorithm?
• The pink dog question
• Computability models
Before the first computer
o Lambda-calculus (A. Church, 1931)
o General recursive functions (K. Gödel, 1934)
oTuring machines (A. Turing, 1936)
o Random-Access Machines, …
• Church thesis
What’s an algorithm: the Turing machine model
• From finite states automaton ….. to Turing machines
• 1-tape (deterministic) Turing Machine (DTM)
Example
• multi-tape Turing machines
• non-deterministic Turing machines (NDTM)
o transition function
transition relation
o put non-determinism at the beginning
• equivalence between all these Turing machines models
• universal Turing Machine
Problems solved by Turing machines
M: DTM, L a language on the same input alphabet
• Is L recognized by M?
• Is L decided by L?
Decision problem solved by an algorithm?
(through an encoding scheme)
• The halting problem: an example of undecidable problem
Complexity of Turing machines
A notion of efficiency
• Complexity of DTM (halting for each instance)
• Complexity of NDTM
• Polynomial-time: considered as efficiency (Cobham-Edmond’s thesis)
• Difference between DTM and NDTM (from complexity point of view)
• From languages to problems (reasonable encoding schemes)
P, NP and NP-completeness
• The class P
• The class NP
• Exponentially solving problems in NP
• Polynomial reductions
• NP-complete problems
Some NP-complete problems
• SAT
• Cook’s theorem (1971)
•How to prove NP-completeness after Cook?
• 3-SAT
• to be continued during the next class
Enjoy your vacation
An Example of 1-tape Deterministic Turing Machine

0
q0
(q1,b,  1)
(q N ,1,  1) (qY ,b,  1)
q1
(q1,0 ,  1)
(q2 ,1,  1)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