cs 121: introduction to theoretical computer science

33
CS 121: Introduction to Theoretical Computer Science Madhu Sudan Adam Hesterberg

Upload: others

Post on 08-Jan-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Madhu Sudan Adam Hesterberg
Madhu Sudan Adam Hesterberg
Book: https://introtcs.org
Today: 1. Agenda of the course: Power and limits of computation (15 min)
2. Break(out) (10min)
6. Gratis Advice (5 min)
Part 1: Power and limits of computation
Which of these computes?
Answer: But some have other uses
What problems can they solve?
Factoring numbers
Multiplying numbers
Virus/Spam detection?
Possible answers: A) Yes, Fast! B) Yes, but slow. C) No!
Remarkable facts about computers • Models vary in “expressiveness” • Some are easy to program – others are not!
• But not in “ability” (measured coarsely) • They all solve the same problem roughly in the same time (up to a constant
factor)
• For this course: • Fast = Polynomial time • Slow = not polynomial time (exponential, doubly exponential, tower) • Not solvable = no finite time!
In this course • We will define models of computing:
• Circuits • Finite Automata • Turing Machines = Computers
• Explore basic tasks they can solve • Addition, Multiplication, String operations
• See Universality • There is a single (universal) computer that can simulate every other computer.
• Prove their limits: • Circuits can only compute finite functions • Finite automata can not recognize palindromes • Computers can not determine if programs always halt • Computers can’t solve Travelling Salesperson?
O
NP - completeness Reductions
Ten minute Breakout Session Todos: 1) Get familiar with zoom breakout.
2) Discuss your goals for this course with your room partners 3) Submit answers on a form (link in chat)
Part 2: Administrivia
Grades: • 65% Exams • 15% Midterm 1 – 10/13/2020 • 20% Midterm 2 – 11/17/2020 • 30% Final – Scheduled by registrar?
• 30% Psets
- e -
Problem Sets/Collaboration • Six psets in the course. Schedule posted on homepage. http://madhu.seas.harvard.edu/courses/Fall2020/
• This is where your learning will really occur!!! • Work hard on them; understand the solutions (eventually); and you will do well
in the exams!
• Collaboration: • Allowed+encouraged when trying to solve the problems • Forbidden when writing solutions
• Inclusiveness: • When working in teams please be respectful of others. • Allow for differences due to gender, race, math/CS background, technology.
• Conversely: If I/Staff member is acting inappropriately, do not let it go uncorrected. Correct us/Complain to your resident dean.
Zoom Expectations • Video on/off?
• Definitely ON in OH, Sections. In lecture you are welcome to, but not required. I+Adam like seeing reactions live, but can only see ~25 of you.
• Lectures: • Will ask for a subset of you participate actively in each lecture. • Sign up sheet in chat. (Everyone signs up for at least one and at most 5 during term.) • Want at least 15 per lecture. Must come prepared. Try to ask questions. Make lecture interactive – good for all participants.
• Chat: Do use it for raising questions – someone will be monitoring. • Breakout sessions: Everyone should participate actively. Get familiar with
using them. You can always leave to return to main room; Can ask for help from staff from within.
• Participation: never judged for knowledge, but rather for intent
Break: Ask us anything!
Part 3: Algorithms (history, …)
391 times
0 for = 1… :
+ return
Input: , Operations:
for = :()#…1 + 10
return
Q: If , have digits, how many operations does each algorithm take?
Complexity of Multiplication • To multiply two digit numbers • Trivial algorithm: 10
• Grade School Multiplication:
• What is the fastest running time? Is addition harder than multiplication? • Answer: I don’t know!! … No one knows!!! • Why? Even if you think grade school algorithm is best
• Hard to prove NO algorithm does better … how do we eliminate all algorithm? • Sometimes very reasonable conjectures are wrong!!
• (… and it is hard to prove wrong statements. Hopefully impossible!)
strictly easier
Every algorithm to multiply digit numbers requires at least operations
Oh, really?
Andrei Kolmogorov Anatoly Karatsuba
Complexity of Multiplication • To multiply two digit numbers • Trivial algorithm: 10
• Grade School Multiplication:
• Harvey & van der Hoeven (2019): log
• Is this best possible? • Not known!!
Inverting multiplication: Integer factoring
Or smallest divisor
for = 2,… , : if divides then return
Q: If has digits, how many operations will trial division take?
Conjecture: Every algorithm to factor integers takes exponentially many operations.
For more general integer equations we can prove that there is no algorithm to solve them, no matter how many operations!
What this class tries to do: • Introduce you to other problems • Define models of computing • So that we can talk about all algorithms. • Prove limits when we can prove: • “Halting problem not computable”
• Talk about limits even when we can not prove: • E.g., factoring seems hard • Map coloring seems hard.
Part 4: Gratis advice
+ =
What’s hard about CS 121? Learning new concepts, using different kind of math.
Previously: You executed algorithms (multiply, solve equations, take derivatives,..)
In CS 121: We analyze and meta-analyze algorithms
Other hard things:
• Learning a second language • Mastering an instrument • Learning how to program • Playing competitive sports • Getting into Harvard… * CS 121.5
How to succeed in CS 121 • Come to lectures • Do the reading either before or after lectures (or both!) • Text: Introduction to Theoretical Computer Science : Boaz Barak
• http://madhu.seas.harvard.edu/courses/Fall2020/book.pdf
• Be active in discussion forum • Go to section • Start working on psets early. • Make sure you talk to someone if you are stuck.
What to do this week • Read Chapter 0 introduction and Chapter 1 Math background. • Do Homework Zero if you haven’t done so already. • Log in to discussion forum https://piazza.com/harvard/fall2020/cs121/home
• Bookmark https://madhu.seas.Harvard.edu/courses/Fall2020
Adam Hesterberg (co-instructor)
William Burke (Head TF)
Nari Johnson (Patel Fellow)
Joanna Boyland Diego Gutierrez
Sahana Srinivasan Alec Sun
Noah Singer (CS 121.5)
Ife Omidiran Zuzanna Skoczylas