Calendar An icon of a desk calendar. Cancel An icon of a circle with a diagonal line across. Caret An icon of a block arrow pointing to the right. Email An icon of a paper envelope. Facebook An icon of the Facebook "f" mark. Google An icon of the Google "G" mark. Linked In An icon of the Linked In "in" mark. Logout An icon representing logout. Profile An icon that resembles human head and shoulders. Telephone An icon of a traditional telephone receiver. Tick An icon of a tick mark. Is Public An icon of a human eye and eyelashes. Is Not Public An icon of a human eye and eyelashes with a diagonal line through it. Pause Icon A two-lined pause icon for stopping interactions. Quote Mark A opening quote mark. Quote Mark A closing quote mark. Arrow An icon of an arrow. Folder An icon of a paper folder. Breaking An icon of an exclamation mark on a circular background. Camera An icon of a digital camera. Caret An icon of a caret arrow. Clock An icon of a clock face. Close An icon of the an X shape. Close Icon An icon used to represent where to interact to collapse or dismiss a component Comment An icon of a speech bubble. Comments An icon of a speech bubble, denoting user comments. Comments An icon of a speech bubble, denoting user comments. Ellipsis An icon of 3 horizontal dots. Envelope An icon of a paper envelope. Facebook An icon of a facebook f logo. Camera An icon of a digital camera. Home An icon of a house. Instagram An icon of the Instagram logo. LinkedIn An icon of the LinkedIn logo. Magnifying Glass An icon of a magnifying glass. Search Icon A magnifying glass icon that is used to represent the function of searching. Menu An icon of 3 horizontal lines. Hamburger Menu Icon An icon used to represent a collapsed menu. Next An icon of an arrow pointing to the right. Notice An explanation mark centred inside a circle. Previous An icon of an arrow pointing to the left. Rating An icon of a star. Tag An icon of a tag. Twitter An icon of the Twitter logo. Video Camera An icon of a video camera shape. Speech Bubble Icon A icon displaying a speech bubble WhatsApp An icon of the WhatsApp logo. Information An icon of an information logo. Plus A mathematical 'plus' symbol. Duration An icon indicating Time. Success Tick An icon of a green tick. Success Tick Timeout An icon of a greyed out success tick. Loading Spinner An icon of a loading spinner. Facebook Messenger An icon of the facebook messenger app logo. Facebook An icon of a facebook f logo. Facebook Messenger An icon of the Twitter app logo. LinkedIn An icon of the LinkedIn logo. WhatsApp Messenger An icon of the Whatsapp messenger app logo. Email An icon of an mail envelope. Copy link A decentered black square over a white square.

Challenge to end stalemate over $1 million maths puzzle

Professor Ian Gent and Dr Peter Nightingale attempt the puzzle with the giant chess set at Falkland Palace.
Professor Ian Gent and Dr Peter Nightingale attempt the puzzle with the giant chess set at Falkland Palace.

Computer programmers are being offered a $1 million prize for inventing a system to crack a simple chess puzzle.

The eight queens puzzle, which has been solved by humans on a regular chess board, sends computer programmes into meltdown.

A team of St Andrews academics concluded that devising a computer programme to solve the problem could reap immense rewards.

In a paper published in the Journal of Artificial Intelligence Research, Professsor Ian Gent from the university’s school of computer science said it could be the key to tightening up internet security.

“If you could write a computer programme that could solve the problem really fast, you could adapt it to solve many of the most important problems that affect us all daily,” he said.

“This includes trivial challenges like working out the largest group of your Facebook friends who don’t know each other, or very important ones like cracking the codes that keep all our online transactions safe.”

The Clay Mathematics Institute in America has offered a $1 million reward for whoever solves a similar conundrum called the P vs NP Problem.

Professor Gent and his colleagues, Dr Peter Nightingale and Dr Christopher Jefferson, first became intrigued by the puzzle after a friend challenged Professor Gent to solve it on Facebook.

The team found that when the chess board reached 1000 squares by 1000, computer programmes could no longer cope with the vast number of options and sunk into a potentially eternal struggle akin to the fictional “super computer” Deep Thought in Douglas Adams’ Hitchhiker’s Guide to the Galaxy, which took seven and a half million years to provide an answer to the meaning of everything.

Dr Nightingale said: “In practice, nobody has ever come close to writing a programme that can solve the problem quickly.

“So what our research has shown is that, for all practical purposes, it can’t be done.”

Dr Jefferson added: “There is a $1m prize for anyone who can prove whether or not the queens puzzle can be solved quickly so the rewards are high.”

The 8 Queens puzzle

Devised in 1850, the queens puzzle originally challenged a player to place eight queens on a standard chessboard so that no two queens could attack each other.

This means putting one queen in each row, so that no two queens are in the same column, and no two queens in the same diagonal (see below).

There is more than one potential solution.

The reason such problems are so difficult for computer programmes is that there are so many options to consider that it can take many years due to a process of “backtracking” – an algorithm used in programming where every possible option is considered and then “backed away” from until the correct solution is found.

Chess has long provided the source for puzzles such as the traditional fable of the servant who, when asked to choose a reward by his king, asked for one grain of rice to be placed on the first square of a standard 8×8 chessboard, doubled in the next and so on until it was found there was not enough rice in the entire world.

The fable indicates the huge numbers involved when using just a standard sized chess board. When the board size increases the numbers become vast.