In a new play, Alan Turing turns to a colleague in a moment of epiphany. "Mathematics," he says triumphantly, "is a landscape riddled with holes and paradoxes. It is a chaos filled not with reasons and whys, but with contradictions and why nots."

The mathematician may never have uttered these exact words, but his character did in Friday's New York City workshop performance of Pure. The new play, by A. Rey Pamatmat, explores the mysterious parallels between Turing's work and his personal life, suggesting that the chaos Turing finds in mathematics is actually a reflection of his own complexities.

Called the father of modern computer science, Turing is most famous for conceptualizing the Turing machine, an abstract machine or primitive computer that has the ability to reduce any mathematical process to a series of simple steps, and then perform it. As the play reveals, however, this is only one of a number of Turing's contributions to science. He also devised the Turing Test to explore the limits of artificial intelligence (a machine "passes" the Turing test when it fools a person into thinking, based on its conversational skills, that it is human); he helped England break German naval codes in World War II; and he modeled biological processes such as plant structures using mathematical formulas like the Fibonacci sequence. The play communicates his complex ideas through Turing's character as he tries to convince his colleagues of the importance of his work.

Pure is less about Turing the mathematician, however, than it is about Turing the man. Pamatmat first became enamored with Turing after reading David Bodanis's book Electric Universe: The Shocking True Story of Electricity, which suggests that Turing's passion for science was fueled by his homosexual love for a childhood friend, Chris, who died from tuberculosis when Turing was a teenager. Pure suggests that Turing may have turned his attention to artificial intelligence—a field that explores, at its core, the meaning of life—to celebrate Chris's life and let it live on in his work. In almost every scene, Turing has a brief conversation with the dead Chris; it later becomes clear that the entire play is set in the hazy moments before Turing's death, when he is hallucinating or perhaps communicating with Chris's spirit in the afterlife.

Pamatmat, who wrote Pure for the Ensemble Studio Theatre's annual First Light Festival, paints Turing as a wonderfully brazen character. The mathematician was openly gay at a time when homosexuality was a criminal act in England; in one scene, Turing admits to his fiancé—three days after proposing to her—that he has "homosexual tendencies." (Pamatmat says this conversation really happened.) Pure suggests that Turing's insolence dances the fine line between bravery and foolishness; though he was eventually caught and forced to take estrogen supplements to curb his libido, he never doubted himself or his sexual choices. "A lot of his greatest work came from his being different," Pamatmat says. "That's why he was really able to blaze the trail."

If Turing's life was exceptional, his death was even more so: He was found dead in his bed in 1954 with a half-eaten apple by his side. In agreement with most historical accounts, the play suggests that Turing killed himself by lacing the apple with cyanide. As the British authorities never had the fruit tested, and Turing left no suicide note, some believe he was assassinated. But as was true in his life, his devotion to science was so intertwined with his death that it was almost impossible to distinguish. He had, after all, been obsessed his entire life with poison.

The Ensemble Studio Theatre's First Light Festival, a monthlong presentation of plays about science and technology supported by the Alfred P. Sloan Foundation, continues through May.