Computer pioneer and Bletchley Park codebreaker Alan Turing has been issued a posthumous royal pardon.

Alan Turing
Codebreaker Alan Turing, convicted of homosexuality on 1952, has been issued a posthumous royal pardon.

The pardon, which came into effect on Christmas Eve, overturns his 1952 conviction for homosexuality, for which he was punished by being chemically castrated, forced to take a year-long prescription of oestrogen.

His conviction meant he lost his security clearance and was forced to stop the codebreaking work which had helped to crack the German Enigma code during World War II.

Two years after his conviction, Turing died after eating an apple laced with cyanide. An inquest decided he had committed suicide, but this is disputed by biographers, friends and family who believe his death was an accident.

A sentence we would now consider unjust and discriminatory...

Following a request by Justice Minister Chris Grayling, the pardon was granted under the Royal Prerogative of Mercy.

Grayling said: "Dr Alan Turing was an exceptional man with a brilliant mind....His later life was overshadowed by his conviction for homosexual activity, a sentence we would now consider unjust and discriminatory and which has now been repealed."

Grayling added that Turing "deserves to be remembered and recognised for his fantastic contribution to the war effort and his legacy to science. A pardon from the Queen is a fitting tribute to an exceptional man."

Turing's work at Bletchley Park, a predecessor to the government's GCHQ, was widely considered to have shortened World War II, saving thousands of lives. A highlight of his work was the cracking of the Germans' Enigma machine, used to encrypt naval messages.

Turing created a device called a bombe, which searched for possible correct settings used for an Enigma message, and for each possible setting the bombe performed a chain of logical deductions.

Detecting when a contradiction had occurred, the bombe ruled out that setting and moved on to the next.

Most of the possible settings would cause contradictions and be discarded, leaving only a few to be investigated in detail. The first bombe was installed on 18 March 1940, but by the end of the war more than 200 bombes were in use.

The Turing Test

After the war, Turing's research into artificial intelligence (AI) paved the way for what has become known as the Turing Test, which is used to determine whether a machine is capable of thought.

The test involved an interrogator asking a set of questions to a person and a computer, who would both give answers aimed at deceiving the interrogator about their true identities.

If the person asking the questions could not tell the difference between human and machine, then the computer would be considered to have artificial intelligence and be thinking for itself.