This document summarizes the key topics covered in a lecture on Theory of Computation:
1. It discusses PSPACE completeness and the complexity classes L and NL.
2. It provides details on the upcoming Exam 2, covering chapters on undecidability, reducibility, recursion theorem, complexity classes like P and NP, and space complexity classes like PSPACE.
3. It reviews space complexity classes like PSPACE and NPSPACE and theorems relating space and time complexity like Savitch's Theorem. It also discusses PSPACE-complete problems like TQBF.
4. Finally, it introduces the sublinear space complexity classes L and NL and discusses example problems complete for each,
DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...2022cspaawan12556
油
What is Complexity Analysis?
What is the need for Complexity Analysis?
Asymptotic Notations
How to measure complexity?
1. Time Complexity
2. Space Complexity
3. Auxiliary Space
How does Complexity affect any algorithm?
How to optimize the time and space complexity of an Algorithm?
Different types of Complexity exist in the program:
1. Constant Complexity
2. Logarithmic Complexity
3. Linear Complexity
4. Quadratic Complexity
5. Factorial Complexity
6. Exponential Complexity
Worst Case time complexity of different data structures for different operations
Complexity Analysis Of Popular Algorithms
Practice some questions on Complexity Analysis
practice with giving Quiz
Conclusion
Data Structure & Algorithms - Mathematicalbabuk110
油
This document discusses various mathematical notations and asymptotic analysis used for analyzing algorithms. It covers floor and ceiling functions, remainder function, summation symbol, factorial function, permutations, exponents, logarithms, Big-O, Big-Omega and Theta notations. It provides examples of calculating time complexity of insertion sort and bubble sort using asymptotic notations. It also discusses space complexity analysis and how to calculate the space required by an algorithm.
Dynamic Programming - Laughlin Lunch and LearnBillie Rose
油
This document discusses algorithms and their time complexities. It provides examples of different algorithm time complexities such as O(1), O(log n), O(n), O(n log n), O(n2), and O(n!). Dynamic programming techniques like memoization and bottom-up approaches are described. The Knuth-Plass and greedy line wrapping algorithms are summarized. P vs NP and Turing machines are briefly covered.
Control structures provide programming languages with the ability to alter the sequential execution of code. The key control structures are sequential execution, selection (if/else), repetition (loops), and unconditional branching (goto). Selection statements allow a program to choose which instructions to execute based on conditions, while repetition statements allow code to execute repeatedly. Early languages like FORTRAN had limited control structures, while ALGOL introduced more robust structures like blocks and flexible for loops. Modern languages continue to refine control structures for readability and reliability.
Shell Sort is a generalization of insertion sort that works by sorting elements with large gaps first then decreasing the gaps until a gap of 1, which is regular insertion sort. It has a worst case time complexity of O(n^2) but average complexity near O(n). Merge Sort divides the array into halves recursively, merges the sorted halves back together to fully sort the array. It has a best, average, and worst case time complexity of O(nlogn) and requires O(n) auxiliary space but is not an in-place sorting algorithm.
https://telecombcn-dl.github.io/2017-dlsl/
Winter School on Deep Learning for Speech and Language. UPC BarcelonaTech ETSETB TelecomBCN.
The aim of this course is to train students in methods of deep learning for speech and language. Recurrent Neural Networks (RNN) will be presented and analyzed in detail to understand the potential of these state of the art tools for time series processing. Engineering tips and scalability issues will be addressed to solve tasks such as machine translation, speech recognition, speech synthesis or question answering. Hands-on sessions will provide development skills so that attendees can become competent in contemporary data analytics tools.
This document provides an overview of sorting algorithms including selection sort, bubble sort, insertion sort, merge sort, and heapsort. It discusses the time and space complexity of each algorithm, with merge sort having the best time complexity of O(n log n). Code examples and exercises are provided to help understand how each algorithm works. The goal is to help students learn common sorting techniques needed for coding interviews and problems.
The document describes Shellsort, a sorting algorithm developed by Donald Shell in 1959. It is an improvement on insertion sort. Shellsort works by sorting elements first with large gaps between elements, then reducing the gaps and sorting again until the final gap is 1, completing the sort. It takes advantage of insertion sort being most efficient on nearly sorted lists. The time complexity is O(n^r) for 1 < r < 2, better than O(n^2) of insertion sort but generally worse than O(n log n) of quicker algorithms.
Iterative structures, also known as loops, repeat sections of code and are used for tasks like calculating multiple values, computing iterative results, printing tables of data, and processing large amounts of input or array data. The three types of loops in C++ are the while loop, do-while loop, and for loop, each with different test conditions to control the loop execution. Loops can also be nested within each other to perform multiple iterations or to loop through multi-dimensional data structures.
This document discusses NP-complete problems and nondeterministic algorithms. It begins by introducing NP-completeness as evidence that many important problems cannot be solved quickly. It then defines different complexity classes like P, NP, NP-hard, and NP-complete. It provides examples of NP-complete problems like maximum clique and 0/1 knapsack. It also discusses how to show that a problem is NP-complete using polynomial-time reductions from another known NP-complete problem. In particular, it shows that the clique decision problem is NP-complete by reducing SAT to it.
NP completeness. Classes P and NP are two frequently studied classes of problems in computer science. Class P is the set of all problems that can be solved by a deterministic Turing machine in polynomial time.
The document discusses algorithms and their analysis. It begins with definitions of algorithms and describes their key properties including definiteness, finiteness, and effectiveness. It then discusses different ways to specify algorithms using natural language, flowcharts, or pseudo-code. Examples are provided to illustrate selection sort and the Towers of Hanoi problem solved recursively. The document concludes with analyzing the time and space complexity of algorithms.
CSMA/CD is a media access control method used in early Ethernet technology that uses carrier sensing to detect other signals while transmitting. It improves on CSMA by terminating transmission as soon as a collision is detected to shorten the time before resending. There are three types of CSMA protocols: 1-Persistent, Non-Persistent, and P-Persistent. CSMA/CD networks can detect collisions within twice the propagation delay allowing aborted collisions. It was used in older Ethernet variants and is still supported for backwards compatibility.
This document presents an algorithm design group project on algorithm analysis. It introduces key concepts like the definition of an algorithm, criteria algorithms must satisfy, pseudocode conventions, and asymptotic analysis. The group members are listed. Examples are provided to explain Big O, Omega, and Theta notation for analyzing the time complexity of algorithms like Fibonacci sequence. Randomized algorithms making random choices are also introduced.
The document introduces an algorithm design presentation by a group called Study 360属. It defines an algorithm and discusses criteria algorithms must satisfy like having clear instructions and terminating after a finite number of steps. It presents conventions for writing pseudocode and analyzes the time complexity of a Fibonacci algorithm using asymptotic notation like Big O(n), Omega(n), and Theta(n). Finally, it defines randomized algorithms as making random choices during runtime for potential benefits in speed, simplicity, or leading to deterministic algorithms.
Simulation-based optimization: Upper Confidence Tree and Direct Policy SearchOlivier Teytaud
油
The document discusses using simulations and algorithms to optimize power grids over different timescales:
1. Short term dispatching in real-time using human control
2. Combinatorial optimization over days/weeks
3. Stochastic hydroelectric optimization over years
4. Expensive multi-objective optimization of investment strategies over 50 years
It proposes using simulation-based optimization techniques like Upper Confidence Trees and Direct Policy Search to analyze simulations while allowing domain expertise to be incorporated through approximate policies. The goal is optimizing investments in power grids in Europe and North Africa over the next 50 years under different scenarios.
This document contains notes from a course on theory of computation taught by Professor Michael Sipser at MIT in Fall 2012. The notes were taken by Holden Lee and cover 25 lectures on topics including finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, decidability, and complexity theory. In particular, the notes summarize key definitions, theorems, and problems discussed in each lecture, with the overarching goal of understanding what types of problems can and cannot be solved by a computer.
This document summarizes key concepts in cryptography and number theory relevant to public key cryptography algorithms like RSA. It discusses number theoretic concepts like prime numbers, modular arithmetic, discrete logarithms, and one-way functions. It then provides an overview of the RSA algorithm, explaining how it uses the difficulty of factoring large numbers to enable secure public key encryption and digital signatures.
This document summarizes a class about making loops in Scheme. It recaps the Turing machine model and provides an example of a Turing machine that counts stars. It then introduces making loops in Scheme using a for procedure that takes an index, end value, and procedure as arguments. Examples are given to print numbers from 1 to 10 and to generate a multiplication table using nested for loops. The document also discusses tracing for to see how it works and introduces generalized while and accumulating loop procedures. It concludes by announcing assignments and due dates for Problem Set 4 and Exam 1.
Lecture 3 insertion sort and complexity analysisjayavignesh86
油
This document discusses algorithms and insertion sort. It begins by defining time complexity as the amount of computer time required by an algorithm to complete. Time complexity is measured by the number of basic operations like comparisons, not in physical time units. The document then discusses how to calculate time complexity by counting the number of times loops and statements are executed. It provides examples of calculating time complexities of O(n) for a simple for loop and O(n^2) for a nested for loop. Finally, it introduces insertion sort and divide-and-conquer algorithms.
The document discusses greedy algorithms for interval scheduling problems. It describes the interval scheduling problem of finding the maximum set of mutually compatible jobs that do not overlap in time. It presents the greedy algorithm of considering jobs in order of finishing time and scheduling each job if it is compatible with previously scheduled jobs. The algorithm runs in O(n log n) time and is proven to be optimal. The document also covers the related interval partitioning problem of scheduling lectures to minimize the number of classrooms needed.
APM People Interest Network Conference 2025
-Autonomy, Teams and Tension: Projects under stress
-Tim Lyons
-The neurological levels of
team-working: Harmony and tensions
With a background in projects spanning more than 40 years, Tim Lyons specialised in the delivery of large, complex, multi-disciplinary programmes for clients including Crossrail, Network Rail, ExxonMobil, Siemens and in patent development. His first career was in broadcasting, where he designed and built commercial radio station studios in Manchester, Cardiff and Bristol, also working as a presenter and programme producer. Tim now writes and presents extensively on matters relating to the human and neurological aspects of projects, including communication, ethics and coaching. He holds a Masters degree in NLP, is an NLP Master Practitioner and International Coach. He is the Deputy Lead for APMs People Interest Network.
Session | The Neurological Levels of Team-working: Harmony and Tensions
Understanding how teams really work at conscious and unconscious levels is critical to a harmonious workplace. This session uncovers what those levels are, how to use them to detect and avoid tensions and how to smooth the management of change by checking you have considered all of them.
Digital Tools with AI for e-Content Development.pptxDr. Sarita Anand
油
This ppt is useful for not only for B.Ed., M.Ed., M.A. (Education) or any other PG level students or Ph.D. scholars but also for the school, college and university teachers who are interested to prepare an e-content with AI for their students and others.
More Related Content
Similar to Finite automata and formal language lecture note (20)
https://telecombcn-dl.github.io/2017-dlsl/
Winter School on Deep Learning for Speech and Language. UPC BarcelonaTech ETSETB TelecomBCN.
The aim of this course is to train students in methods of deep learning for speech and language. Recurrent Neural Networks (RNN) will be presented and analyzed in detail to understand the potential of these state of the art tools for time series processing. Engineering tips and scalability issues will be addressed to solve tasks such as machine translation, speech recognition, speech synthesis or question answering. Hands-on sessions will provide development skills so that attendees can become competent in contemporary data analytics tools.
This document provides an overview of sorting algorithms including selection sort, bubble sort, insertion sort, merge sort, and heapsort. It discusses the time and space complexity of each algorithm, with merge sort having the best time complexity of O(n log n). Code examples and exercises are provided to help understand how each algorithm works. The goal is to help students learn common sorting techniques needed for coding interviews and problems.
The document describes Shellsort, a sorting algorithm developed by Donald Shell in 1959. It is an improvement on insertion sort. Shellsort works by sorting elements first with large gaps between elements, then reducing the gaps and sorting again until the final gap is 1, completing the sort. It takes advantage of insertion sort being most efficient on nearly sorted lists. The time complexity is O(n^r) for 1 < r < 2, better than O(n^2) of insertion sort but generally worse than O(n log n) of quicker algorithms.
Iterative structures, also known as loops, repeat sections of code and are used for tasks like calculating multiple values, computing iterative results, printing tables of data, and processing large amounts of input or array data. The three types of loops in C++ are the while loop, do-while loop, and for loop, each with different test conditions to control the loop execution. Loops can also be nested within each other to perform multiple iterations or to loop through multi-dimensional data structures.
This document discusses NP-complete problems and nondeterministic algorithms. It begins by introducing NP-completeness as evidence that many important problems cannot be solved quickly. It then defines different complexity classes like P, NP, NP-hard, and NP-complete. It provides examples of NP-complete problems like maximum clique and 0/1 knapsack. It also discusses how to show that a problem is NP-complete using polynomial-time reductions from another known NP-complete problem. In particular, it shows that the clique decision problem is NP-complete by reducing SAT to it.
NP completeness. Classes P and NP are two frequently studied classes of problems in computer science. Class P is the set of all problems that can be solved by a deterministic Turing machine in polynomial time.
The document discusses algorithms and their analysis. It begins with definitions of algorithms and describes their key properties including definiteness, finiteness, and effectiveness. It then discusses different ways to specify algorithms using natural language, flowcharts, or pseudo-code. Examples are provided to illustrate selection sort and the Towers of Hanoi problem solved recursively. The document concludes with analyzing the time and space complexity of algorithms.
CSMA/CD is a media access control method used in early Ethernet technology that uses carrier sensing to detect other signals while transmitting. It improves on CSMA by terminating transmission as soon as a collision is detected to shorten the time before resending. There are three types of CSMA protocols: 1-Persistent, Non-Persistent, and P-Persistent. CSMA/CD networks can detect collisions within twice the propagation delay allowing aborted collisions. It was used in older Ethernet variants and is still supported for backwards compatibility.
This document presents an algorithm design group project on algorithm analysis. It introduces key concepts like the definition of an algorithm, criteria algorithms must satisfy, pseudocode conventions, and asymptotic analysis. The group members are listed. Examples are provided to explain Big O, Omega, and Theta notation for analyzing the time complexity of algorithms like Fibonacci sequence. Randomized algorithms making random choices are also introduced.
The document introduces an algorithm design presentation by a group called Study 360属. It defines an algorithm and discusses criteria algorithms must satisfy like having clear instructions and terminating after a finite number of steps. It presents conventions for writing pseudocode and analyzes the time complexity of a Fibonacci algorithm using asymptotic notation like Big O(n), Omega(n), and Theta(n). Finally, it defines randomized algorithms as making random choices during runtime for potential benefits in speed, simplicity, or leading to deterministic algorithms.
Simulation-based optimization: Upper Confidence Tree and Direct Policy SearchOlivier Teytaud
油
The document discusses using simulations and algorithms to optimize power grids over different timescales:
1. Short term dispatching in real-time using human control
2. Combinatorial optimization over days/weeks
3. Stochastic hydroelectric optimization over years
4. Expensive multi-objective optimization of investment strategies over 50 years
It proposes using simulation-based optimization techniques like Upper Confidence Trees and Direct Policy Search to analyze simulations while allowing domain expertise to be incorporated through approximate policies. The goal is optimizing investments in power grids in Europe and North Africa over the next 50 years under different scenarios.
This document contains notes from a course on theory of computation taught by Professor Michael Sipser at MIT in Fall 2012. The notes were taken by Holden Lee and cover 25 lectures on topics including finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, decidability, and complexity theory. In particular, the notes summarize key definitions, theorems, and problems discussed in each lecture, with the overarching goal of understanding what types of problems can and cannot be solved by a computer.
This document summarizes key concepts in cryptography and number theory relevant to public key cryptography algorithms like RSA. It discusses number theoretic concepts like prime numbers, modular arithmetic, discrete logarithms, and one-way functions. It then provides an overview of the RSA algorithm, explaining how it uses the difficulty of factoring large numbers to enable secure public key encryption and digital signatures.
This document summarizes a class about making loops in Scheme. It recaps the Turing machine model and provides an example of a Turing machine that counts stars. It then introduces making loops in Scheme using a for procedure that takes an index, end value, and procedure as arguments. Examples are given to print numbers from 1 to 10 and to generate a multiplication table using nested for loops. The document also discusses tracing for to see how it works and introduces generalized while and accumulating loop procedures. It concludes by announcing assignments and due dates for Problem Set 4 and Exam 1.
Lecture 3 insertion sort and complexity analysisjayavignesh86
油
This document discusses algorithms and insertion sort. It begins by defining time complexity as the amount of computer time required by an algorithm to complete. Time complexity is measured by the number of basic operations like comparisons, not in physical time units. The document then discusses how to calculate time complexity by counting the number of times loops and statements are executed. It provides examples of calculating time complexities of O(n) for a simple for loop and O(n^2) for a nested for loop. Finally, it introduces insertion sort and divide-and-conquer algorithms.
The document discusses greedy algorithms for interval scheduling problems. It describes the interval scheduling problem of finding the maximum set of mutually compatible jobs that do not overlap in time. It presents the greedy algorithm of considering jobs in order of finishing time and scheduling each job if it is compatible with previously scheduled jobs. The algorithm runs in O(n log n) time and is proven to be optimal. The document also covers the related interval partitioning problem of scheduling lectures to minimize the number of classrooms needed.
APM People Interest Network Conference 2025
-Autonomy, Teams and Tension: Projects under stress
-Tim Lyons
-The neurological levels of
team-working: Harmony and tensions
With a background in projects spanning more than 40 years, Tim Lyons specialised in the delivery of large, complex, multi-disciplinary programmes for clients including Crossrail, Network Rail, ExxonMobil, Siemens and in patent development. His first career was in broadcasting, where he designed and built commercial radio station studios in Manchester, Cardiff and Bristol, also working as a presenter and programme producer. Tim now writes and presents extensively on matters relating to the human and neurological aspects of projects, including communication, ethics and coaching. He holds a Masters degree in NLP, is an NLP Master Practitioner and International Coach. He is the Deputy Lead for APMs People Interest Network.
Session | The Neurological Levels of Team-working: Harmony and Tensions
Understanding how teams really work at conscious and unconscious levels is critical to a harmonious workplace. This session uncovers what those levels are, how to use them to detect and avoid tensions and how to smooth the management of change by checking you have considered all of them.
Digital Tools with AI for e-Content Development.pptxDr. Sarita Anand
油
This ppt is useful for not only for B.Ed., M.Ed., M.A. (Education) or any other PG level students or Ph.D. scholars but also for the school, college and university teachers who are interested to prepare an e-content with AI for their students and others.
Database population in Odoo 18 - Odoo slidesCeline George
油
In this slide, well discuss the database population in Odoo 18. In Odoo, performance analysis of the source code is more important. Database population is one of the methods used to analyze the performance of our code.
How to Setup WhatsApp in Odoo 17 - Odoo 際際滷sCeline George
油
Integrate WhatsApp into Odoo using the WhatsApp Business API or third-party modules to enhance communication. This integration enables automated messaging and customer interaction management within Odoo 17.
The Constitution, Government and Law making bodies .saanidhyapatel09
油
This PowerPoint presentation provides an insightful overview of the Constitution, covering its key principles, features, and significance. It explains the fundamental rights, duties, structure of government, and the importance of constitutional law in governance. Ideal for students, educators, and anyone interested in understanding the foundation of a nations legal framework.
Finals of Kaun TALHA : a Travel, Architecture, Lifestyle, Heritage and Activism quiz, organized by Conquiztadors, the Quiz society of Sri Venkateswara College under their annual quizzing fest El Dorado 2025.
Mate, a short story by Kate Grenvile.pptxLiny Jenifer
油
A powerpoint presentation on the short story Mate by Kate Greenville. This presentation provides information on Kate Greenville, a character list, plot summary and critical analysis of the short story.
How to Configure Flexible Working Schedule in Odoo 18 EmployeeCeline George
油
In this slide, well discuss on how to configure flexible working schedule in Odoo 18 Employee module. In Odoo 18, the Employee module offers powerful tools to configure and manage flexible working schedules tailored to your organization's needs.
QuickBooks Desktop to QuickBooks Online How to Make the MoveTechSoup
油
If you use QuickBooks Desktop and are stressing about moving to QuickBooks Online, in this webinar, get your questions answered and learn tips and tricks to make the process easier for you.
Key Questions:
* When is the best time to make the shift to QuickBooks Online?
* Will my current version of QuickBooks Desktop stop working?
* I have a really old version of QuickBooks. What should I do?
* I run my payroll in QuickBooks Desktop now. How is that affected?
*Does it bring over all my historical data? Are there things that don't come over?
* What are the main differences between QuickBooks Desktop and QuickBooks Online?
* And more
QuickBooks Desktop to QuickBooks Online How to Make the MoveTechSoup
油
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