The Japanese game go-moku is played by two players, “X” and “O” on a 19 × 19 grid. Players take turns placing markers, and the first player to achieve five of her markers consecutively in a row, column, or diagonal is the winner. Consider this game generalized to an n × n board.

Let.GM={(B)|Bisapositioningeneralizedgomoku,whereplayerXhasawinningstrategy}

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, together with an indication of which player moves next. Showthat .GMPSPACE

Short Answer

Expert verified

.

Step by step solution

01

The PSPACE to collect the problems 

PSPACE is the collection of all decision problems that a Turing machine can answer using a polynomial space in computational complexity theory.

The algorithm is then shown to run in polynomial space. Assume that the position P denotes the player who will move next.

02

To follow the procedure and determines

In go-moku, the following procedure determines if player "X" has a winning strategy; in other words, it determines GM. The algorithm is then shown to run in polynomial space. Assume that the position P denotes the player who will move next.

M = "On input (P), where P is a generalised go-moku position:

1. Accept if "X" is next to move and has a chance to win this turn.

2. Reject if "O" is next to move and has a chance to win this turn.

3. If "X" is next to move but cannot win this round, recursively call M on (P'), where P' is the updated position P with player "Xmarker "'s on position p and "O" is next to move, for each free grid position p.

4. Accept if one or more of these calls accepts. If none of these options are available, then reject.

5.If "O" is next to move but cannot win this turn, recursively call M on (P'), where P' is the updated position P with player "Omarker "'s on position p and "X" is next to move, for each free grid position p.

6. Accept if all of these calls accept. "Reject if one or more of these calls rejects."

The recursion stack is the only space requirement of the algorithm.

There are at most n2 levels of recursion, and each level adds a single position to the stack utilising at mostO(n) space.

As a result, the method runs in O(n3)space.


Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Show that TQBF restricted to formulas where the part following the quantifiers is in conjunctive normal form is still PSPACE-complete.

Define CYCLE= {(G)| G is a directed graph that contains a directed cycle}. Show that CYCLEis NL-complete.

Define UCYCLE={G|Gis an undirected graph that contains a simple cycle}.Show that UCYCLEL. (Note: G may be a graph that is not connected.)

a. Let ADD={x,y,z|x,y,z>0 are binary integers and x+y=z}. Show
that ADDL.
b. Let PAL_ADD={x,y|x,y>0are binary integers wherex+y is an integer whose binary representation is a palindrome). (Note that the binary representation of the sum is assumed not to have leading zeros. A palindrome is a string that equals its reverse.) Show that PAL_ADDL.

The cat-and-mouse game is played by two players, "Cat" and "Mouse," on an arbitrary undirected graph. At a given point, each player occupies a node of the graph. The players take turns moving to a node adjacent to the one that they currently occupy. A special node of the graph is called "Hole." Cat wins if the two players ever occupy the same node. Mouse wins if it reaches the Hole before the preceding happens. The game is a draw if a situation repeats (i.e., the two players simultaneously occupy positions that they simultaneously occupied previously, and it is the same player's turn to move).
HAPPY-CAT={<G,c,m,h>G,c,m,hAre respectively a graph and positions of the Cat, Mouse, and Hole, such that Cat has a winning strategy if Cat moves first}.
Show thatHAPPY-CAT is in P. (Hint: The solution is not complicated and doesn't depend on subtle details in the way the game is defined. Consider the entire game tree. It is exponentially big, but you can search it in polynomial time.)

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free