O'Reilly logo

Statistics Hacks by Bruce Frey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #66. Play a Tune on Pascal's Triangle

Need to know the odds quickly? Pascal's Triangle is a simple layout of numbers that allows for quick and easy calculations of probability. It's worked for 300 years, so I bet it will work for you.

The thing that statisticians do most often is calculate probabilities, which can describe expected outcomes for a variety of situations. A simple example is flipping a coin. Imagine that you have been asked to wager on the outcome of a coin flip. With two possible outcomes, heads or tails, the chances of getting either outcome on a single coin flip is 1 out of 2, or 1/2.

The math is easy if you know the number of different ways to get the winning outcome and the number of possible outcomes. In the coin flip example, there's only one way to get a winning outcome, and there are only two possible outcomes. The math is just a bit harder if we have more than one coin flip and wonder about the number of all possible outcomes and how many of those combinations would match our winning criteria. For example, if I want two heads in a row on two coin flips, I could list all possible outcomes, identifying the number of those outcomes that make me a winner, and then see what proportion of all outcomes are winners for me. That proportion would be my chances of winning.

The number of possible outcomes that count as winners is often more complex than our simple coin flip examples, though, because there might be many trials (or dice rolls, or purchase of lottery ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required