CS 3133, A Term 1998
Foundations of Computer Science
Homework 4 (due Oct. 6)

This page is located at http://www.cs.wpi.edu/~alvarez/CS3133/HW4.html

Instructions

Do the problems listed below. State problems completely as part of your solutions. Give a brief explanation of your solution strategy for each problem. Your solutions should be legible and coherent. Your arguments should be sufficiently clear and airtight so as to convince any skeptical but reasonable jury. Solutions should be written on only one side of each sheet of paper. Separate sheets should be stapled together.


Problems

  1. Design a 3-tape Turing machine over the input alphabet {0,1} that will add binary strings u, v of equal (but unspecified) lengths. Tapes 1 and 2 are read-only. Tape 1 contains BuB. Tape 2 contains BvB. Tape 3 initially contains all B's. The computation should halt with BwB written on Tape 3, where w is the usual binary sum of u and v. Trace the computation performed by your machine on each of the following input pairs:

  2. In this problem L denotes the language of all strings over {a,b} that contain at least one a. Turing machines are assumed to have a single one-way tape. Input strings may be written anywhere on the tape; in particular, there may be several blanks on the tape before the first non-blank symbol.

  3. Show that the language L defined in the preceding problem is not decidable (i.e., not recursive).
    Hint: Suppose tentatively that L is decidable. This means that there is some Turing machine M (with a one-way tape) that halts for every input string over {a,b} (including the empty string), halting in an accepting state if the input string contains at least one a, and halting in a nonaccepting state if the input string contains no a's. Let k be the number of steps in the computation of M for a totally blank input string. Show that a string consisting of a single a, with blanks in all other positions, will be rejected by M if it is placed at an appropriate location on the tape. Explain carefully how a contradiction arises, and extract the appropriate conclusions.