I recently read an interesting article about self-driving cars and ethics.

As self-driving car technology continues to be developed, important ethical questions are raised. For instance, at some point, a variation of the "trolley problem" thought experiment will become a statistically inevitable reality. The computer in such a machine will have to make a decision where any outcome may result in the injury or death of one or more people.

Let's assume that some time in the future, this technology proliferates and is in common use. A car is speeding along in autopilot mode, when a careless pedestrian steps directly in front of the vehicle. There is no place for the car to safely move - there are objects on both sides. If the car swerves to avoid the pedestrian, it will crash and the driver will be killed. If the car does not swerve, the pedestrian will be struck and killed. How should such a decision be made?

Should the computer take into account that the pedestrian is at fault, and allow them to be struck?

What if there are two pedestrians and one person in the car? Should the computer sacrifice the driver since this choice would ultimately save two lives while costing only one? Would the driver even be aware beforehand that such a rule existed?

What if the computer could not fully determine the cost of swerving the car? For instance, in doing so to save two pedestrians, the car has a head-on collision with another vehicle resulting in even more deaths.

What if there are two (adult) pedestrians, and two people in the car (one adult and one small child)? Should the life of a small child have any bearing on the ultimate decision made by the computer?

What other potentially devastating decisions could such a machine be faced with?

I have always been fascinated by ethical quandaries, and have used the trolley problem myself to spark discussion amongst friends in the past. While considering these problems from a human perspective is interesting, I wonder if considering them from a programming perspective is as interesting to anyone else here.