When properly applied, randomness can be a powerful tool in programming, science, and art. This highly practical but geekily fun introduction to randomness shows you how to put chaos to work, illustrating its ability to power everything from the simulation of Darwinian evolution, to product placement in a grocery store, to hiding information in plain sight, and even how to generate art and music. By encouraging you to engage in 'what if' speculation, you'll build intuition about when and how to use randomness to get things done. Each chapter describes how randomness plays into the given topic area, then proceeds to demonstrate its problem-solving role with hands-on experiments to work through using Python code. By the end of the book, you'll see why randomness belongs in every programmer's toolbox. Explore the mathematical background of randomness, use randomness for encrypting messages, creating models, and implementing swarm-intelligence or machine-learning algorithms, discover how randomness is used in programming applications, and apply it to your own work.