Cooperation, Competition & Simple Rules
Why do some groups thrive on trust while others collapse into selfishness? Chapter 8 in the book Nature in Code by Marcel Salathé (Leanpub) explores that question with playful simulations of game theory in action. You’ll start with the clash between simple cooperators and defectors, then see how the clever Tit-for-Tat strategy can build lasting partnerships through reciprocity. Finally, you’ll discover the adaptable Win-Stay, Lose-Shift approach, where success breeds repetition and failure sparks change. These experiments reveal how surprisingly simple rules can explain the rise of cooperation and how quickly it can break down.
Code draws heavily from the official examples (natureincode.com/code_examples.html).