Algorithms & Models of Computation CS/ECE 374, Fall 2017 CS 374: Algorithms & Models of Computation Administrivia, Introduction Sariel Har-Peled Lecture 1 University of Illinois, Urbana-Champaign Tuesday, August 29, 2017 Fall 2017 Sariel Har-Peled (UIUC) CS374 1 Fall 2017 1 / 26 Sariel Har-Peled (UIUC) CS374 2 Fall 2017 2 / 26 Instructional Staff Instructor: Sariel Har-Peled 1 10 9 students. 2 Part I 9 Teaching Assistants 3 16 Undergraduate Course Assistants 4 Office hours: See course webpage 5 Administrivia Contacting us: Use private notes on Piazza to reach course staff. 6 Direct email only for sensitive or confidential information. Sariel Har-Peled (UIUC) CS374 3 Fall 2017 3 / 26 Sariel Har-Peled (UIUC) CS374 4 Fall 2017 4 / 26
Online resources Prereqs and Resources Webpage: General information, announcements, homeworks, Prerequisites: CS 173 (discrete math), CS 225 (data structures) 1 1 course policies Recommended books: (not required) 2 http://courses.engr.illinois.edu/cs374/fa2017/ Introduction to Theory of Computation by Sipser 1 Gradescope: Homework submission and grading, regrade Introduction to Automata, Languages and Computation by 2 2 Hopcroft, Motwani, Ullman requests Algorithms by Dasgupta, Papadimitriou & Vazirani. 3 Moodle: Quizzes, solutions to homeworks, grades 3 Available online for free! Piazza: Announcements, online questions and discussion, 4 Algorithm Design by Kleinberg & Tardos 4 contacting course staff (via private notes) Lecture notes/slides/pointers: available on course web-page 3 See course webpage for links Additional References 4 Lecture notes of Jeff Erickson, Sariel Har-Peled , Mahesh Viswanathan 1 Important: check Piazza at least once each day. and others Introduction to Algorithms: 2 Cormen, Leiserson, Rivest, Stein. Computers and Intractability: Garey and Johnson. 3 Sariel Har-Peled (UIUC) CS374 5 Fall 2017 5 / 26 Sariel Har-Peled (UIUC) CS374 6 Fall 2017 6 / 26 Grading Policy: Overview Homeworks Quizzes: 0% for self-study Self-study quizzes each week on Moodle . No credit but strongly 1 1 recommended. Homeworks: 28% 2 One homework every week: Due on Wednesdays at 10am on 2 Midterm exams: 42% ( 2 × 21% ) 3 Gradescope . Assigned at least a week in advance. Final exam: 30% (covers the full course content) 4 Homeworks can be worked on in groups of up to 3 and each 3 Midterm exam dates: group submits one written solution (except Homework 0). Midterm 1: Monday October 2, 7-9pm. 1 Important: academic integrity policies. See course web page. 4 Midterm 2: Monday November 13: 7-9pm. 2 No conflict exam offered unless you have a valid excuse. Sariel Har-Peled (UIUC) CS374 7 Fall 2017 7 / 26 Sariel Har-Peled (UIUC) CS374 8 Fall 2017 8 / 26
More on Homeworks Discussion Sessions/Labs No extensions or late homeworks accepted. 50min problem solving session led by TAs 1 1 To compensate, nine problems will be dropped. Homeworks Two times a week 2 2 typically have three problems each. Go to your assigned discussion section 3 Important: Read homework FAQ/instructions on website. 3 Bring pen and paper! 4 Sariel Har-Peled (UIUC) CS374 9 Fall 2017 9 / 26 Sariel Har-Peled (UIUC) CS374 10 Fall 2017 10 / 26 Advice Homework 0 Attend lectures, please ask plenty of questions. HW 0 is posted on the class website. Quiz 0 available on 1 1 Moodle. Attend discussion sessions. 2 HW 0 due Wednesday, September 6, 2017 at 10am on 2 Don’t skip homework and don’t copy homework solutions. Each 3 Gradescope. of you should think about all the problems on the home work - do not divide and conquer. Groups of size up to 3. 3 Use pen and paper since that is what you will do in exams which 4 count for 75% of the grade. Keep a note book. Study regularly and keep up with the course. 5 This is a course on problem solving. Solve as many as you can! 6 Books/notes have plenty. This is also a course on providing rigorous proofs of correctness. 7 Refresh your 173 background on proofs. Ask for help promptly. Make use of office hours/Piazza. 8 Sariel Har-Peled (UIUC) CS374 11 Fall 2017 11 / 26 Sariel Har-Peled (UIUC) CS374 12 Fall 2017 12 / 26
Miscellaneous Please contact instructors if you need special accommodations. Lectures are being taped. See course webpage. Part II Course Goals and Overview Sariel Har-Peled (UIUC) CS374 13 Fall 2017 13 / 26 Sariel Har-Peled (UIUC) CS374 14 Fall 2017 14 / 26 High-Level Questions Course Structure Course divided into three parts: Modeling: States/Graphs/Recursion/Algorithms. 1 Basic automata theory: finite state machines, regular languages, 1 Algorithms 2 hint of context free languages/grammars, Turing Machines What is an algorithm? 1 Algorithms and algorithm design techniques 2 What is an efficient algorithm? 2 Some fundamental algorithms for basic problems Undecidability and NP-Completeness, reductions to prove 3 3 Broadly applicable techniques in algorithm design intractability of problems 4 What is a mathematical definition of a computer? 3 Is there a formal definition? 1 Is there a “universal” computer? 2 What can computers compute? 4 Are there tasks that our computers cannot do? 1 Sariel Har-Peled (UIUC) CS374 15 Fall 2017 15 / 26 Sariel Har-Peled (UIUC) CS374 16 Fall 2017 16 / 26
Goals Historical motivation for computing Fast (and automated) numerical calculations 1 1 Learn/remember some basic tricks, algorithms, problems, ideas Automating mathematical theorem proving 2 2 Understand/appreciate limits of computation (intractability) 3 Appreciate the importance of algorithms in computer science 4 and beyond (engineering, mathematics, natural sciences, social sciences, ...) Sariel Har-Peled (UIUC) CS374 17 Fall 2017 17 / 26 Sariel Har-Peled (UIUC) CS374 18 Fall 2017 18 / 26 Models of Computation vs Computers Adding Numbers Model of Computation: an “idealized mathematical construct” Problem Given two n -digit numbers x and y , compute their sum. 1 that describes the primitive instructions and other details Basic addition Computer: an actual “physical device” that implements a very 2 specific model of computation 3141 +7798 Models and devices: 10939 Algorithms: usually at a high level in a model 1 Device construction: usually at a low level 2 Intermediaries: compilers 3 How precise? Depends on the problem! 4 Physics helps implement a model of computer 5 Physics also inspires models of computation 6 Sariel Har-Peled (UIUC) CS374 19 Fall 2017 19 / 26 Sariel Har-Peled (UIUC) CS374 20 Fall 2017 20 / 26
Adding Numbers Multiplying Numbers c = 0 Problem Given two n -digit numbers x and y , compute their for i = 1 to n do product. z = x i + y i z = z + c Grade School Multiplication If ( z > 10 ) c = 1 Compute “partial product” by multiplying each digit of y with x and z = z − 10 (equivalently the last digit of z ) adding the partial products. Else c = 0 print z 3141 End For × 2718 If ( c == 1) print c 25128 Primitive instruction is addition of two digits 3141 1 21987 Algorithm requires O ( n ) primitive instructions 2 6282 8537238 Sariel Har-Peled (UIUC) CS374 21 Fall 2017 21 / 26 Sariel Har-Peled (UIUC) CS374 22 Fall 2017 22 / 26 Time analysis of grade school multiplication Fast Multiplication Best known algorithm: O ( n log n · 2 O (log ∗ n ) ) time [Furer 2008] Each partial product: Θ( n ) time 1 Number of partial products: ≤ n 2 Previous best time: O ( n log n log log n ) [Schonhage-Strassen 1971] Adding partial products: n additions each Θ( n ) (Why?) 3 Total time: Θ( n 2 ) Conjecture: there exists an O ( n log n ) time algorithm 4 Is there a faster way? 5 We don’t fully understand multiplication! Computation and algorithm design is non-trivial! Sariel Har-Peled (UIUC) CS374 23 Fall 2017 23 / 26 Sariel Har-Peled (UIUC) CS374 24 Fall 2017 24 / 26
Post Correspondence Problem Halting Problem Given: Dominoes, each with a top-word and a bottom-word. Debugging problem: Given a program M and string x , does M halt when started on input x ? b ba abb abb a Simpler problem: Given a program M , does M halt when it is bbb bbb a baa ab started? Equivalently, will it print “Hello World”? Can one arrange them, using any number of copies of each type, so One can prove that there is no algorithm for the above two problems! that the top and bottom strings are equal? abb ba abb a abb b a bbb a ab baa bbb Sariel Har-Peled (UIUC) CS374 25 Fall 2017 25 / 26 Sariel Har-Peled (UIUC) CS374 26 Fall 2017 26 / 26
Recommend
More recommend