Imagine you’re a student and your teacher poses this challenge to the entire class:

You can each earn some extra credit on your term paper. You get to choose whether you want 2 points added to your grade, or 6 points. But there’s a catch: if more than 10% of the class selects 6 points, then no one gets any points. All selections are anonymous, and the course grades are not curved.

I pose this exact challenge to students each semester in my social psychology course at the University of Maryland. This summer, one of my students happened to tweet about it, and his reaction went viral. This puzzle has resonated with millions of people around the globe—in the past week I’ve gotten responses from people in Poland, Spain, Italy, Croatia, New Zealand, and Paraguay, to name a few.

This exercise impels students to consider how their actions affect others, and vice versa. I’ve been giving it to students since 2008, and only one class has successfully mastered the challenge. In all other classes, more than 10 percent chose 6 points. Students’ temptation to reach for more points is very strong, and they often express exasperation when things don’t go their way. Last semester after I announced the results, one student threw up her hands and emphatically said, “If only everyone chose 2 points, we all would have gotten the points!”

Many professors in my field use versions of this exercise, which was first developed 25 years ago. I learned it as an undergraduate studying psychology under Steve Drigotas at Johns Hopkins. (I chose 2 points, and watched with extreme frustration as those points were lost when too many of my classmates choose 6 points.) As climate change and population growth threaten our resources, the experiment is more relevant now than ever.

This exercise illustrates the tragedy of the commons (or the “commons dilemma”), and is very similar to other exercises developed by behavioral scientists and game theorists (such as the “prisoner’s dilemma”). In cases like these, there’s a public resource that people can freely use to benefit themselves. In the classroom example it’s points, but in the real world the resource can be food, water, land, electricity, etc. If everyone is mindful about collective consumption and limits their personal use, the group will thrive. But if too many people behave selfishly (trying to maximize their own personal outcomes), then the group eventually suffers and everyone is left with nothing as the public resource is depleted.

It feels good to be cooperative both from a strategic and moral perspective. After all, if every student chose 2 points, everyone would get the extra credit, thus making it a rational choice. Furthermore, it’s the communal choice, based on an ethical imperative to do what’s best for others in the group. But many students choose the seemingly selfish option. Why? Perhaps to increase their own grades, or perhaps because they fear that they will be taken advantage of. No one wants to be the chump that chooses fewer points when they could have had more. The ideal scenario would be if everyone else was cooperative but you were selfish, thereby maximizing your reward while maintaining the health of the group. But it rarely works out that way, and people often find themselves in deadlocks of mistrust with others in their group.

Some have asked me if today’s college students are more prone to self-interested behavior. I don’t think that’s the case. The temptation to be self-serving in these situations is not new. Communities have been grappling with the commons dilemma for centuries (during food shortages, for example), although now it may be more of a problem given our skyrocketing population numbers. With billions more people, the planet’s natural resources may not be enough to sustain us.

Studies have shown that women are slightly more likely than men to choose the cooperative option in games like these, especially when comparing all female groups to all male or mixed groups, but the gender difference is small and inconsistent. Of course, personality traits also matter. Some people are just more self-centered than others.

Following this exercise, the students and I discuss ways we can apply research findings to reduce overconsumption of resources. Some strategies rely on punishments or incentives (what psychologists call “operant conditioning”). For example, California now fines people for using too much water. Another strategy relies on shame rather than money; we could make people’s behavior publicly identifiable so they are no longer anonymous (a former student suggested that I write a list of all people who chose 6 points for the whole class to see). Threats to reputation can be a powerful motivator.

Other research suggests that we can change behavior through social norms. In one study, researchers examined whether people staying at a hotel chose to reuse their towels or requested fresh ones each day (which requires a lot more water, oil, and laundry detergent). Compared to simply giving people appeals for the cause (“Help save the environment”), researchers found that a more effective message was to tell hotel guests that most other people who stayed there reused their towels (“Join your fellow guests in helping to save the environment”). In this case, people conformed to the group’s positive behavior.

Perhaps I’ll try that variation next semester and (dishonestly) tell my students that more than 90 percent of former students chose 2 points, to see if that increases cooperation. But more importantly, I want students to consider how studies like these can be applied to large-scale environmental problems like climate change. We need to find ways to curb harmful behaviors that are detrimental to the planet (such as excessive meat consumption), and psychological science gives us some solutions.

I don’t believe that choosing 6 points makes a person selfish or immoral. I like to think of this exercise as similar to Neo’s first attempt to jump across skyscrapers in “The Matrix.” The other characters explain that everyone fails their first jump. Of course, Neo predictably falls. But at the end of the film, he flies. By the same token, it’s tough to get a large group of young adults to cooperate on the first go-around. But even if students don’t get any extra credit points added to their grade this time, I hope that any students who take my class will be better able to navigate the social world and effectively collaborate with others in the future because of the lessons they learned from social psychology. Like Morpheus, I want to free their minds. When people leave my classroom, I want them to realize they have the tools to change the world for the better, and to help usher us into a more enlightened society.