Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Eight queens puzzle
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Constructing and counting solutions when ''n'' = 8 == The problem of finding all solutions to the 8-queens problem can be quite computationally expensive, as there are 4,426,165,368 possible arrangements of eight queens on an 8Γ8 board,{{efn|The number of [[combination]]s of 8 squares from 64 is the [[binomial coefficient]] <sub>64</sub>C<sub>8</sub>.}} but only 92 solutions. It is possible to use shortcuts that reduce computational requirements or rules of thumb that avoids [[Brute-force search|brute-force computational techniques]]. For example, by applying a simple rule that chooses one queen from each column, it is possible to reduce the number of possibilities to 16,777,216 (that is, 8<sup>8</sup>) possible combinations. Generating [[permutation]]s further reduces the possibilities to just 40,320 (that is, [[factorial|8!]]), which can then be checked for diagonal attacks. The eight queens puzzle has 92 distinct solutions. If solutions that differ only by the [[symmetry]] operations of rotation and reflection of the board are counted as one, the puzzle has 12 solutions. These are called ''fundamental'' solutions; representatives of each are shown below. A fundamental solution usually has eight variants (including its original form) obtained by rotating 90, 180, or 270Β° and then reflecting each of the four rotational variants in a mirror in a fixed position. However, one of the 12 fundamental solutions (solution 12 below) is identical to its own 180Β° rotation, so has only four variants (itself and its reflection, its 90Β° rotation and the reflection of that).{{efn|Other symmetries are possible for other values of ''n''. For example, there is a placement of five nonattacking queens on a 5Γ5 board that is identical to its own 90Β° rotation. Such solutions have only two variants (itself and its reflection). If ''n'' > 1, it is not possible for a solution to be equal to its own reflection because that would require two queens to be facing each other.}} Thus, the total number of distinct solutions is 11Γ8 + 1Γ4 = 92. All fundamental solutions are presented below: {{col-begin}} {{col-break}} {{Chess diagram small | center | |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|ql|__|__|__|__|__|__ |__|__|__|__|ql|__|__|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |Solution 1 }} {{col-break}} {{Chess diagram small | center | |__|__|__|__|ql|__|__|__ |__|ql|__|__|__|__|__|__ |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|__|ql|__|__ |ql|__|__|__|__|__|__|__ |Solution 2 }} {{col-break}} {{Chess diagram small | center | |__|__|__|ql|__|__|__|__ |__|ql|__|__|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|ql|__|__|__ |ql|__|__|__|__|__|__|__ |Solution 3 }} {{col-break}} {{Chess diagram small | center | |__|__|__|ql|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|__|__|__|__|__|__|ql |__|__|ql|__|__|__|__|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|__|__|ql|__|__|__ |__|ql|__|__|__|__|__|__ |Solution 4 }} {{col-end}} {{col-begin}} {{col-break}} {{Chess diagram small | center | |__|__|ql|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|__|__|__|__|__|__|ql |ql|__|__|__|__|__|__|__ |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|__|__|ql|__|__|__ |__|ql|__|__|__|__|__|__ |Solution 5 }} {{col-break}} {{Chess diagram small | center | |__|__|__|__|ql|__|__|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|ql|__|__|__|__|__|__ |Solution 6 }} {{col-break}} {{Chess diagram small | center | |__|__|__|__|ql|__|__|__ |__|__|__|__|__|__|ql|__ |__|__|__|ql|__|__|__|__ |ql|__|__|__|__|__|__|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|__|ql|__|__ |__|ql|__|__|__|__|__|__ |Solution 7 }} {{col-break}} {{Chess diagram small | center | |__|__|__|ql|__|__|__|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|ql|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|__|ql|__|__ |__|__|ql|__|__|__|__|__ |__|__|__|__|__|__|ql|__ |__|ql|__|__|__|__|__|__ |Solution 8 }} {{col-end}} {{col-begin}} {{col-break}} {{Chess diagram small | center | |__|__|ql|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|__|__|ql|__|__|__|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|ql|__|__|__ |__|__|__|__|__|__|ql|__ |__|ql|__|__|__|__|__|__ |Solution 9 }} {{col-break}} {{Chess diagram small | center | |__|__|__|__|__|ql|__|__ |__|ql|__|__|__|__|__|__ |__|__|__|__|__|__|ql|__ |ql|__|__|__|__|__|__|__ |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|ql|__|__|__ |__|__|ql|__|__|__|__|__ |Solution 10 }} {{col-break}} {{Chess diagram small | center | |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|__|__|__|ql|__|__|__ |__|ql|__|__|__|__|__|__ |__|__|__|__|__|ql|__|__ |__|__|ql|__|__|__|__|__ |Solution 11 }} {{col-break}} {{Chess diagram small | center | |__|__|__|__|__|ql|__|__ |__|__|__|ql|__|__|__|__ |__|__|__|__|__|__|ql|__ |ql|__|__|__|__|__|__|__ |__|__|__|__|__|__|__|ql |__|ql|__|__|__|__|__|__ |__|__|__|__|ql|__|__|__ |__|__|ql|__|__|__|__|__ |Solution 12 }} {{col-end}} Solution 10 has the additional property that [[No-three-in-line problem|no three queens are in a straight line]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)