In 1952, Alan Turing, a British mathematician best known for his work on code-breaking and artificial intelligence, was convicted of engaging in homosexual acts and sentenced to chemical castration.