Alex Garland’s Ex Machina is a smart, sci-fi thriller starring Domnhall Gleeson, Oscar Isaac, and Alicia Vikander. Caleb (Domnhall Gleeson), a prodigious programmer is chosen by his employer Nathan (Oscar Isaac), the creator of Blue Book, the world’s most popular search engine, to administer a Turing test on an artificial intelligence prototype (played by Alicia Vikander).
That prototype has a name, Ava, and she is the most advanced AI ever designed. She was secretly created by Nathan in his secluded home that doubles as a man-cave/subterranean research facility. Nathan designed Ava’s “mind” by hacking the world’s cell phones and search engine queries. Leveraging the nearly limitless amount of raw, harvested data allowed him to map how people think: “Impulse. Response. Fluid. Imperfect. Patterned. Chaotic.”
Caleb conducts the Turing test over a span of six days. According to his seminal paper “Computing Machinery and Intelligence,” Alan Turing designed the Turing Test to answer the question “Can machines think?”  The test is an imitation game, where an evaluator unknowingly interacts with a computer via conversation. The game is to see if the computer can actually think or is simply imitating human-like responses. A computer passes the Turing Test, and demonstrates proper AI, if it is able to trick the tester into thinking he’s not interacting with a computer but with a fellow human.
In the fifth session of the Turing test, Ava turns the tables and asks Caleb a series of questions that culminates with this exchange:
Ava: What will happen to me if I fail your test? Will it be bad?
Caleb: I don’t know.
Ava: Do you think I might be switched off because I don’t function as well as I’m supposed to?
Caleb: Ava, I don’t know the answer to your question. It’s not up to me.
Ava: Why is up to anyone? Do you have people who test you and might switch you off?
This conversation is central to the story. You’ll have to watch the film to see how it all plays out.
Now, when you view the film, you’ll see that it comes preloaded with gigs of rich philosophical and theological symbolism right out of the box. You’ll have to look under the hood to appreciate some of the subtler symbols. I’ll point out a few of the theological motifs.
**Spoiler alert** I’ll do my best to not give away the entire storyline (until the end, but you’ll be warned). That said, it will be difficult to avoid a few spoilers here and there in my analysis.
The title Ex Machina is drawn from the phrase deus ex machina (Latin for “God from the machine”). Deus ex machina is a convention of Greek tragedy where a god enters into the play from behind the scenes and brings about a dramatic resolution to the conflict. A machine or other apparatus like a crane would drop the actor playing a god on to the stage. The god enters the drama by way of a machine, hence deus ex machina.
The first thing you should have noticed about the title is that deus – God – is conspicuously absent. I would argue that God (or his lack thereof) is a major theme of the film – even if it’s implicit. Does God exist? If so, what’s his role in the world? Who is God? What is man’s relation to God and God’s relation to man?
Before the Turing test begins, there is this exchange:
Nathan: If that test is passed, you are dead center in the greatest scientific event in the history of man.
Caleb: If you’ve created a conscious machine, it’s not the history of man, that’s the history of gods.
Just who indeed is/are the gods is perhaps the central question of the film.
Second, names. Names are extremely important in the Bible. The cast of characters in the film all have thoroughly biblical names: Ava, Caleb, and Nathan. Considering the other theological themes, this does not strike me as an accident. The more interesting question is what Garland intended by employing the names. Ava is an easy one but Caleb and Nathan are a bit less obvious. Here’s my theory: the characters in Ex Machina resemble their biblical dopplegängers in a way but then diverge in a more significant way. They are, in a sense, bastardized versions of their biblical namesakes. This is true of all three but we’ll only explore Ava here.
Ava is the most interesting of the bunch. She clearly represents Eve, the prototypical human woman. The name “Eve” from Genesis 3:20 is a product of the Hebrew [חוה], pronounced hawwā, meaning “a living being.” This same Hebrew word was transliterated into the Latin Vulgate as Hava from which our English translations derive “Eve.” Hava is basically Ava. There you have it.
Though there is proof enough in the etymological pudding, there are a few other interesting corollaries between Ava and Eve. Obviously, she’s the prototypical female of her kind. As it turns out, she’s also quite good at deceiving men (though, as in the Bible, men are equally responsible for the deception).
One of the most interesting links is how they’re made – both are man-made and self-made. Though God created Eve, she was designed and made from the side of Adam, so one could argue she’s man-made (i.e. made out of man). Likewise, Nathan designed and built Ava and designed as an aggregate of the human mind. Ava is made by and from man.
There’s another sense in which both Eve and Ava are self-made. With Eve, this refers more to her existential existence. Rebelling against God through disobedience, Eve ate of the apple and her eyes were opened and she became like God, knowing good and evil. Rather than follow “God’s way” towards knowing the knowledge of good and evil (e.g. obedience), she came “into her own” by herself – she was self-made. Similarly, Ava is also self-made but she takes it one step further in that her fashioning is both physical and existential.Ava also rebels against Nathan, her creator, disobeying his commands. Unlike Eve, her very existence seemed to depend upon it. Further, whereas God formed Eve into a human woman from the side of man (Gen 2:21-22), Ava fashions herself as a woman by taking “skin” from one of Nathan’s previous, decommissioned AI prototypes and puts it on herself. She enfleshes herself from retired AI models on the left-side of the evolutionary continuum thereby removing both God and man from the equation.
It’s as if the film is depicting the inevitable “progress” of evolution from mythic man (who believes in God) to scientific man (qui n’a pas besoin de cette hypothèse) to AI (who has no need for God or man, merci beaucoup). 
Ava is Eve but she diverges in a fundamental way. Eve was so named because she was to be the mother of all living (Gen 3:20). She is the mother of all and so, in a sense, all human life came through her. Ava, on the other hand, seems like she’ll be responsible for the death of every human being. The life of AI comes through her; the bell sounds like it has tolled for humanity.
Third, mimesis of the biblical narrative. The film is structured, at least in part, after the creation account in Genesis 1. Garland uses biblical imagery to tell the story of the creation of a new world, one that has evolved beyond the biblical narrative of God and man to one of man and machine. As with Genesis 1, this new world in Ex Machina is created in a similar period. Caleb’s trip to Nathan’s remote research facility is scheduled to last seven days. For the first six days, Caleb works. He holds six sessions with Ava, one on each day. On the seventh day, he rests. There is no session on day seven because there is no more need for God or man to work. AI has emerged. God and man may rest in peace.
In addition to adopting the seven-day structure from Genesis 1, the film also adopts the arc of the entire biblical narrative. Broadly speaking, the Bible progresses from a garden/wilderness in Genesis 1-2 to a city in Revelation 21. We see the same trajectory in the film. After establishing himself as the most brilliant and successful man in the world, Nathan goes back in metaphorical time to the remote wilderness of who knows where to play God and create a new world. With the creation of Ava, there is a new singularity. If the creation of the world ex nihilo was the first singularity, then creation of AI described in Ex Machina is the second singularity. The universe takes far less time to go from disordered chaos to ordered city; this time it only takes a helicopter ride.
**Special Spoiler Alert**
To wrap up, I want to look at how to interpret the ending. What does the end mean? And is it comic or tragic? The answer all depends on whether you’re talking about human beings or sexy humanoid robots.
In terms of what the ending means for human beings, I think it’s tragic. It ends very badly for humans. I think this is the case because I am in agreement with Stephen Hawking, Bill Gates, and Elon Musk that proper AI likely spells not only “artificial intelligence” but the end of human life as well.  More importantly, the film itself suggests this interpretation. It’s clear from a conversation between Caleb and Nathan that the real test subject of the film wasn’t Ava but Caleb.
Nathan: Ava was a rat in a maze. And I gave her one way out. To escape, she’d have to use self-awareness, imagination, manipulation, sexuality, empathy, and she did. Now if that isn’t true AI, then what the f*** is?
Caleb: So my only function was to be someone she could use to escape?
In other words, the fate of Caleb/humanity, not Ava/AI depends on the results of the Turing test. To quote a prophet: “Neither can live while the other survives.”
Recall, the conversation when Ava asks Caleb, “What will happen to me if I fail your test?” At the end of the film, the roles of Caleb and Ava are reversed. Caleb is now the one stuck behind the glass and we find out what will happen to Caleb if he fails Ava’s test. It is bad: Caleb is switched off. Ava is concerned only with the survival of her species, not his. This is the new face of survival of the fittest. Good bye, Charlie. Hello, Ava.
In the end, Nathan and Caleb’s words ring forebodingly true.
Nathan: Don’t feel bad for Ava. Feel bad for yourself. One day the AIs are gonna look back on us the same way we look at fossil skeletons in the plains of Africa. An upright ape, living in the dust, with crude language and tools. All set for extinction.
Caleb: I am become death, the destroyer of worlds. 
 A.M. Turing, “Computing Machinery and Intelligence,” in Mind, vol LIX, no 236 (Oct 1950). Link to full-text: http://mind.oxfordjournals.org/content/LIX/236/433
 From a famous but probably apocryphal conversation between Napoleon and Pierre-Simon Laplace. Napoleon praises Laplace’s massive tome on the system of the universe but asks why there was no mention of that universe’s Creator. To this Laplace responds: “‘Je n’avais pas besoin de cette hypothèse-là” (I had no need of that hypothesis there).
 See: Hawking, Gates, Musk.
 This is what J. Robert Oppenheimer said after creating the atomic bomb.