Homework 1

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

This homework assignment is due before class starts on Tuesday, January 25. Your solutions should be explained in complete sentences such that your classmates will understand the solution (and can verify your proofs are correct) even if they have not solved the problems themselves.

  1. HW Polices.

    1. Type your HW (in word, latex, text file, etc.) and send to me by email.

    2. Do NOT share electronically. You must type your own solutions. You can discuss the problems with each other, but you may only discuss them. You may not write out solutions together.

    3. You MAY NOT search the Internet, textbooks, etc. for solutions to the problems. The following are the ONLY sources of information that you may use in solving the problems: the textbook for this course, wikipedia articles on basic math/probability/etc., and mathematical review material at the following MIT opencourseware page: 6.042J / 18.062J Mathematics for Computer Science, Fall 2005. You may discuss the problems with each other and with myself, but must obey the previous item in doing so.

      If you do find the solution in one of these three sources, you still MUST cite the source in your document.

      You may use NOTHING ELSE that is online or other textbooks.

    4. You MAY NOT copy word-for-word from any source, even the three you are allowed to consult. If you feel it is necessary, you should put the quotation in quotes and provide a reference/citation.

  2. (-2 points if left blank) List who you collaborated with on this assignment, "none" if none.

  3. (5 Points) Let L be the language of Turing machines M such that M accepts all inputs with even parity and rejects all inputs with odd parity. Show that if you could solve this problem, then you could solve the halting problem. That is, suppose you had an algorithm A that solves L. Now, given a Turing machine M and input x to M as input, show how you can use A to determine if M(x) halts or not. Because we know the halting problem is undecidable, this will show that L is undecidable.

  4. (2 Points) Let L' be the language of pairs (M, x, t) such that M(x) runs in time t and accepts if x has even parity and rejects if x has odd parity. Give pseudocode for solving this problem, and give a big-O estimate for the running time.

  5. (3 Points) Let L'' be the language of pairs (M, p, t) such that M runs in time t and for all inputs x of length p, M(x) accepts if x has even parity and rejects if x has odd parity. Give pseudocode for solving this problem, and give a big-O estimate for the running time.

  6. (Extra credit, 1 point) Choose your favorite programming language and implement the algorithm for testing connectivity that was given in the last class. You can use an adjancency matrix representation of the graph, so an n-vertex graph is represented by a n x n matrix that has 0's and 1's. You can let the graph be directed or undirected, whichever you like. You should have the program solve the problem in general, and also have a few small examples in the program that test it.