Two members of a criminal gang are arrested and imprisoned. Each prisoner is in solitary confinement with no means of communicating with the other. The prosecutors lack sufficient evidence to convict the pair on the principal charge. They hope to get both sentenced to a year in prison on a lesser charge. Simultaneously, the prosecutors offer each prisoner a bargain. Each prisoner is given the opportunity either to: betray the other by testifying that the other committed the crime, or to cooperate with the other by remaining silent. The offer is:

- If A and B each betray the other, each of them serves 2 years in prison
- If A betrays B but B remains silent, A will be set free and B will serve 3 years in prison (and vice versa)
- If A and B both remain silent, both of them will only serve 1 year in prison (on the lesser charge)

Let’s analyze the nature of the dilemma assuming that both understand the nature of the game, and that despite being members of the same gang, they have no loyalty to each other and will have no opportunity for retribution or reward outside the game.

Prisoner B stays silent | Prisoner B betrays | |
---|---|---|

Prisoner A stays silent | Each serves 1 year | Prisoner A: 3 years Prisoner B: goes free |

Prisoner A betrays | Prisoner A: goes free Prisoner B: 3 years |
Each serves 2 years |

*Please try to think over the solution for a while and analyze each case yourself.*

By analyzing the table, we can see that:

**You are always punished less for choosing to betray the other person. However, as a group, both of you fare better by cooperating(remaining silent).**

Think over the above statement for a while.

If you have a problem in analyzing this then you can watch this video: Khan Academy’s explanation

This is the dilemma both the prisoner’s face. Should one cooperate or betray?

Even if the best solution would be both the prisoners cooperating with each other, but due to uncertainty on each other both of them betray each other getting a lesser optimum solution.

This can be observed in may real-life cases like:

- A pair working on a project. You do best if your competitor does all the work since you get the same grade. But if neither of you does the work, you both fail.
- Advertising. If both companies spend money on advertising, their market share won’t change from if neither does. But if one company outspends the other, they will receive a benefit.

The prisoner’s dilemma demonstrates that two rational people might not cooperate even if it is in their best interest to do so. Just keep looking around in this beautiful world. Who knows you can find yourself in a prisoner’s dilemma one day!

This article is contributed by **Aditya Nihal Kumar Singh**. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.