part three

Part 3: Probabilities

 

Generating random numbers that match a desired distribution is common in games, simulations, and other applications, but the way we represent random numbers in most programming languages is weak. We’ve built libraries for high-level manipulation of sequences; we could do the same for probability distributions. In this section we’ll sketch out a library of operators to manipulate probabilistic quantities.

A more powerful API is great, but we should aim higher. Modern programs often must automate important decisions in a world full of uncertainty, and our programming tools should help us make principled, evidence-based decisions.

For example: I have an algorithm that is on average 99.9% accurate at determining if a new account on a major social media site is a real person (good) or a bot (bad). If my algorithm predicted that a specific new account was a bot, would you delete that account? I hope not, because my algorithm is every new account is a bot. Since approximately 99.9% of new accounts on major social media sites are bots, my algorithm is about 99.9% accurate, but plainly it’s not acceptable to put it into production! How can we do better?