A Nash equilibrium is a set of strategies where no player can do better by changing theirs alone — everyone is already best-responding to everyone else. Nash proved that every finite game has at least one (in mixed strategies). In the prisoner’s dilemma it is mutual defection: individually rational, collectively worse than cooperating. The knot at the heart of why rational agents get stuck.
The demo checks the prisoner’s dilemma: (defect, defect) is a Nash equilibrium, (cooperate, cooperate) is not: live demo
“The Nash equilibrium is the best outcome for the players.” — it is stable, not optimal; the prisoner’s dilemma’s equilibrium is worse for both than cooperating. cited
Stable is not the same as good. theorem
On i-13, with payoffs T>R>P>S, (D,D) has no profitable deviation while (C,C) does:
R dominant_defect = 1