際際滷

際際滷Share a Scribd company logo
18.404/6.840 Lecture 21
Last time:
- Log-space reducibility
- L = NL? question
- is NL-complete
- is NL-complete
- NL = coNL (unfinished)
Today: (Sipser 則9.1)
- Finish NL = coNL
- Time and Space Hierarchy Theorems
1
Theorem (Immerman-Szelepcs辿nyi): NL = coNL
Proof: Show NL
Defn: NTM computes function if for all
1) All branches of on halt with on the tape or reject.
2) Some branch of on does not reject.
Let
Let YES}
Let
= Reachable nodes
= # reachable
YES, if has a path from to
NO, if not
Theorem: If some NL-machine (log-space NTM)
computes , then some NL-machine computes .
Proof: On input
1. Let
2. For each node
3. If YES, then
4. If NO, then continue
5. Output 
Next: Converse of above



=多多
NL = coNL (part 1/4)
Check-in 21.1
Check-in 21.1
Let be the graph below.
What is the value of ?
(a) 2 (e) 6
(b) 3 (f) 7
(c) 4 (g) 8
(d) 5 (h) 9

=多
2
NL = coNL (part 2/4)  key idea
Theorem: If some NL-machine computes , then some NL-machine computes .
Proof: On input where has nodes
1. Compute
2.
3. For each node
4. Nondeterministically go to (p) or (n)
(p) Nondeterministically pick a path from to of length .
If fail, then reject.
If , then output YES, else set .
(n) Skip and continue.
5. If then reject.
6. Output NO. [found all reachable nodes and none were }



=多多
3
NL = coNL (part 2/4)  key idea
SIMPLIFIED!!
Theorem: If some NL-machine computes , then some NL-machine computes .
Proof: On input where has nodes
1. Compute
2.
3. For each node
4. Nondeterministically pick a path from of length .
If it ends at then output YES and stop.
If it ends at , set .
5. If then reject.
6. Output NO. [found all reachable nodes and none were }



=多多
4
NL = coNL (part 3/4)
Theorem: If some NL-machine computes , then some NL-machine computes .
Proof: On input
1. Compute
2.
3. For each node
4. Nondeterministically go to (p) or (n)
(p) Nondeterministically pick a path from to of length .
If fail, then reject.
If , then output YES, else set .
(n) Skip and continue.
5. If then reject.
6. Output NO [found all reachable nodes and none were }



=多多
Let
Let YES}
Let
YES, if has a path to of length
NO, if not
5
NL = coNL (part 4/4)
Theorem: If some NL-machine computes , then some NL-machine computes .
Proof: On input
1. Compute
2.
3. For each node
4. Nondeterministically go to (p) or (n)
(p) Nondeterministically pick a path from to of length .
If fail, then reject.
If has an edge to , then output YES, else set .
(n) Skip and continue.
5. If then reject.
6. Output NO. [found all reachable nodes
and none had an edge to }



+1=多 +1多
+ 1
=多多
Corollary: Some NL-machine computes from .
Hence NL
On input
1. .
2. Compute each from for to .
3. Accept if = NO.
4. Reject if = YES.
6
L NL P NP PSPACE
Review: Major Complexity Classes

Today
The time and space hierarchy theorems show that
if a TM is given more time (or space) then it can do more.*
* certain restrictions apply.
For example:
TIME TIME [ means proper subset ]
SPACE SPACE
7
Space Hierarchy Theorem (1/2)
Theorem: For any (where satisfies a technical condition)
there is a language where requires space, i.e,
1) is decidable in space, and
2) is not decidable in space
On other words, SPACE SPACE
Notation: SPACEsome TM decides in space
SPACE
SPACE

Proof outline: (Diagonalization)
Give TM where
1) runs in space
2) ensures that for
every TM that runs in space.
Let .
8
Goal: Exhibit SPACE but SPACE
Give where and
1) runs in space
2) ensures that
for every TM that runs in space.
On input
1. Mark off tape cells where .
If ever try to use more tape, reject.
2. If for some TM , reject.
3. Simulate* on for steps
Accept if rejects,
Reject if accepts or hasnt halted.
*Note: can simulate with a constant factor
space overhead.
Space Hierarchy Theorem (2/2)
Issues:
1. What if runs in space but has
a big constant? Then wont have space
to simulate when is small.
FIX: simulate on infinitely many .
2. What if loops? [ must always halt]
FIX: Stop if it runs for steps.
3. How to compute ?
FIX: Assume is space constructible,
i.e., can compute within space.
Nice functions like , , , , , 
are all space constructible.
Mark off
tape
   #
=01011010100000
 

 ()

Hide me 
Check-in 21.2
Check-in 21.2
What happens when we run on input ?
a) It loops
b) It accepts
c) It rejects
d) We get a contradiction
e) Smoke comes out
9
Time Hierarchy Theorem (1/2)
Theorem: For any where is time constructible
there is a language where requires time, i.e,
1) is decidable in time, and
2) is not decidable in time
On other words, TIME TIME
Proof outline: Give TM where
1) runs in time
2) ensures that for every TM that runs in time .
Let .
10
Goal: Exhibit TIME but TIME
where
1) runs in time
2) ensures that for every TM
that runs in time.
On input
1. Compute .
2. If for some TM , reject.
3. Simulate* on for steps.
Accept if rejects,
Reject if accepts or hasnt halted.
*Note: can simulate with a log factor
time overhead due to the step counter.
Time Hierarchy Theorem (2/2)
Why do we lose a factor of ?
must halt within time.
To do so, counts the number of steps it uses and
stops if the limit is exceeded. The counter has
size and is stored on the tape.
It must be kept near the current head location.
Cost of moving it adds a overhead factor. So to
halt within time, stops when the counter reaches
.
11
L NL P NP PSPACE
Recap: Separating Complexity Classes

Space Hierarchy Theorem
NL SPACE SPACE PSPACE
Check-in 21.3
Check-in 21.3
Consider these two famous unsolved questions:
1. Does L = P?
2. Does P = PSPACE?
What do the hierarchy theorems tell us about
these questions?
a) Nothing
b) At least one of these has answer NO
c) At least one of these has answer YES
12
Quick review of today
1. Finish NL = coNL
2. Space hierarchy theorem
3. Time hierarchy theorem
13
MIT OpenCourseWare
https://ocw.mit.edu
18.404J Theory of Computation
Fall 2020
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

More Related Content

Similar to Finite automata and formal language lecture note (20)

Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Universitat Polit竪cnica de Catalunya
Lecture 11.2 : sorting
Lecture 11.2 :  sortingLecture 11.2 :  sorting
Lecture 11.2 : sorting
Vivek Bhargav
Linear Programming- Leacture-16-lp1.pptx
Linear Programming- Leacture-16-lp1.pptxLinear Programming- Leacture-16-lp1.pptx
Linear Programming- Leacture-16-lp1.pptx
SarahKoech1
Shell sort[1]
Shell sort[1]Shell sort[1]
Shell sort[1]
Niyati Thaker
Iteration
IterationIteration
Iteration
Liam Dunphy
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
rajinooka
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
Anu DAA i1t unit
Anu DAA i1t unitAnu DAA i1t unit
Anu DAA i1t unit
GANDIKOTA2012
CSMA/CD
CSMA/CDCSMA/CD
CSMA/CD
sainadh kamatala
Algorothm,
Algorothm,Algorothm,
Algorothm,
Syed Sohan Ahmed
algorothm,
algorothm,algorothm,
algorothm,
Syed Sohan Ahmed
Simulation-based optimization: Upper Confidence Tree and Direct Policy Search
Simulation-based optimization: Upper Confidence Tree and Direct Policy SearchSimulation-based optimization: Upper Confidence Tree and Direct Policy Search
Simulation-based optimization: Upper Confidence Tree and Direct Policy Search
Olivier Teytaud
TheoryOfComputaionNonDeterministic1.pptx
TheoryOfComputaionNonDeterministic1.pptxTheoryOfComputaionNonDeterministic1.pptx
TheoryOfComputaionNonDeterministic1.pptx
xarat89149
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
NYversity
lecture1 .pdf introduction to algorithms
lecture1 .pdf introduction to algorithmslecture1 .pdf introduction to algorithms
lecture1 .pdf introduction to algorithms
kero01289992383
Design and analysis of algorithm in Computer Science
Design and analysis of algorithm in Computer ScienceDesign and analysis of algorithm in Computer Science
Design and analysis of algorithm in Computer Science
secularistpartyofind
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
Class 16: Making Loops
Class 16: Making LoopsClass 16: Making Loops
Class 16: Making Loops
David Evans
Lecture 3 insertion sort and complexity analysis
Lecture 3   insertion sort and complexity analysisLecture 3   insertion sort and complexity analysis
Lecture 3 insertion sort and complexity analysis
jayavignesh86
04greedy 2x2
04greedy 2x204greedy 2x2
04greedy 2x2
Ankit Malik
Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Recurrent Neural Networks II (D2L3 Deep Learning for Speech and Language UPC ...
Universitat Polit竪cnica de Catalunya
Lecture 11.2 : sorting
Lecture 11.2 :  sortingLecture 11.2 :  sorting
Lecture 11.2 : sorting
Vivek Bhargav
Linear Programming- Leacture-16-lp1.pptx
Linear Programming- Leacture-16-lp1.pptxLinear Programming- Leacture-16-lp1.pptx
Linear Programming- Leacture-16-lp1.pptx
SarahKoech1
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
rajinooka
Simulation-based optimization: Upper Confidence Tree and Direct Policy Search
Simulation-based optimization: Upper Confidence Tree and Direct Policy SearchSimulation-based optimization: Upper Confidence Tree and Direct Policy Search
Simulation-based optimization: Upper Confidence Tree and Direct Policy Search
Olivier Teytaud
TheoryOfComputaionNonDeterministic1.pptx
TheoryOfComputaionNonDeterministic1.pptxTheoryOfComputaionNonDeterministic1.pptx
TheoryOfComputaionNonDeterministic1.pptx
xarat89149
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
NYversity
lecture1 .pdf introduction to algorithms
lecture1 .pdf introduction to algorithmslecture1 .pdf introduction to algorithms
lecture1 .pdf introduction to algorithms
kero01289992383
Design and analysis of algorithm in Computer Science
Design and analysis of algorithm in Computer ScienceDesign and analysis of algorithm in Computer Science
Design and analysis of algorithm in Computer Science
secularistpartyofind
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
Class 16: Making Loops
Class 16: Making LoopsClass 16: Making Loops
Class 16: Making Loops
David Evans
Lecture 3 insertion sort and complexity analysis
Lecture 3   insertion sort and complexity analysisLecture 3   insertion sort and complexity analysis
Lecture 3 insertion sort and complexity analysis
jayavignesh86

Recently uploaded (20)

APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
Digital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptxDigital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptx
Dr. Sarita Anand
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptxPOWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
MarilenQuintoSimbula
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptxCRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
PoojaSen20
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
pinkdvil200
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷sHow to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
Celine George
The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .
saanidhyapatel09
Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
A PPT Presentation on The Princess and the God: A tale of ancient India  by A...A PPT Presentation on The Princess and the God: A tale of ancient India  by A...
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
Beena E S
TPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategyTPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategy
Henry Tapper
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
Modeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptxModeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptx
maribethlacno2
How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
Digital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptxDigital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptx
Dr. Sarita Anand
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptxPOWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
POWERPOINT-PRESENTATION_DM-NO.017-S.2025.pptx
MarilenQuintoSimbula
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptxCRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
PoojaSen20
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1 2024  Lesson Plan M1...
Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1 2024 Lesson Plan M1...
pinkdvil200
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷sHow to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷s
Celine George
The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .
saanidhyapatel09
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
A PPT Presentation on The Princess and the God: A tale of ancient India  by A...A PPT Presentation on The Princess and the God: A tale of ancient India  by A...
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
Beena E S
TPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategyTPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategy
Henry Tapper
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
Modeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptxModeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptx
maribethlacno2
How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup

Finite automata and formal language lecture note

  • 1. 18.404/6.840 Lecture 21 Last time: - Log-space reducibility - L = NL? question - is NL-complete - is NL-complete - NL = coNL (unfinished) Today: (Sipser 則9.1) - Finish NL = coNL - Time and Space Hierarchy Theorems 1
  • 2. Theorem (Immerman-Szelepcs辿nyi): NL = coNL Proof: Show NL Defn: NTM computes function if for all 1) All branches of on halt with on the tape or reject. 2) Some branch of on does not reject. Let Let YES} Let = Reachable nodes = # reachable YES, if has a path from to NO, if not Theorem: If some NL-machine (log-space NTM) computes , then some NL-machine computes . Proof: On input 1. Let 2. For each node 3. If YES, then 4. If NO, then continue 5. Output Next: Converse of above =多多 NL = coNL (part 1/4) Check-in 21.1 Check-in 21.1 Let be the graph below. What is the value of ? (a) 2 (e) 6 (b) 3 (f) 7 (c) 4 (g) 8 (d) 5 (h) 9 =多 2
  • 3. NL = coNL (part 2/4) key idea Theorem: If some NL-machine computes , then some NL-machine computes . Proof: On input where has nodes 1. Compute 2. 3. For each node 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from to of length . If fail, then reject. If , then output YES, else set . (n) Skip and continue. 5. If then reject. 6. Output NO. [found all reachable nodes and none were } =多多 3
  • 4. NL = coNL (part 2/4) key idea SIMPLIFIED!! Theorem: If some NL-machine computes , then some NL-machine computes . Proof: On input where has nodes 1. Compute 2. 3. For each node 4. Nondeterministically pick a path from of length . If it ends at then output YES and stop. If it ends at , set . 5. If then reject. 6. Output NO. [found all reachable nodes and none were } =多多 4
  • 5. NL = coNL (part 3/4) Theorem: If some NL-machine computes , then some NL-machine computes . Proof: On input 1. Compute 2. 3. For each node 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from to of length . If fail, then reject. If , then output YES, else set . (n) Skip and continue. 5. If then reject. 6. Output NO [found all reachable nodes and none were } =多多 Let Let YES} Let YES, if has a path to of length NO, if not 5
  • 6. NL = coNL (part 4/4) Theorem: If some NL-machine computes , then some NL-machine computes . Proof: On input 1. Compute 2. 3. For each node 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from to of length . If fail, then reject. If has an edge to , then output YES, else set . (n) Skip and continue. 5. If then reject. 6. Output NO. [found all reachable nodes and none had an edge to } +1=多 +1多 + 1 =多多 Corollary: Some NL-machine computes from . Hence NL On input 1. . 2. Compute each from for to . 3. Accept if = NO. 4. Reject if = YES. 6
  • 7. L NL P NP PSPACE Review: Major Complexity Classes Today The time and space hierarchy theorems show that if a TM is given more time (or space) then it can do more.* * certain restrictions apply. For example: TIME TIME [ means proper subset ] SPACE SPACE 7
  • 8. Space Hierarchy Theorem (1/2) Theorem: For any (where satisfies a technical condition) there is a language where requires space, i.e, 1) is decidable in space, and 2) is not decidable in space On other words, SPACE SPACE Notation: SPACEsome TM decides in space SPACE SPACE Proof outline: (Diagonalization) Give TM where 1) runs in space 2) ensures that for every TM that runs in space. Let . 8
  • 9. Goal: Exhibit SPACE but SPACE Give where and 1) runs in space 2) ensures that for every TM that runs in space. On input 1. Mark off tape cells where . If ever try to use more tape, reject. 2. If for some TM , reject. 3. Simulate* on for steps Accept if rejects, Reject if accepts or hasnt halted. *Note: can simulate with a constant factor space overhead. Space Hierarchy Theorem (2/2) Issues: 1. What if runs in space but has a big constant? Then wont have space to simulate when is small. FIX: simulate on infinitely many . 2. What if loops? [ must always halt] FIX: Stop if it runs for steps. 3. How to compute ? FIX: Assume is space constructible, i.e., can compute within space. Nice functions like , , , , , are all space constructible. Mark off tape # =01011010100000 () Hide me Check-in 21.2 Check-in 21.2 What happens when we run on input ? a) It loops b) It accepts c) It rejects d) We get a contradiction e) Smoke comes out 9
  • 10. Time Hierarchy Theorem (1/2) Theorem: For any where is time constructible there is a language where requires time, i.e, 1) is decidable in time, and 2) is not decidable in time On other words, TIME TIME Proof outline: Give TM where 1) runs in time 2) ensures that for every TM that runs in time . Let . 10
  • 11. Goal: Exhibit TIME but TIME where 1) runs in time 2) ensures that for every TM that runs in time. On input 1. Compute . 2. If for some TM , reject. 3. Simulate* on for steps. Accept if rejects, Reject if accepts or hasnt halted. *Note: can simulate with a log factor time overhead due to the step counter. Time Hierarchy Theorem (2/2) Why do we lose a factor of ? must halt within time. To do so, counts the number of steps it uses and stops if the limit is exceeded. The counter has size and is stored on the tape. It must be kept near the current head location. Cost of moving it adds a overhead factor. So to halt within time, stops when the counter reaches . 11
  • 12. L NL P NP PSPACE Recap: Separating Complexity Classes Space Hierarchy Theorem NL SPACE SPACE PSPACE Check-in 21.3 Check-in 21.3 Consider these two famous unsolved questions: 1. Does L = P? 2. Does P = PSPACE? What do the hierarchy theorems tell us about these questions? a) Nothing b) At least one of these has answer NO c) At least one of these has answer YES 12
  • 13. Quick review of today 1. Finish NL = coNL 2. Space hierarchy theorem 3. Time hierarchy theorem 13
  • 14. MIT OpenCourseWare https://ocw.mit.edu 18.404J Theory of Computation Fall 2020 For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.