Efficient Computation in CS 121 Lecture 17 - P. Madhu Sudan

cs 121 lecture 17 efficient computation p n.w
1 / 22
Embed
Share

Explore the concepts of efficient computation in CS 121 Lecture 17 with P. Madhu Sudan. Topics include time complexity, classes like P and EXP, Turing machines, running time definitions, circuit efficiency, and more. Dive into the world of quantitative and qualitative studies in computer science. Learn about the different computation models and their applications in solving complex problems efficiently.

  • Computation
  • CS 121
  • Efficiency
  • Time Complexity
  • P. Madhu Sudan

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. CS 121: Lecture 17 Efficient Computation: P Madhu Sudan https://madhu.seas.Harvard.edu/courses/Fall2020 Book: https://introtcs.org { The whole staff (faster response): CS 121 Piazza How to contact us Only the course heads (slower): cs121.fall2020.course.heads@gmail.com

  2. Announcements: 121.5: Bjorn Poonen: Uncomputability in Number Theory Why is ?3+ ?3+ ?3= 33 an unsolved equation (over )? Sections: Week 8 cycle start, material on canvas (as usual). Homework 4 due today. Homework 5 out. Due in 14 days. Make sure to vote. (Lecture absence excused but must catch up !!)

  3. Where we are: Part I: Circuits: Finite computation, quantitative study Part II: Automata: Infinite restricted computation, quantitative study Part III: Turing Machines: Infinite computation, qualitative study Part IV: Efficient Computation: Infinite computation, quantitative study Part V: Randomized computation: Extending studies to non-classical algorithms

  4. Review of course so far Circuits: 2? ?. Some functions require this (by Compute every finite function, with size ? counting). Compute no infinite function. Finite Automata: Compute some infinite functions. Do not compute a lot. Pumping Lemma (Pigeonhole Principle.) Turing Machines: Compute everything computable! (By definition? By thesis? By lack of evidence to the contrary) There exist uncomputable functions: HALT Rice

  5. Today Defining Running Time Time Complexity Classes: P and EXP TM RAM time Time efficient Universal Simulation + Time Hierarchy Theorem Extended Turing-Church Thesis Efficiency for Circuits: P/poly

  6. Running time Time = #TM State Transitions. Defn: ?: 0,1 0,1 is computable in time ?(?) if there exists a TM ?? that on every input ? 0,1 , halts after at most ? ? transitions and with output ?(?) on tape. Best algorithm + Worst input

  7. Running time Time = #TM State Transitions. Defn: ?: 0,1 0,1 is computable in time ?(?) if there exists a TM ?? that on every input ? 0,1 , halts after at most ? ? transitions and with output ?(?) on tape. Best algorithm + Worst input Do conventions matter? YES: E.g., F(x) = 0 : Time complexity depends on output convention NO: Same up to additive factor of ? ? + |? ? | Does TM type matter? #tapes? #heads? YES: E.g., Palindrome? NO: But only up to polynomial factors. ? computable in time ?(?) with k-tape machine ?computable in time ? ? ?2with our (standard) model.

  8. RAM Model + Time Common model for algorithm analysis: RAM model + Time. RAM Model: Deals with word -sized integers in 1 step. (? + ?, ? ?, ?[?]) Has built in arrays and allows random access . Run time ????(?) measures # RAM operations Usual algorithm run times stated in this model Sorting ? words takes ? ?log?time Palindrome detection takes ?(?)time Theorem: ???? ? ? ????RAM(? ? ? Food for thought: Is ? = ?RAM? Is ??? = ???RAM? ???? ? ? ?4

  9. Time Hierarchy Theorem Recall Size Hierarchy Theorem for circuits. If ?1(?) sufficiently smaller than ?2? sufficiently smaller than 2?/? Then ???? ?1? ???? ?2? More is more Theorem (13.9): For nice functions ?(?), ????RAM? ? Corollaries: ???? ? ? ???? ? ? log?4 ? ??? ????RAM? ? log?

  10. Proof of Time Hierarchy Theorem Two ingredients: Timed Universal Turing Machine (Timed RAM Algorithm): Diagonalization Timed Universal Turing Machine: Let TIMEDEVAL ?,?,1?= 1 ? halts in ? steps on ? and outputs 1 Theorem: TIMEDEVAL computable in time ? ?? ? on RAM. Proof omitted. Corollary: TIMEDEVAL computable in time ? ?4 on some TM! This is the Timed Universal TM .

  11. Proof of Time Hierarchy Theorem Timed Universal Turing Machine: Let TIMEDEVAL ?,?,1?= 1 ? halts in ? steps on ? and outputs 1 Theorem: TIMEDEVAL computable in time ? ?? ? on RAM. Corollary: TIMEDEVAL computable in time ? ?4 on some TM! Two ingredients: Timed Universal Turing Machine (Timed RAM Algorithm): Diagonalization Diagonalization: CANTOR??,? = TIMEDEVAL ?, ?,? ,1? log log ? if ? logloglog|?| Claim 1: CANTOR? computable in time ? ?log ? on RAM Claim 2: CANTOR? not computable in time ? ? on RAM Proof: Suppose ??????? computes it in ? ? time. Then for sufficiently long |?| ??????????????,? = TIMEDEVAL ???????, ???????,? ,1? log log ?= ??????????????,? In the text: HALT??,? = 1 iff ? halts in ? steps on input ?

  12. Break: Think about CANTOR ??????????????,? = TIMEDEVAL ???????, ???????,? ,1? log log ?= ??????????????,? CANTOR??,? = TIMEDEVAL ?, ?,? ,1? log log ? if ? logloglog ? Claim 1: CANTOR? computable in time ? ?log ? on RAM Claim 2: CANTOR? not computable in time ? ? on RAM Proof: Suppose ??????? computes it in ? ? time. Then for sufficiently long ? What is ? doing? Why do we have the T.log log x? Why ? logloglog? ?

  13. Solution to Break: Think about CANTOR ??????????????,? = TIMEDEVAL ???????, ???????,? ,1? log log ?= ??????????????,? CANTOR??,? = TIMEDEVAL ?, ?,? ,1? log log ? if ? logloglog ? Claim 1: CANTOR? computable in time ? ?log ? on RAM Claim 2: CANTOR? not computable in time ? ? on RAM Proof: Suppose ??????? computes it in ? ? time. Then for sufficiently long ? What is ? doing? (Need long inputs to make algorithms fail!) Why do we have the T.log log x? Need to give TIMEDEVAL C.T time for arbitrarily large C. (or else final equality need not hold). Do it by giving it T.log log x time! Why ? logloglog? ? May need ?( ?? ?) time to universally simulate ? for T steps so needed for Claim 1.

  14. Complexity Classes: P and EXP Important: Classes always focus on Boolean Problems!!!! Definition: ??: 0,1 0,1 is in ? if ?? computable in time ?(??) for some constant ?. Definition: ??: 0,1 0,1 is in ??? if ?? computable in time 2? ?? for some constant ? Definition: ???? ? ? = ??: 0,1 0,1 ?? computable in time ?(?) Note: Conventions+Models don t matter for ?,???! ? ???(why?)

  15. Boolean Problems Recall: May want to compute ?: 0,1 0,1 But complexity captured by ??: 0,1 0,1 {0,1} ?? ?,? ? ?? ? computable in time ? ? ?? computable in time ? ? ? ?? computable in time ? ? ? computable in time ? ? ? ? (? = output length) ? computable in time ? ? ?2 ? polynomial time computable ?? ? ? exponential time computable ?? ??? Exercise: Define the Factoring problem. What does BFactoring look like?

  16. Time Hierarchy Theorem Recall Size Hierarchy Theorem for circuits. If ?1(?) sufficiently smaller than ?2? sufficiently smaller than 2?/? Then ???? ?1? ???? ?2? More is more Theorem (13.9): For nice functions ?(?), ????RAM? ? Corollaries: ???? ? ? ???? ? ? log?4 ? ??? ????RAM? ? log?

  17. Proof of Time Hierarchy Theorem Two ingredients: Timed Universal Turing Machine (Timed RAM Algorithm): Diagonalization Timed Universal Turing Machine: Let TIMEDEVAL ?,?,1?= 1 ? halts in ? steps on ? and outputs 1 Theorem: TIMEDEVAL computable in time ? ?? ? on RAM. Proof omitted. Corollary: TIMEDEVAL computable in time ? ?4 on some TM! This is the Timed Universal TM .

  18. Proof of Time Hierarchy Theorem Timed Universal Turing Machine: Let TIMEDEVAL ?,?,1?= 1 ? halts in ? steps on ? and outputs 1 Theorem: TIMEDEVAL computable in time ? ?? ? on RAM. Corollary: TIMEDEVAL computable in time ? ?4 on some TM! Two ingredients: Timed Universal Turing Machine (Timed RAM Algorithm): Diagonalization Diagonalization: CANTOR??,? = TIMEDEVAL ?, ?,? ,1? log log ? if ? logloglog|?| Claim 1: CANTOR? computable in time ? ?log ? on RAM Claim 1: CANTOR? not computable in time ? ? on RAM Proof: Suppose ??????? computes it in ? ? time. Then for sufficiently long |?| ??????????????,? = TIMEDEVAL ???????, ???????,? ,1? log log ?= ??????????????,? In the text: HALT??,? = 1 iff ? halts in ? steps on input ?

  19. ???? vs. ???? Given ?: 0,1 0,1 can get ? , where ??? = ? ? ? 0,1? ??: 0,1? 0,1 Definition: ? ?/???? if ? s.t. ? ?? ???? ??? Theorem (13.12): ? ?/???? Fast algorithms small circuits.

  20. Extended Turing-Church Thesis Vanilla Thesis: Everything computable by physical means is computable by Turing Machine. Extended Thesis: Everything computable by physical means in ? time is computable by Turing Machine in ?(??) time Mostly uncontested: Two live challengers: Randomized computation (believed not stronger) Quantum computation (believed stronger?)

  21. Philosophical aside: Importance of P Mathematically nice: Robust to models. Captures intuitive sense of solving by understanding (as opposed to brute force ) Problem is in ? iff we understand the problem? Seems to hold for most problems we study Captures feasibility fairly well in practice Is ?100 practical? But are there practical problems for which we have an ?100 solution!

  22. Summary of Lecture: Introduced time complexity (RAM and TM). Should know both exist and are closely related. No need to know proofs. TIME Hierarchy theorem: Uses Universal TM. (No need to know construction) Diagonalization (Must know proof!) Complexity classes?and ??? Mentions: No (need to know) proofs SIZE vs TIME: ?/???? Extended Turing-Church Thesis Importance of P

Related


More Related Content