Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Statistics and Probability Expert

Louis Reasoner is having a terrible time doing exercise 2.42. His queens procedure seems to work, but it runs extremely slowly. (Louis never does manage to wait long enough for it to solve even the 6× 6 case.) When Louis asks Eva Lu Ator for help, she points out that he has interchanged the order of the nested mappings in the flatmap, writing it a

1962_kk.jpg

Explain why this interchange makes the program run slowly. Estimate how long it will take Louis's program to solve the eight-queens puzzle, assuming that the program in exercise 2.42 solves the puzzle in time T.

exercise 2.42 Figure 2.8. A solution to the eight-queens puzzle. The ``eight-queens puzzle'' asks how to place eight queens on a chessboard so that no queen is in check from any other (i.e., no two queens are in the same row, column, or diagonal). One possible solution is shown in figure 2.8. One way to solve the puzzle is to work across the board, placing a queen in each column. Once we have placed k - 1 queens, we must place the kth queen in a position where it does not check any of the queens already on the board. We can formulate this approach recursively: Assume that we have already generated the sequence of all possible ways to place k - 1 queens in the first k - 1 columns of the board. For each of these ways, generate an extended set of positions by placing a queen in each row of the kth column. Now filter these, keeping only the positions for which the queen in the kth column is safe with respect to the other queens. This produces the sequence of all ways to place k queens in the first k columns. By continuing this process, we will produce not only one solution, but all solutions to the puzzle. We implement this solution as a procedure queens, which returns a sequence of all solutions to the problem of placing n queens on an n× n chessboard. Queens has an internal procedure queen-cols that returns the sequence of all ways to place queens in the first k columns of the board.

Statistics and Probability, Statistics

  • Category:- Statistics and Probability
  • Reference No.:- M91766490

Have any Question?


Related Questions in Statistics and Probability

What would be the net annual cost of the following checking

What would be the net annual cost of the following checking account? Interest earnings of 3 percent with a $550 minimum balance; average monthly balance, $800; monthly service charge of $15 for falling below the minimum ...

Assume the random variable x is normally distributed with a

Assume the random variable x is normally distributed with a mean u=80 and a standard deviation o=4. Find the indicated probability. P(69 P(69 Round to four decimals places as needed.

1 if there are 150 values in a data set how many classes

1) If there are 150 values in a data set, how many classes should be created for a frequency histogram? A. 5 B. 6 C. 7 D. 8 E. 9 2) . If x is a binomial random variable where n = 100 and p = 0.2, find the probability tha ...

Answer the following questions about an anova analysis

Answer the following questions about an ANOVA analysis involving three samples. a. In this ANOVA analysis, what are we trying to determine about the three populations they're taken from? b. State the null and alternate h ...

Thirty-eight percent of consumers prefer to purchase

Thirty-eight percent of consumers prefer to purchase electronics online. You randomly select 16 consumers. Find the probability that the number who prefer to purchase electronics online is at most 5.

A researcher wants to determine if lead levels are

A researcher wants to determine if lead levels are different between the top of a glass of water and the bottom of a glass of water. Many samples of water are taken. From half, the lead level at the top is measured and f ...

Your company doesnt face any taxes and has 760 million in

Your company doesn't face any taxes and has $760 million in assets, currently financed entirely with equity. Equity is worth $51.00 per share, and book value of equity is equal to market value of equity. Also, let's assu ...

Research scenarionbspchildren who experience chronic pain

Research Scenario:  Children who experience chronic pain as a result of medical procedures are the focus of a psychiatrist's study. Specifically, the psychiatrist wants to measure whether a new program helps decrease fee ...

A box contains n white and m black balls one ball is added

A box contains n white and m black balls. One ball is added randomly, white with probability p and black with probability 1 - p. Then a random ball is taken out from the box. (a) Find the probability that the taken ball ...

Many restaurants and eateries are now posting calorie

Many restaurants and eateries are now posting calorie counts on their menus. We wonder if providing the calories results in customers ordering fewer calories than when the calories are not provided. We will use data from ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As