/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q33P In the following solitaire game,... [FREE SOLUTION] | 91影视

91影视

In the following solitaire game, you are given anmm board. On each of itsm2 positions lies either a blue stone, a red stone, or nothing at all. You play by removing stones from the board until each column contains only stones of a single color and each row contains at least one stone. You win if you achieve this objective. Winning may or may not be possible, depending upon the initial configuration. LetSOLITAIRE={<G>|G is a winnable game configuration}. Prove that SOLITAIREis NP-complete.

Short Answer

Expert verified

SOLITAIRE isNP-Complete.

Step by step solution

01

Introduction

SOLITAIREis inNP:

SOLITAIRE$\inNP$because it can be verified that a solution works in polynomial time.

Every Language inNPis polynomial time reducible toSOLITAIRE :

We know that " role="math" localid="1663227043731" 3SAT$=\{\langle\phi\rangle\mid\phi$is a satisfiable $3\mathrm{cnf}-$formula $\}" $, three variables.

And "3SATisNP-Complete.

So, if we show that role="math" localid="1663227063355" $3\mathrm{SAT}\leq{\mathrm{p}}$SOLITAIREthen SOLITAIREis also NP-Complete.

Given $\phi$ with m variables $V_{1}, \ldots, $V_{m}$and k clauses $C_{1}, \ldots, C_{k}$

Now construct the following gameg with $k\timesm$board.

Construction of $k\timesm$game of G.

Let us assume that $\phi$ has no clauses that contain both $V_{i}$and $\bar$V_{i}$because such clauses may

If the variable $V_{i}$is in clause $C_{i}$then put a blue stone in row$C_{i}$ column$V_{i}$.

If the variable$\bar$V_{i}$ is in clause$C_{i}$ then put a red stone in row$C_{i}$ , column$V_{i\text{then}}$

K*mboard can be changed to square board necessary without affecting solvability.

02

Explanation

Now we need to show that $\phi$is satisfiable if and only ifG has a solution:

If is satisfiable then has a solution(Forward direction):

A Satisfying assignment is taken.

If V is true, remove the rod stone from the corresponding column.

If V is false, remove the blue stone from corresponding column.

So, stones corresponding to true literals remains.

Because every clause has a true literal, every row has a stone.

Therefore,G has a solute or.

Take a game solution.

If the red stone removed from a column, set the corresponding variable true.

If the bluestone is removed from a column, set the corresponding variable false.

Every row has a stone remaining, so every clause has a true literal.

Therefore, is satisfied.

Thus,SOLITAIRE is NP-Complete.

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 91影视!

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

A triangle in an undirected graph is a 3-clique. Show thatTRIANGLEP , where TRIANGLE=<G>|Gcontainsatriangle.

Question: Let S={{M}|MisaTMandLM={M'}.Show that S nor S' neither is Turing recognizable.

Rice鈥檚 theorem. Let P be any nontrivial property of the language of a Turing machine. Prove that the problem of determining whether a given Turing machine鈥檚 language has property P is undecidable. In more formal terms, let P be a language consisting of Turing machine descriptions where P fulfils two conditions. First, P is nontrivial鈥攊t contains some, but not all, TM descriptions. Second, P is a property of the TM鈥檚 language鈥攚henever LM1=LM2, we haveM1P if and only iffM2P . Here, M1 and M2 are any TMs. Prove that P is an undecidable language.

A queue automaton is like a push-down automaton except that the stack is replaced by a queue. A queue is a tape allowing symbols to be written only on the left-hand end and read only at the right-hand end. Each write operation (we鈥檒l call it a push) adds a symbol to the left-hand end of the queue and each read operation (we鈥檒l call it a pull) reads and removes a symbol at the right-hand end. As with a PDA, the input is placed on a separate read-only input tape, and the head on the input tape can move only from left to right. The input tape contains a cell with a blank symbol following the input, so that the end of the input can be detected. A queue automaton accepts its input by entering a special accept state at any time. Show that a language can be recognized by a deterministic queue automaton iff the language is Turing-recognizable.

Question:Consider the algorithm MINIMIZE, which takes a DFA as input and outputs DFA .

MINIMIZE = 鈥淥n input , where M=(Q,,,q0,A) is a DFA:

1.Remove all states of G that are unreachable from the start state.

2. Construct the following undirected graph G whose nodes are the states of .

3. Place an edge in G connecting every accept state with every non accept state. Add additional edges as follows.

4. Repeat until no new edges are added to G :

5. For every pair of distinct states q and r of and every a :

6. Add the edge (q,r) to G if q,a,r,a is an edge of G .

7. For each state q,let[q] be the collection of statesq={rQ|noedge joins q and r in G }.

8.Form a new DFA M'=Q',,',q'0,A'where

Q'={[q]|qQ}(ifq=r,onlyoneofthemisinQ'),'(q,a)=[q,a]foreveryqQanda,q00=[q0],andA0={[q]|qA}

9. Output ( M')鈥

a. Show that M and M' are equivalent.

b. Show that M0 is minimal鈥攖hat is, no DFA with fewer states recognizes the same language. You may use the result of Problem 1.52 without proof.

c. Show that MINIMIZE operates 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.