CS Theory COMS 3261 Allison Bishop Lecture 1
CS Theory COMS 3261 Allison Bishop Lecture 1
So what is this course about? Abstract models of computation • Learning what can/cannot be computed and why • Gaining intuition for what makes a computational problem expensive vs. cheap in terms of the resources required • Learning about the relationships between computational problems and models • Learning how to reason systematically about complex systems and how to write insightful proofs
Logistics • Syllabus available on courseworks and on my personal webpage: https: //www. thecomputersciencecomedian. com/teaching/ • My office hours: Wednesdays 8: 30 pm – 9: 30 pm, Fridays 4: 45 pm- 5: 45 pm (my office hours will start next week). TAs and their office hours announced shortly • My email: allison@cs. columbia. edu • My office location: in the CSB building, a cubicle on the right across from CSB 455. Sign with my name will be displayed outside it.
My Background (Aka why I’m not available for meetings during regular business hours) • I am a part-time professor. I work here on Monday/Wednesday/Friday evenings and often on weekends. • I am a co-founder of Proof Trading, a US equities broker-dealer. • I formerly was a quantitative researcher at IEX, the newest US stock exchange • I was formerly a full-time professor and I still do research in CS theory, specifically cryptography.
Grading • 40% homework assignments • 30% short in-class quizzes • 30% final exam • The dates of the 6 in-class quizzes are on the Syllabus!! The lowest 2 quiz scores will be dropped. • There will be 4 homeworks, announced on courseworks as they are assigned. The lowest homework score will be dropped.
Class Policies • Late homework: penalized by 10 pts (out of 100) for every day late. A partial day late is rounded up to a whole day. • You may collaborate freely with your classmates in discussing homework. But when you write out your solutions, you must do it alone in your own words. • You are highly encouraged to come to office hours (both mine and the TAs!) • There is assigned reading for the class that is listed on the syllabus.
Class Policies • Homework grades will only be adjusted after the fact in obvious circumstances – e. g. your points were mis-added, a page of your assignment was missed, etc. All such adjustments must go through me rather than the TAs. Sample solutions will be provided to help you understand what was expected, and you may discuss with the TAs to understand why they took off points, but know that they are not allowed to re-litigate partial credit decisions and the purpose of such conversations should be so you can avoid similar issues on the next assignment. • Clarity of your homework is part of what’s being graded, not just correctness. • Before the final exam, a sample exam and sample solutions will be provided to help you study.
What we are going to do today • Crash course on proof techniques. • Next week we’ll start with the actual models of computation.
Proof Technique 1 – Contradiction Claim: There are infinitely many prime numbers. Recall: a positive integer >1 is prime if its only factors are itself and 1. We start by assuming this is false, i. e. there are only finitely many primes. This would mean we could list them all on a finite list. Imagine what would happen if we multiplied all of them together and added 1:
2311
Adding 1: 2 4 6 Multiples of 2 8
Not a multiple of 2, 3, 5, 7, or 11! 2311
By multiplying all of the finitely many primes together and adding 1, we get a new positive integer that can’t be divisible by any of the primes on our list! By the definition of primes: The new number must be a prime itself or divisible by some primes Hence we have a contradiction: our list of all primes cannot be complete! Therefore there are infinitely many prime numbers. �
Proof Technique 2 - Induction proofs are often used to prove statements that are supposed to hold for all positive integers. They have a base case(s) and an induction step. Base case: show the statement holds for some particular value(s), usually the smallest possible value (or sometimes the largest possible value). Induction step: show that if the statement holds for a certain value, it holds for that value +1 (or for that value – 1, as the case may be).
Induction example
Induction example
Note: there are often many ways to prove the same claim • *Be careful with arguments like this that you don’t say something invalid for weird edge cases like n = 0 or n=1!
An induction gone wrong Claim: All horses are the same color. So what’s wrong with this? ? Base case: 1 horse is the same color as itself. � Inductive step: Assume any n horses are the same color. Now Consider n+1 horses. Remove one. Now you have n horses that are the same color. Put the missing horse back. Remove a different horse. Now you have n horses that are the same color. Thus, it must be the case that all n+1 horses are actually the same color. �
Proof Technique 3 - Construction Consider an array containing N positive integers, with a pointer at the first element: 6 8 5 7 10 22 47 3 Let’s define a single “step” as reading the integer in the current location, doing arbitrary computation, Then moving the pointer one place to the left or one place to the right. Claim: The maximum integer value in the array can be found in N steps. We’ll prove this by constructing a sequence of N steps that is guaranteed to find the maximum value.
Proof Technique 3 - Construction Claim: The maximum integer value in the array can be found in N steps. 6 8 5 7 10 22 47 3 Initialize an integer variable X = 6. For each step: Test the current value against X. If it is greater than X, Set X to the new greater value. Move the pointer one place to the right. After N steps, X will contain the maximum value in the array.
Proof Technique 4 - Reduction Now consider an array containing N negative integers, with a pointer at the first element: -5 -1 -18 -7 -5 -16 -4 -2 Claim: The minimum integer value in the array can be found in N steps. We’ve already shown this for the max of positive integers. The minimum of negative integers = the max of the positive integers formed by multiplying by -1 So we can apply our previous solution if we multiply each negative integer by -1 upon reading it.
More Flavors of Reduction Techniques • Reduction is about taking a new problem and turning it into an instance or instances of a different problem that is already solved, or at least easier to solve. • Sometimes you will reduce a problem to a smaller version of itself (recursion) • Sometimes you will reduce a problem to a number of other problems, not just one.
Proof Structure – Designing a proof • Deconstructing a big mysterious claim into a sequence of smaller, more digestible claims • Building upon the right definitions and units *Note that this is a lot like programming, where having the right modular design of methods/classes/objects etc. is key.
Non-proof techniques: • Exhaustion “if I write 5 pages, the answer must be in there somewhere” • Assumption “I’ll just assume that non-obvious, complicated statement X is true” • Leap of Faith “I can still write ‘It follows that’ when I have no idea why the next thing is true • By Example “If I’m supposed to prove it for every n, it’s ok to just prove it for n=2” • Reference (without including the necessary modifications explicitly) “This is like the proof we did in class in lecture 5, I mean, not exactly, but close enough, right? ”
The most important thing about proofs: • Doing them correctly all the time? Learning from our mistakes!! A mistake in a proof is an opportunity to examine a deeply held assumption In our thinking that we may have never examined before. This is how we go from student to scientist. Don’t be ashamed of your mistakes. Collect them as trophies! They are testaments to your growth and the foundation of your future successes. So write your answers clearly enough that your mistakes can be easily found! It may feel annoying now when you lose points, but In the long term it will serve you well. You will lose points the same points for vagueness too, but that will be much less helpful to you.
- Slides: 26