Programming Ethics: The history of the trolley dilemma and its impact on modern technology
From the trolley dilemma to the ethics of autonomous vehicles: the evolution of a thought experiment into practical guidance
In the world of ethics and moral philosophy, there are thought experiments that have become a permanent part of the history of human thought. One of the most fascinating and at the same time disturbing is the trolley dilemma, which has been provoking discussions and forcing deep reflection on the nature of human moral choices for over half a century.
History and basic assumptions
It all started in 1967, when a British philosopherPhilippa Footpresented the world with a seemingly simple scenario: a speeding trolley is heading towards five people tied to the tracks. The observer is located at a lever that can redirect the vehicle to another track with one tied person. Should you take action and actively contribute to the death of one person in order to save five others?
Evolution of the dilemma
This fundamental dilemma evolved rapidly in the 1970sJudith Jarvis Thomsonintroduced a more personal version of it.1In its variant, the observer stands on a footbridge over the tracks and next to him is a person of considerable stature. Pushing this person onto the tracks would have stopped the car and saved five lives. Although the equation remains mathematically the same – one life in five – people’s reactions to these two scenarios differ significantly.
Neurological examinations
Neurological research conducted by Joshua Greene’s team has significantly expanded our understanding of the moral decision-making process.2The experiment used functional magnetic resonance imaging (fMRI) to observe the brain activity of 45 participants while solving moral dilemmas. The key finding was that different versions of moral dilemmas activate different areas of the brain.
While in the classic trolley dilemma, the participant must decide oshifting the switch, to direct the speeding wagon onto the track where one person dies instead of five, in the footbridge dilemma the situation is more personal. The participant is on a footbridge over the tracks with a person of considerable stature. The only way to save five people from an approaching wagon is to push that person onto the tracks – his body will stop the wagon, but he will die. In both cases, the mathematical balance is the same – one person’s sacrifice saves five others. However, research shows that while most people accept switching in the first dilemma, much fewer are willing to physically push a person down in the second case.

When solving personal dilemmas (such as the footbridge dilemma), increased activity was observedmedial prefrontal cortex (BA 9/10)andposterior cingulate cortex (BA 31)– areas traditionally associated with the processing of emotions and social evaluation. However, in the case of impersonal dilemmas (such as the trolley dilemma)the dorsolateral prefrontal cortex showed greater activity (BA 46), the region responsible for rational thinking and planning.
Involvement of the angular gyrus (BA 39) and the parietal lobe (BA 7/40), areas responsible for the integration of sensory information and decision-making, was also observed.

This suggests that study participants had to consciously overcome their intuitive, emotional response. These results show that our moral decisions are not simply the result of cold calculation, but arise from a complex interaction between the emotional and rational systems in our brain. This has important implications for the design of artificial intelligence systems – it suggests that effective moral decision-making may require considering both a rational component and some equivalent to human emotion.
A global survey of moral preferences
Breakthrough discoveries in the global context of decision-making ethics were brought by the results of the „Moral Machine” project conducted in 2018 by the MIT Media Lab. Under the leadership of Edmond Awad, an impressive number of over 40 million decisions were collected from 2.3 million respondents in 233 countries, enabling an unprecedented analysis of cultural differences in moral decision-making.3
The study revealed three fundamental, universal moral preferences: a priority to protect more lives, a special concern for young people, and a preference for saving law-abiding people. Statistics show clear trends – 76% of respondents from Western countries preferred rescuing younger people, 81% preferred rescuing more people, and 50% of respondents preferred rescuing pedestrians who follow the rules.4The results showed that, globally, we favor rescuing people over animals, larger groups over smaller ones, and the young over the elderly. We would most like to save children and pregnant women, and the least willing would be to save criminals and animals.

B: Test scenario presenting a moral dilemma for an autonomous car: Should I continue driving straight and hit three elderly pedestrians at a red light, or should I swerve and kill the three people in the car?


A detailed analysis of the data allowed us to distinguish three main „moral clusters”: western (Europe and North America), eastern (Far Eastern and Islamic countries) and southern (Latin America). Each of these clusters was characterized by different ethical preferences, which is best seen in the example of the southern cluster, which showed a much stronger preference for saving women compared to the other regions.
Moral decisions were also significantly influenced by economic and cultural factors. Countries with an individualistic culture were more likely to support saving more people. Wealthier countries showed less tolerance for pedestrians breaking the rules, while countries with greater social inequality showed a stronger preference for rescuing those with higher social status.
The results of the study clearly indicate that, despite the existence of certain universal moral values, the way of making difficult ethical decisions is deeply rooted in the cultural context. This is crucial to the development of artificial intelligence, especially in the context of programming autonomous vehicles, which will need to make similar moral decisions in real time.
Contemporary applications
Nowadays, the wagon dilemma has gained a new, practical meaning in the context of technology development. Autonomous vehicle designers face similar moral choices – should a car protect its passengers at all costs, or should it sacrifice them to save more pedestrians? These questions are no longer just theoretical considerations, but real engineering and ethical problems.
Research conducted by the teamBonnefonand published in Science in 2016 demonstrated an interesting paradox in human thinking. Respondents overwhelmingly (76%) agreed that autonomous vehicles should be programmed to sacrifice a passenger when doing so could save more people. However, at the same time, the same respondents (only 23%) declared much less willingness to purchase or use a vehicle that could prioritize the lives of others over their own.5
Mercedes-Benz was the first car manufacturer to officially take a stance on this issue, declaring in 2016 that their autonomous vehicles would prioritize passenger safety6. This decision sparked intense ethical debate in the automotive industry and among road safety experts.
In 2017, the German Federal Ministry of Transport and Digital Infrastructure took a pioneering step in regulating the ethical aspects of autonomous motoring7. The Commission on the Ethics of Automated and Connected Road Traffic established by the ministry, chaired by former judge of the Federal Constitutional Court Udo Di Fabia, developedthe world’s first comprehensive set of ethical guidelines for autonomous vehicles.
The fundamental principle adopted in the German guidelines is the absolute priority of protecting human life. The document clearly states that autonomous systems must be programmed so thatto prevent accidents in the first placeandprotect human life, putting these values ahead of any other utility or economic considerations. What is particularly important is that the guidelines introduce a revolutionary principleprohibiting differentiationpotential accident victims based on any personal characteristics, such as age, gender, social origin or economic status. Another key aspect of German regulations is the requirement for full transparency and accountability. Every decision made by an autonomous system must be traceable, and responsibility for any damage must be clearly defined.
Vehicle manufacturers are required to thoroughly document the decision-making processes of their systems and store this data securely. There is also a requirement to inform users about the capabilities and limitations of autonomous systems. The German guidelines have become a global standard and reference point for other countries and car manufacturers.
The largest German automotive companies – Mercedes-Benz, BMW and Volkswagen – have adapted their autonomous vehicle development programs to these requirements. The European Commission also relied on German solutions when creating pan-European regulations in this area. This shows how a single regulatory initiative can impact shaping global ethical standards in the development of new technologies.
The ethical dilemma of autonomous vehicles
The film „The ethical dilemma of self-driving cars” by Patrick Lin presents the key aspects of this problem in an accessible way:
The future and ethical challenges: AI, neuroethics and relevance to the modern world
The trolley dilemma, since its formulation by Philippa Foot in 1967, has undergone a significant transformation – from a theoretical thought experiment to a practical tool for examining morality. Neurological and psychological research has revealed that our responses to this dilemma are deeply rooted in the evolutionary history of our species, as seen in the differences between responses to direct action (pushing a person off a footbridge) and an abstract decision (pulling a lever).
Contemporary applications of the trolley dilemma, especially in the context of the development of artificial intelligence and autonomous vehicles, pose new questions to us: How to program AI systems to make ethical decisions? Should they be guided by pure utilitarian calculation or take into account more complex moral aspects? Global research such as MIT’s „Moral Machine” project shows that the answers to these questions vary significantly depending on cultural context.
Paradoxically, the greatest value of this dilemma lies not in finding clear answers, but in the questions it provokes and the discussions it initiates. In a world increasingly dependent on automatic decision-making systems, understanding the mechanisms behind our moral choices is becoming not only a fascinating subject of research, but a practical necessity. The boxcar dilemma therefore remains not only a thought experiment, but also a key tool in designing ethical systems of the future.