Nature in Code
Nature in Code
$19.95
Minimum price
$19.95
Suggested price
Nature in Code

This book is 100% complete

Completed on 2016-12-07

About the Book

"Nature, In Code" is a new type of textbook that teaches programming in JavaScript by implementing key concepts in biology (natural selection, genetic drift, epidemics, evolution of cooperation, etc.) - everything runs in the browser.

If you are interested in learning programming, but find pure programming books, uhm, boring, this book is for you. Instead of just learning dry programming principles, you learn programming by implementing key biological concepts in code so that they run in your browser.

If you know a little (or a lot of) programming already, but want to learn more about the rules that govern life without having to pick up a dry, overpriced academic textbook, this book is for you too. You will learn some key ideas that form the basis of modern biology, from population genetics to evolutionary biology to infectious disease spread.

  • Share this book

About the Author

Marcel Salathe
Marcel Salathé

Marcel Salathé is an Associate Professor of Biology and Computer Sciences at EPFL, Switzerland. He's been developing for the web since the late nineties. He fell in love with programming by learning JavaScript, which is easy to pick up for total beginners like he used to be. 

Table of Contents

  • 1. Introduction
    • Acknowledgements
  • 2. The Genes, They Are a-Changin’
    • The Hardy-Weinberg Principle
    • What Does Boring Look Like?
    • Code
  • 3. Genetic Drift: The Power of Chance
    • Randomness
    • The Randomness of Finite Populations
    • Visualizing Drift
    • A Mathematical Formulation of Genetic Drift
    • Effective Population Size
  • 4. Mutation: The Power of Mistakes
    • The Fixation of Mutations
  • 5. Migration: Spatial Models
    • Quantifying Inbreeding
  • 6. Natural Selection: The Best Idea Anyone’s Ever Had
    • Directional Selection
    • Balancing Selection
    • Disruptive Selection
    • Coevolution
  • 7. Epidemics: The Spread of Infectious Diseases
    • The SIR Model
    • It’s a Small World
  • 8. Cooperation: Good Guys Can Finish First
    • Game Theory
    • A Game in Code
    • Revisiting Object Assignments
    • When Defection Outcompetes Cooperation
    • Repeated games
    • Win-stay, lose-shift
  • Epilogue

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub