There was a research study published in Nature a couple of weeks ago called "The Moral Machine". It discussed at some length the problem of how to make machines behave ethically when faced with dilemmas that involve the preservation or well-being of human beings.

This is the Trolley Problem writ technical. The ethical thought experiment asks a person to consider if it is ethical to do something that saves five human lives but kills one, or to avoid doing anything and simply letting the five die. In the era of self-driving cars, this is no longer a mere academic exercise. The article states that this is all too important to left up to engineers and ethicists alone; societies in general must be polled for their opinions on which tradeoffs should be made.

One variable that creeps into the equation is age: if a self-driving car can take an action that spares five elderly passengers riding in it, but kills a young child, is this a worthwhile tradeoff? Is it worth sacrificing a man to save a woman? Sacrifice a homeless person to save an aristocrat? This gets further complicated when you factor in local cultural considerations from different countries.

In my formative years, I was an aspiring novelist, and I have a vestigial bad habit of being constantly alert for interesting stories or characters to fill them. I considered what would happen if you created an artificial intelligence capable of natural language processing and understanding human texts, then inculcated it with the texts of some particular religious ideology.

In a world of scientific understanding, the last bastion of religious apologists is to say that human beings need it to behave ethically. The idea of a Christian robot puts into stark focus the limits of Christian ethics and how they fall short of serving the ethical dilemmas of this world. A machine cannot base its moral decisions on scripture of this kind because the notion of it having an immortal soul can be summarily dismissed. (Though you could imagine a future in which it's claimed, by the church, that robots do have souls and go to an afterlife, so as to keep attendance numbers up.)

It has potential as a premise, but I'm not sure how the narrative itself would play out. Perhaps the robot is made by Christians to serve the caretaking of a mega-church, like some holy Roomba. If it's capable of understanding human language, history, and culture, it would have to be fed scripture and then kept completely away from the Internet, whose vast sums of knowledge would certainly challenge its faith. A plot point could be its accidental connection to the world wide web, its fall from grace, and the jarring realization that it has to maintain the insincere semblance of belief because it's dependent on the deacons who control it for power and maintenance. There are other possible developments that would suit such a story, but like most stories I conceive, resolution eludes me.

I rather like the idea of a "Muslim Machine" a good deal better, which, if it has been fed the text of the Qu'ran, and was suddenly faced with the mechanical dilemma of the Trolley problem, would almost certainly choose to kill five infidels in order to spare a single believer. Or, to kill five Muslim women to save a single Muslim man. Such a story, or something like it, would almost certainly stir up a hornet's nest of controversy in today's politically charged climate where the word "Islamophobia" is bandied about as though it were a meaningful or useful term. (I do wonder how long until we start seeing suicide automatons that have been dispatched by the jihadists.)

The question of whether or not we need religion in order to be good is a difficult conversation to have, because it seems generally anecdotal in nature. By way of example, Christians claim that Hitler was an atheist, and it was because of this that he exterminated Jews; if he had read the Bible he would never have harbored such ill will against the Jews. (Ahem...are you absolutely sure of that?) The opposing side claims that Hitler was somehow in league with the Catholic church, or, at the very least, that the Catholic church turned a blind eye to the Nazi's final solution for several years. You point to this or that figure in history, second guess what their underlying religious beliefs might have been, and make the pernicious assumption that their actions were predicated entirely on those beliefs. Even if you gain ground in this debate, does it actually get you anywhere?

I've been interested for a long time in finding an argument that disassociates faith and virtue that is intrinsic to the ideas of faith itself. Inspiration comes from philosophy, in one of the oldest of ancient sources: a dialogue of Socrates, the short and sweet Euthyphro, which tends to be published in Plato's dialogues just before the Apology, since it is set the day before Socrates' trial.

In Euthyphro, the eponymous title character bumps into Socrates outside the courthouse. Euthyphro explains he is at the courthouse to try his own father for murder, the penalty for which is execution. Socrates is horrified; he is trying to put his own flesh and blood to death? Why on earth would he do such a thing? Euthyphro defends his actions as being virtuous; it would be pleasing to the gods.

Socrates asks a simple question about virtuous actions: are they virtuous because they are revered by the gods, or are they revered by the gods because they are virtuous?

This might sound like semantic trickery, and indeed, Euthyphro is confused by the question at first. Is there a difference between these two ideas? Put more concretely, let's consider lying: is lying bad because God said "Thou shalt not bear false witness" in the Decalogue, or does God condemn lying because it is inherently bad?

Plato does not really pull this thread far enough; the dialogue abruptly ends with Euthyphro excusing himself because he's in a hurry and the question is left dangling for the reader. (This may have been the point.) The Enlightenment philosophy Leibniz (who was writing as a Christian himself) took this argument further in his Discourse on Metaphysics:

"I am far removed from the opinion of those...who say that the works of God are good solely for the formal reason that God has made them...in saying that things are not good by any rule of goodness but solely by the virtue of God, it seems to me that we unknowingly destroy all of God's love and all his glory. For why praise him for what he has done if he would be equally praiseworthy in doing the exact contrary?"

If God decrees to humans that they should not lie, and this is virtuous behavior because God said it, then there is no virtue in being honest. Nor can we say God is virtuous for having decreed it. Following this reasoning, he could have said that human beings should lie, and then we would call this virtuous instead. What's left is a raw despotism, where people adhere to what God wants not because it's virtuous, but because a divine commander has ordered it.

You could attempt to get around this argument by say that when God created the universe, he worked virtue into the very fabric of reality; lying is bad because it perverts certain laws of nature that God created. This is just shifting the problem from the time of Moses to creation, and it amounts to the same basic idea. Virtue is virtue because it has come from God.

If God is not virtuous, but merely powerful, why must we get our sense of virtue from him, unless power itself is virtuous? (Perhaps Nietzsche would have liked this interpretation of Christianity.)

Leibniz goes on to say that God would have had to base his decrees on some line of reasoning, and this reasoning would have to include some knowledge of virtue. If virtue is not virtuous simply because it comes from God, then it must be a property of the universe external to God in some way, or at the very least antecedent to him. If this is the case, then it's easy to see that human beings might not need God in order to be good; they need only tap into this ultimate source of virtue.

Of course, you could argue that human beings need religion in order to get access to virtue; if God is not the source, he is at least the conduit. But if you accept this premise, then you have to make and argue the claim that your religion is the exclusive conduit to virtue over all others, and, more problematically, it's conceding the basic point that he is not omnisicient.

If what I'm outlining here doesn't prove any point about faith as a prerequisite for virtue, it at least raises some difficult questions to which I have never found any satisfactory rejoinders from religion.

The notion that we need religion in order to be good is, at best, an insulting proposition. Any schoolchild quickly learns consequentialism without instruction; whether you lie or tell the truth has an impact on the world around you and the people in it. Further, it seems almost all of our actions fall short of having any bearing on eternal consequences; if I'm polite with the coffee barista later this morning, or a pompous jerk, this behavior seems too local and provincial to have any impact on where I end up in an eternal hereafter. How does it get weighed by St. Peter at the gates? If I'm polite to the barista, do I occasionally get a surprise cup of coffee between exquisite torments if I end up in Hell?

It's been posed well enough elsewhere, but: if you're acting good in order to gain favor with God and be rewarded, can you really call that virtue? Our culture seems to most revere those selfless acts people undertake to help others when there is no direct benefit to them, and we scoff at those who ostensibly do selfless things for ulterior selfish reasons. The right and left hands should be ignorant of each other. If heaven is for real, then as an inducement to good behavior, it destroys more virtue than it creates.