Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

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 ADFAL

For any positive integer x, let xR be the integer whose binary representation isthe reverse of the binary representation of x. (Assume no leading in the binary representation of x.) Define the function R+:NNwhereR+(x)=x+xR.
a. Let A2=x,y|R+(x)=y.

ShowA2L.
b. Let A2=x,y|R+(R+(x))=y. ShowA3L.

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.)

Let B be the language of properly nested parentheses and brackets. For example,is in B but []is not. Show that B is in L.

BOTHNFA={(M1,M2)|M1andM2areNFAswhereL(M1)L(M2)ϕ}.

Show that BOTHNFA is NL-complete.

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