sign up I login
 advanced
refer a friend - earn nickels!!

Ask & Discuss Questions with Community & Experts

Moderation Team
Ask iit jee aieee pet cbse icse state board experts Discussion Response Post to: permutation
Forum Index -> Algebra -> View Full Question like the article? email it to a friend.  
Author Message
edison (5135)

Forum Expert Blazing goIITian

Olaaa!! Perrrfect answer. 903  [1213 rates]

edison's Avatar

total posts: 2583    
offline Offline
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.
 
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. Write 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.

The Scientist does not study nature because it is useful; he studies it because he delights in it, & he delights in it because it is beautiful. If nature were not beautiful, it would not be worth knowing, life would not be worth living. Ofcourse I do not here speak of that beauty that strikes the senses, the beauty of qualities & appearances; not that I undervalue such beauty, far from it, but it has nothing to do with science; I mean that profounder beauty which comes from the harmoniuos order of the parts, & which a pure intelligence can grasp.
 this reply: 10 points  (with Olaaa!! Perrrfect answer.   in 2 votes )   [?]
 
You have to be logged on to rate
  
 

 Aakash Institute IIT/ AIEEE/ Medical Crash Course
Name  
E-mail  
Phone  
Mobile  
** Hurry. Exclusive goIIT Offer. Limited Seats Only!
available in: New Delhi, Amritsar, Bhatinda, Bokaro, Chandigarj, Dehradun, Guwhati, Hyderabad, Indore, Jaipur, Kanpur, Karnal, Kolkata, Kota, Lucknow, Ludhiana, Mumbai, Noida, Patiala, Patna, Pune, Ranchi, Varanasi
Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Aakash-IITJEE : AIEEE
Aakash-IITJEE : DCE
Aakash-IITJEE : MHTCET
Aakash Institute : AIPMT
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya