Basic Tips on Proofs

[Note: this webpage last modified Friday, 04-Feb-2011 19:44:51 EST]

Here I am collecting pointers/advice on mistakes that you have made that you should try to avoid in the future. I will put new comments here after each homework and exam.

Table of Contents

Things you should already know...

Here I will keep a list of things I think you should already know before starting this course. If you do not know remember these well, then you should review them. This list essentially corresponds to the most important topics from data structures (CS 202/258), discrete math (CS 303 / Math 320), algorithms (CS 458/558), and the first course in theory of computation (CS 420/520).

Initial pointers at beginning of semester

Many students do not have a lot of background giving proofs (especially in the context of computer science) when they begin this course. But, you will have plenty of experience by the time you are done with this course. In the meantime, here are some pointers on problems to avoid that I have seen so far.

  1. Proof by example. Giving small examples and showing that they work is nice for getting some intuition and understanding what is going on. But this is not a proof. If I ask you to prove an algorithm is correct, for example Dijkstra's shortest path algorithm, you need to prove it is correct for all graphs - not just for a few small graphs. If I ask you to prove that the number of binary strings with n bits is equal to 2n, you need to prove this for all n not just for a few small values of n.

    Proof by induction. Also, for a proof by induction, it is not good enough to show that a few small cases work. It is probably best if you review proof by induction, because there has been some confusion about this.

  2. Asymptotic big-O notation. If I ask you to prove some big-O estimate using the definition of big-O, then you need to carefully apply the definition of big-O. Remember that f(n) = O(g(n)) if there is a constant c such that f(n) ≤ c*g(n) for sufficiently large n, so for all n ≥ n0 for some constant n0. It can be that f(n) ≥ c*g(n) for small values of n, but eventually f(n) is less than c*g(n).

    In the calculations, some people assumed that they could "factor" like this: f(c*n) = c*f(n). But this is not true, for example if f(n) = n2.

  3. Running time of algorithms. We always measure the running time of algorithms as a function of the input length, the number of bits in the input, which we normally represent as n. If the input to a problem is a number N, then the length of the input n is the number of bits to represent N, so log(N). So if you calculate that the running time of the algorithm is N2, then as a function of the input length, this is 22n.

  4. Do not give extraneous information in your solutions. If I ask for the running time of some particular algorithm A, do not tell me what the running time of some other algorithm is that is not pertinent to the problem. For example, do not just copy things out of books or notes from your previous courses just to show me that you know something related to the problem. Just answer the question being asked as best you can.

Comments on Homework 1

After having graded the homework problems, here are some pointers and notes to keep in mind in the future. I am also leaving here clarifications I made before the assignment was due.

Comments on Homework 2

After having graded the homework problems, here are some pointers and notes to keep in mind in the future.

Comments on Homework 3

After having graded the homework problems, here are some pointers and notes to keep in mind in the future.

Comments on Homework 4

After having graded the homework problems, here are some pointers and notes to keep in mind in the future.

Comments on Homework 5

Comments on Homework 6

Comments on Homework 7

Comments on first exam