Depending on what circle you run in – say , your best friend is acomputerprogrammer and your sister is a chess prognostication – you may already be familiar with the 8 Queens teaser . For the remainder of us , the 8 Queens puzzle ( or problem or simply " 8 Queens " ) is probably not something we spend a lot of our sentence thinking about .

The teaser is simple enough . How can you place 8 pansy on a chessboard so that no two approach each other ? Alternately , the question is sometimes stated as " What is the maximal number of poof that can be placed on a chessboard , so that no two can round each other , " but this mystifier becomes a plenty less unvoiced when youGooglethat , and the condition " the 8 Queens puzzle " comes up .

You might be enquire yourself why on Earth anyone cares where you keep your eight queen . And yes , superficially , it is just a strategic mystifier . But ( and this is where it ’s ready to hand to have a best friend who take in computers ) the 8 Queens puzzle is a heavy way to test the savvy and literacy of a software engineer .

Now , do n’t be frightened . You will not be forced to understand the intricacies of computer programming to keep reading . But you should know that solving the puzzle can be achieved using a programming code – and some are more refined than others . For instance , you’re able to definitely regain the solution using a " brute - force " platform that might only go through every possible arrangement , ruling out one at a meter . But a advanced programmer will be able-bodied to construct a program that has shortcuts using a more refinedalgorithmto find you a solution faster . Being able to come up with strange or original ways to code a answer to a trouble as broad as 8 Queens can be a great test for the savvy of a code - writer .

So while we wo n’t be stringing 1s and 0s at you to excuse how 8 Queens works , we will be give you a few solutions to the puzzler .

Origin and Explanation of 8 Queens Puzzle

Now that we get the basic assumption of the puzzle , we should establish why the problem is so unequalled . To do that , let ’s sweep up on our chess bedrock . In a game of Bromus secalinus , the queen is a force to be reckoned with . She can move in a straight line vertically , horizontally or diagonally , as many infinite as she pleases . The one catch is that she ca n’t jump pieces , so if a pawn is in her mode , she must beguile it and stop .

This is what piddle the 8 Queens puzzle interesting . If queens can move up , down , left , right and diagonally , then how many war royals can fill the circuit card without sharing the same row , column or sloping line ? Now , you might think it ’d be a terrific idea to just place a queen on the board , try dissimilar combining before you make on all of them . And sure , that ’s possible . But there are 4,426,165,368 potential solutions , so you might consider finding a shortcut .

Before we put our queen in 4 billion different squares , get ’s first acknowledge that somebody actually sit down down one day and decided this would be a good way to blow an good afternoon or two . Predictably , it was n’t someone who had rerun of " My giving Fat Gypsy Wedding " to catch up on – it was a 19th - one C German Bromus secalinus master and composer list Max Bezzel . ( Achesscomposeris someone who makes up chess problems – also make out as puzzles – to solve . ) It first appear in the German chess magazine DieSchachzeitung in 1848 .

Bezzel was n’t so concerned in solving the puzzle ; he was satisfied with simply pose the question . However , in 1850 , mathematician Franz Nauck wrote another clause that discourse the problem . ( The first solutions to the puzzle were eventually solved by Nauck . ) That got the tending of Karl Gauss , a nineteenth - century mathematician known for discovering the fundamental theory of algebra . When Gauss accept an interest in finding the solvent , others followed , and unlike approaches to solving the puzzle began to emerge .

Solutions to 8 Queens

It ’s not much of a surprise that " eight " is the answer to our specific question of how many queens can be placed on a dining table without attacking one another . But let ’s explore how many ways eight queens can be place and how that is show .

We talked about how brutish - force computer programs are one elbow room to solve the puzzle – and testing out 4,426,165,368 possibilities manually would sure as shooting qualify as brutish force – but there are easier ways to narrow down the solution . One simplified method was provided when J.W.L Glaisher , another mathematician , issue a report in 1874 describing his manipulation of determinants to find a solvent . " Determinants " voice a small tough , but all you really necessitate to know is that Glaisher basically make a matrix , and – using a system he deduct from that matrix – was able to specialize down the possible solvent to 92 .

And 92 result it remains . But do n’t be fooled ; you wo n’t be able-bodied to run along up 92 chessboards , each with a unequalled set of 8 queens settled peacefully , because there are really only 12 alone solutions .

Confused ? The conflict between 12 unique solutions and 92 cardinal solutions remainder , literally , on how you take care at it . While you could determine up 12 unlike boards distinctively with your eight queens , all it takes is for you to but turn the board – or even speculate it onto a mirror – to make the gameboard technically look unlike and thus have a " unlike " solution . ( This is calledrotationalandreflective symmetry operation . ) So you take your 12 unique board , turn them 90 , 180 , and 270 degrees and then contemplate them at each revolution . But one more thing – one unique board is symmetric , so it face the same from two angle . While all the other boards have eight variants , the symmetrical gameboard only has four . So instead of 12 circuit card times 8 variations ( 96 ) , we ’re actually take off the four that do n’t exist with the symmetric board . What do we get ? 92 underlying solutions .

Now , do n’t let the math fool you . you may always get yourself a chessboard and attempt to ferret out some location for yourself . ( Finding one answer , of course , is a lot sluttish than observe all 12 . ) And there are even programs on theWebthat permit you suss out some different root . ( Warning : they may make you feel stupid . )

Before you mix your pansy around , delay out the next page to ascertain more information .

Being a mortal less concerned in an algorithmic program than an alphabet , I did n’t have high hopes for understanding the 8 Queens puzzle . Although I was sure it had some sort of practical program , I was n’t able to see it . Ironically , it was when I understood the greatness of the problem that I started to see why it could be useful . Finding a set of solutions from a massive amount of hypothesis is one ground code survive . The 8 Queens problem challenge programmer and mathematician likewise to discover novel techniques to simplify the hunting .

Sources