C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 6.26E

(Eight Queens) Another puzzler for chess buffs is the Eight Queens problem. Simply stated: Is it possible to place eight queens on an empty chessboard so that no queen is “attacking” any other—that is, so that no two queens are in the same row, the same column, or along the same diagonal? Use the kind of thinking developed in Exercise 6.24 to formulate a heuristic for solving the Eight Queens problem. Run your program. [Hint: It’s possible to assign a numeric value to each square of the chessboard indicating how many squares of an empty chessboard are “eliminated” once a queen is placed in that square. For example, each of the four corners would be assigned the value 22, as in Fig. 6.27.]

Once these “elimination numbers” are placed in all 64 squares, an appropriate heuristic might be: Place the next queen in the square with the smallest elimination number. Why is this strategy intuitively appealing?

Blurred answer
Students have asked these similar questions
Tiling: The precondition to the problem is that you are given threeintegers n, i, j, where i and j are in the range 1 to 2n. You have a 2n by 2n squareboard of squares. You have a sufficient number of tiles each with the shape . Your goalis to place nonoverlapping tiles on the board to cover each of the 2n × 2n tiles except forthe single square at location i, j. Give a recursive algorithm for this problem in whichyou place one tile yourself and then have four friends help you. What is your base case?
Artificial intelligence (Question - 6) ======================= One variation on the game of nim is described in Luger. The game begins with a single pile of stones. The move by a player consists of dividing a pile into two piles that contain an unequal number of stones. For example, if one pile contains six stones, it could be subdivided into piles of five and one, or four and two, but not three and three. The first player who cannot make a move loses the game.(6.1) Draw the complete game tree for this version of Nim if the start state consists of six stones.(6.2) Perform a minimax evaluation for this game. Let 1 denote a win and 0 a loss.
One variation on the game of nim is described in Luger. The game begins with a single pile of stones. The move by a player consists of dividing a pile into two piles that contain an unequal number of stones. For example, if one pile contains six stones, it could be subdivided into piles of five and one, or four and two, but not three and three. The first player who cannot make a move loses the game. (5.1) Draw the complete game tree for this version of Nim if the start state consists of six stones. (5.2) Perform a minimax evaluation for this game. Let 1 denote a win and 0 a loss.

Chapter 6 Solutions

C How to Program (8th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License