  Cooperative behavior, where one individual incurs a cost to help another, is
a wide spread phenomenon. Here we study direct reciprocity in the context of
the alternating Prisoner's Dilemma. We consider all strategies that can be
implemented by one and two-state automata. We calculate the payoff matrix of
all pairwise encounters in the presence of noise. We explore deterministic
selection dynamics with and without mutation. Using different error rates and
payoff values, we observe convergence to a small number of distinct equilibria.
Two of them are uncooperative strict Nash equilibria representing always-defect
(ALLD) and Grim. The third equilibrium is mixed and represents a cooperative
alliance of several strategies, dominated by a strategy which we call Forgiver.
Forgiver cooperates whenever the opponent has cooperated; it defects once when
the opponent has defected, but subsequently Forgiver attempts to re-establish
cooperation even if the opponent has defected again. Forgiver is not an
evolutionarily stable strategy, but the alliance, which it rules, is
asymptotically stable. For a wide range of parameter values the most commonly
observed outcome is convergence to the mixed equilibrium, dominated by
Forgiver. Our results show that although forgiving might incur a short-term
loss it can lead to a long-term gain. Forgiveness facilitates stable
cooperation in the presence of exploitation and noise.
