147k views
2 votes
Eight-queen's problem Consider the classic puzzle of placing eight queens on an 8 x 8 chessboard so that no two queens are in the same row or in the same column or on the same diagonal. How many different positions are there so that

no two queens are on the same square?
no two queens are in the same row?
no two queens are in the same row or in the same column?
Also, estimate how long it would take to find all the solutions to the problem by exhaustive search based on each of these approaches on a computer capable of checking 10 billion positions per second.

User Mistwalker
by
4.7k points

1 Answer

2 votes

Answer:

  • 12 solutions
  • 16,777,216
  • 40320 ways

Step-by-step explanation:

A) No two queens on the same square

Placing eight queens on an 8 * 8 chessboard has a total of 92 Separate solutions but unique 12 solutions

The total no of possible solutions using the computational method is

= 64! / (56! * 8! ) ~ 4:4 * 109

but since there are 12 unique solution out of the 92 therefore

B) No two queens are in the same row

= 8^8 = 16,777,216

C) No two queens are in the same row or in the same column

= 8! = 40320 ways

It will approximately take less than a second for a computer with the capability of checking 10 billion positions per second to find all the solutions

User Emil Gi
by
5.4k points