cs 301
play

CS 301 Lecture 01 Introduction Stephen Checkoway January 17, 2018 - PowerPoint PPT Presentation

CS 301 Lecture 01 Introduction Stephen Checkoway January 17, 2018 1 / 49 What is CS 301 all about? This is a very mathematical course with a lot of practical applications The overarching theme is computation Three parts to the course 1


  1. CS 301 Lecture 01 – Introduction Stephen Checkoway January 17, 2018 1 / 49

  2. What is CS 301 all about? This is a very mathematical course with a lot of practical applications The overarching theme is computation Three parts to the course 1 Automata (singular is automaton) (8 weeks) 2 Computability (4 weeks) 3 Complexity (3 weeks) 2 / 49

  3. Computation I One main theme of this course is what can be computed and what can’t Which problems can be solved by computers and which can’t Here are some problems we can solve with computers • Sort a finite list • Check if an integer is prime • Draw some triangles on a screen • Determine the shortest path between two vertices (nodes) in a graph • Factor a polynomial • Never lose at tic-tac-toe • Never lose at checkers (solved in 2007 but took 18 years!) • . . . 3 / 49

  4. Computation II Everything you’ve learned in CS so far has been about solving problems When you see a new problem, you might think, “I know how to solve this problem”; or “I don’t know how to solve it right now, but I’m sure I can figure it out”; or maybe “Eventually, someone will figure out how to solve it” 4 / 49

  5. Computation II Everything you’ve learned in CS so far has been about solving problems When you see a new problem, you might think, “I know how to solve this problem”; or “I don’t know how to solve it right now, but I’m sure I can figure it out”; or maybe “Eventually, someone will figure out how to solve it” Here are some problems we know we can’t solve with computers • Given a computer program, will the program crash when run on some input? • Given two computer programs, do they compute the same answer when given the same input for all inputs? • Given a multivariable, polynomial equation, determine if it has a solution in integers • Find the cheapest airfare between two airports (this is surprisingly complicated) • Lots of problems in mathematics • . . . 4 / 49

  6. Decision problems In this course, we’re going to focus on problems whose answers are Yes/No (or True/False) These are decision problems Examples • Is an integer n even? • Does a directed graph G have a path of length n between vertices u and v ? • Does a program P crash when run on input x ? • Is x an element of a set S ? • Does a string s end with a repeated letter? 5 / 49

  7. Models of computation Real computers are frighteningly complex They are much too complicated to reason about Instead, we’re going to focus on simpler models of computation Finite automaton used in text-processing and compilers Context-free grammar used in programming languages and compilers Turing machines equivalent in power to general purpose computers The models are progressively more powerful; they let us solve more problems 6 / 49

  8. Administrivia Two sections of CS 301 this semester Monday, Wednesday at 16:00 – Prof. Stephen Checkoway Monday, Wednesday, Friday at 12:30 – Prof. Gonzalo Bello-Lander Six discussion sections on Wednesday, you must be registered for one Course web page: https://www.cs.uic.edu/~s/teaching/cs301/2018-spring/ Textbook: Michael Sipser’s Introduction to the Theory of Computation 3rd. edition Piazza: All communication with course staff must be done via Piazza unless you have been explicitly instructed otherwise 7 / 49

  9. Grades • Two midterm exams (30%) • Final exam (20%) • Six homework assignments (30%) • Weekly labs (10%) • Weekly blackboard quizzes (10%) 8 / 49

  10. Labs and quizzes Each week (starting next week), there is a lab assignment to be completed during discussion section Additionally, each week (again, starting next week), there is a quiz on Blackboard consisting of multiple choice questions Together, these are worth 20% of your grade, so be sure to do them! 9 / 49

  11. Late policy Assignments can be turned in up to 24 hours late for a 25% penalty. 10 / 49

  12. Homework policy You may collaborate with other students in the class on the homework You must write up your solutions entirely on your own! Your write up must be typeset, not hand written I strongly encourage you to use L A T EX, but you’re free to use other tools See the course web page for L A T EX resources and examples 11 / 49

  13. Academic misconduct policy Academic misconduct is taken very seriously All incidents will be reported to the Dean of Students Penalties range from a 0 on an assignment to failing the course In egregious cases, expulsion from UIC possible (and has happened in CS 301 before) Academic misconduct includes (but is not limited to) • Using someone else’s solutions as your own • Searching the Internet for solutions to homework • Copying answers on tests • Showing someone else your solutions on tests • Deceiving course staff (e.g., giving a false excuse for missing a deadline) • Using material for exams that hasn’t been explicitly authorized (e.g., the book, notes, slide print outs) 12 / 49

  14. Sets I A set is a collection of objects (numbers, symbols, other sets, anything) The objects in the set are the elements or members E.g., S = { 2 , 3 , 5 , 7 , 11 } is a 4-element set We use ∈ and ∉ to denote set membership and nonmembership 5 ∈ S and 9 ∉ S Common sets: The empty set is written ∅ The set of natural numbers is written N = { 1 , 2 , . . . } The set of integers is written Z = { . . . , − 2 , − 1 , 0 , 1 , 2 , . . . } The set of rational numbers is written Q The set of real numbers is written R 13 / 49

  15. Sets II We can define sets by giving rules for sets Primes = { x ∣ x is a prime number } Odds = { 2 x + 1 ∣ x ∈ Z } T = { n ∣ n = m 2 for some m ∈ N } Set A is a subset of B (written S ⊆ B ) if every element of A is an element of B Set A is a proper subset of B (written S ⊊ B ) if A ⊆ B and A ≠ B 14 / 49

  16. Set operations Union A ∪ B = { x ∣ x ∈ A or x ∈ B } ; elements of either A or B 15 / 49

  17. Set operations Union A ∪ B = { x ∣ x ∈ A or x ∈ B } ; elements of either A or B Intersection A ∩ B = { x ∣ x ∈ A and x ∈ B } ; elements of both A and B 15 / 49

  18. Set operations Union A ∪ B = { x ∣ x ∈ A or x ∈ B } ; elements of either A or B Intersection A ∩ B = { x ∣ x ∈ A and x ∈ B } ; elements of both A and B Complement A = A ∁ = { x ∣ x ∉ A } ; elements not in A 15 / 49

  19. Set operations Union A ∪ B = { x ∣ x ∈ A or x ∈ B } ; elements of either A or B Intersection A ∩ B = { x ∣ x ∈ A and x ∈ B } ; elements of both A and B Complement A = A ∁ = { x ∣ x ∉ A } ; elements not in A Difference A ∖ B = { x ∣ x ∈ A and x ∉ B } = A ∩ B ; elements of A but not B 15 / 49

  20. Set operations Union A ∪ B = { x ∣ x ∈ A or x ∈ B } ; elements of either A or B Intersection A ∩ B = { x ∣ x ∈ A and x ∈ B } ; elements of both A and B Complement A = A ∁ = { x ∣ x ∉ A } ; elements not in A Difference A ∖ B = { x ∣ x ∈ A and x ∉ B } = A ∩ B ; elements of A but not B Power set P ( A ) = { S ∣ S ⊆ A } ; set of subsets of A 15 / 49

  21. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } 16 / 49

  22. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = 16 / 49

  23. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } 16 / 49

  24. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = 16 / 49

  25. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } 16 / 49

  26. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = 16 / 49

  27. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } 16 / 49

  28. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = 16 / 49

  29. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = ∅ 16 / 49

  30. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = ∅ A ∖ B = 16 / 49

  31. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = ∅ A ∖ B = { 0 , 1 , 3 } 16 / 49

  32. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = ∅ A ∖ B = { 0 , 1 , 3 } P ( A ∖ B ) = 16 / 49

  33. Set examples A = { 0 , 1 , 2 , 3 , 4 } B = { 2 , 4 , 5 } C = { 3 x ∣ x ∈ Z } A ∪ B = { 0 , 1 , 2 , 3 , 4 , 5 } A ∩ B = { 2 , 4 } A ∩ C = { 0 , 3 } B ∩ C = ∅ A ∖ B = { 0 , 1 , 3 } P ( A ∖ B ) = { ∅ , { 0 } , { 1 } , { 3 } , { 0 , 1 } , { 0 , 3 } , { 1 , 3 } , { 0 , 1 , 3 }} 16 / 49

Recommend


More recommend