CHAPTER 5

Forks in the road

When you come to a fork in the road, take it.

Yogi Berra

SO far, our algorithms have been entirely deterministic; they have done the same thing every time we execute them with the same inputs. However, the natural world and its inhabitants (including us) are usually not so predictable. Rather, we consider many natural processes to be, to various degrees, random. For example, the behaviors of crowds and markets often change in unpredictable ways. The genetic “mixing” that occurs in sexual reproduction can be considered a random process because we cannot predict the characteristics of any particular offspring. We can also use the power of random sampling to estimate characteristics of a large population by querying ...

Get Discovering Computer Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.