here

advertisement
Name_____________________________
40 points
1. Consider the following Turing Machine with three non-halting states, A,B, and C:
If the machine's tape initially contains all 0's.
How many 1's will the tape have when the machine halts?
How many moves will the machine make before it halts?
Show the tape after each move.
2. Design a Turing Machine with 2 non halting states and a halting state that prints four
ones and halts. Assume the tape that initially contains all 0's.
Show the machine and the tape after each move.
This will take some trial, error, and TIME.
3. Is S is a set, the symbol 2S denotes the set of all subsets of S.
For example,
if S = {a,b} then 2S = { Ф , {a}, {b}, {a,b} } and
if S ={a,b,c} then 2S = { Ф , {a}, {b}, {c}, {a,b}, {a,c}, {b,c} ,{a,b,c} }
if S = {1,2,3,4,5,6,7,8,9, 10,…….} then 2S is the collection of all subsets of
positive integers…every possible subset, infinite or finite
Notice that 2s is a set of sets.
If S is a set , we can use a vector of 0's and 1's to denote each subset of S. For
example,
If S = {a,b,c} then

[0,0,0] represents the empty set

[1,0,0] represents {a}

[0,1,0] represents {b}

[1,0,1] represents {a,c}
The vectors representing the various elements of 2S are shown below—remember the
elements of 2S are sets:
a
b
c
0
0
0
Ф
1
0
0
{a}
0
1
0
{b}
0
0
1
{c}
1
1
0
{a,b}
1
0
1
{a.c}
1
1
1
{a,b,c}
The 8 vectors representing the 8 elements in 2 S
a. Suppose S = {a,b,c,d}. Write vectors to denote
i.
{a,c,d}
ii.
{b,c,d}
iii.
{a,d}
b. How many subsets comprise 2S ?
c. If S = {1,2,3,4,5,6,7,8} how many subsets are in 2s ?
Now suppose that S = {1,2,3,4,5,6,7,8……}, i.e S is the set of all positive integers. The
subset of all even positive integers can be represented with the (infinite) vector:
[1,0,1,0,1,0,1,0,1,0……];
the set of all odd positive integers is denoted by
[ 0,1,0,1,0,1,0,1,0……];
and, the set of all prime numbers can be represented as
[0,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1…….]
d. What subset of S is denoted by the vector
[0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1……] ?
e. If S = {1,2,3,4,5,6,7……} (or any infinite countable set), show that 2S is
uncountable.
Hint: Assume that 2S is countable and denote each set in 2S by an infinite vector (as
shown above). List the elements of 2S, and use a diagonalization process to find a
contradiction.
4. If S = {1,2,3,4,5,6,7,8,……} is the set of positive integers.
Show that
F = {f | f: S  S} is uncountable.
Hints:
Notice that F is the set of all functions that map positive integers to positive integers.
Each element of F is a function.
Some sample functions of F are:
f(n) = 2n ; so f(1) = 2; f(2) = 4; f(3) = 6
or
f(n) = n2;
so f(1) = 1; f(2) = 4; f(3) = 9; f(4) = 16.
Each function, f : SS, can be represented by an infinite vector [f(1), f(2), f(3), f(4)…..]
For example,
f(n) = 2n is denoted by [2,4,6,8,10,12,……..]
f(n) = n2 is denoted by [1,4,9,16,25,36,……]
f(n) = n+3 is denoted by [4,5,6,7,8,9……..] and
f(n) = "the first prime >= n " is denoted by
[2,2,3,5,5,7,7,11,11,11,11,13,13,17,17,17,17,19,19,….]
Moreover , if f is represented by [4,8,7,5,9,7,31,22,41,56,77,3…..] then
f(1) = 4,
f(2) = 8;
f(3) = 7 etc.
The vector [5,5,5,5,5,5,5,5,5,…] represents the constant function f(n) = 5.
To show that F is uncountable, assume that F is countable, list the functions of F, and
use a diagonalization process to get a contradiction.
Download