Sunday, October 21, 2007

CHESS FANTASIES-I

Right from the day I started this blog.
Which was on 19th of october.
(Just couple of days before.....)
I wanted to post on chess.
What to post on chess?
What to post on chess?
I was thinkin so hard that i forgot what i was thinking?
Lemme post other articles i decided.
And posted 12 other articles.
Nothing came to my mind for an article on chess.
So i didn't post anything....
Suddenly when I woke up this morning I remebered
the 8 queen puzzle.
As far as I remember,this was my first chess puzzle.
The first puzzle i solved......
This is quite famous through out the world.
Ah! i got a post....My brain...knew this puzzle for the past
6 years.....And still i dint remember it for 3 days.......
This is the 13th post of mine.
And this has turned out to be the most lucky post of mine....

THE EIGHT QUEEN PUZZLE

The eight queens puzzle is the problem of putting eight chess queens on an 8×8 chessboard such that none of them is able to capture any other using the standard chess queen's moves. The colour of the queens is meaningless in this puzzle. The queens must be placed in such a way that no two queens would be able to attack each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens puzzle of placing n queens on an n×n chessboard(n ≥ 4).

Constructing a solution

There is a simple algorithm yielding a solution to the n queens puzzle for n = 1 or any n ≥ 4:

1.Divide n by 12. Remember the remainder (it's 8 for the
eight queens puzzle).

2.Write a list of the even numbers from 2 to n in order.

3.If the remainder is 3 or 9, move 2 to the end of the list.

4.Append the odd numbers from 1 to n in order, but, if the remainder is 8, switch pairs (i.e. 3, 1, 7, 5, 11, 9, …).

5.If the remainder is 2, switch the places of 1 and 3, then move 5 to the end of the list.

6.If the remainder is 3 or 9, move 1 and 3 to the end of the list.

7.Place the first-column queen in the row with the first number in the list, place the second-column queen in the row with the second number in the list, etc.

For n = 8 this results in the solution shown above. A few more examples follow.

  • 14 queens (remainder 2): 2, 4, 6, 8, 10, 12, 14, 3, 1, 7, 9, 11, 13, 5.

  • 15 queens (remainder 3): 4, 6, 8, 10, 12, 14, 2, 5, 7, 9, 11, 13, 15, 1, 3.

  • 20 queens (remainder 8): 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 3, 1, 7, 5, 11, 9, 15, 13, 19, 17.
Solutions to the eight queens puzzle

The eight queens puzzle has 92 distinct solutions. If solutions that differ only by symmetry operations (rotations and reflections) of the board are counted as one, the puzzle has 12 unique solutions, which are presented below:





1 comments:

sai said...

wonder full..........
simply superb