This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 6.045J/18.400J: Automata, Computability and Complexity Nancy Lynch Homework 12.1 (Fake) Due: Never Elena Grigorescu Readings: Sipser, Chapter 8 (the whole chapter). Problem 1 : Solutions borrowed from Susan Hohenberger (2004.) (Sipser Exercise 8.1) Show that for any function f : N → N , where f ( n ) ≥ n , the space complexity class SPACE( f ( n )) is the same whether you define the class by using the singletape TM model or the two tape readonly TM model. Solution 1 : First, we can simulate a SPACE( f ( n )), for f ( n ) ≥ n , singletape TM on a SPACE( f ( n )) two tape readonly TM as follows. Step one: scan the readonly tape, copying its contents to the work tape. Step two: simulate the remainder of the computation, treating the read/write worktape as the input tape of a “singletape” TM. We can copy the contents of the counter, using only log n space to keep track of our position in the input. We can write all of the input on our worktape, since f ( n ) ≥ n . Secondly, we can simulate a SPACE( f ( n )), for f ( n ) ≥ n , two tape readonly TM on a SPACE( f ( n )) singletape TM by refraining from writing over the first n input symbols, using the remainder of the tape for our work area. Since this only adds n amount of space used, and we were already using at least n space, this increases our space by at most a constant. Problem 2 : (Sipser Problem 8.10) The Japanese game gomoku is played by two players, “X” and “O”, on a 19 × 19 grid. Players take turns placing markers, and the first player to achieve 5 of his/her markers consecutively in a row, column, or diagonal, is the winner. Consider this game generalized to an n × n board. Let GM = {( P ) P is a position in generalized gomoku, where player “X” has a winning strategy } . By a position we mean a board with markers placed on it, such as may occur in the middle of a play of the game. Show that GM ∈ PSPACE. Solution 2 : (borrowed from Spring 1999) First let’s assume that P is written as a grid of X,O and empty, so the length of the input is O ( n 2 ). Let’s define a recursive algorithm to solve GM(P), which accepts if there is a winning strategy for player X starting at position P: GM(P) (1) For all spaces i in position P without markers on them, (potential X moves) 1. Put an X marker on space i , thus changing the position to P’. If there are now 5 X’s in a row, accept , this is obviously a good move. If the board is now full, and no one has won, reject . 2. Otherwise, for all spaces j in position P’ without markers on them, (potential O moves) (a) Put an O on space j , thus changing the position to P”. If there are now 5 O’s in a row, or the board is full and no one has won, loop to the next i (goto step (1)); putting an X on i is obviously a bad move....
View
Full
Document
This note was uploaded on 08/12/2009 for the course CS 430 taught by Professor Nancylynch during the Spring '07 term at New Mexico Junior College.
 Spring '07
 NancyLynch

Click to edit the document details