Lesson 1: Introduction to Probability

Links

Beginnings

When we do things with mathematics, there's often one, precise, perfect answer. 1 + 1 is always 2, no matter what, and we can always be certain that a simple arithmetic equation will always come out the same way. This is only one part of mathematics, though. Often, in the real world, things can be shaky and uncertain. We can't use mathematics to predict, with absolute certainty, what will happen if we flip a coin (for example), the way we know what will happen if we add two numbers together. This doesn't mean we can't study uncertain things with mathematics, though, and it doesn't even mean we can't use mathematics to make predictions: we just have to find some way to account for uncertainty.

Probability theory is the mathematical study of randomness. We can apply mathematics to the way random events work to quantify exactly how certain, or uncertain, we are about the outcomes. Probability as we understand it today was invented in the sixteenth century to study games of chance, or gambling — in other words, the same kinds of things you'll be working with when you build your carnival game.[1] Some of the earliest mathematical work in this field comes from letters written between the mathematicians Pierre de Fermat and Blaise Pascal, who were interested in something called the problem of points. This problem deals with a game of chance where two people flip a coin (or something like that) over and over, and the first person to win a certain number of flips wins the game. Pascal and Fermat wanted to be able to know, in the middle of a game like this, which player was more likely to win. While they were thinking about this problem, they stumbled onto many of the concepts we'll be studying for the Carnival Tycoon project, such as probability trees and expected values.

When we talk about probabilities in modern mathematics, we always represent them as a number (you can represent it as a fraction, if you'd like to think about it that way; probabilities will always be proper fractions, with the numerator less than the denominator) between zero and one. The probability of some event occuring (we'll define exactly what an event is later on in this lesson) is zero if the event is completely impossible, and one if the event is completely certain. Most of the time we'll work with probabilities that are somewhere in the middle — for example, a probability of 0.5, or ½, represents an even 50% chance that the event will occur.

Randomness

Since we said that probability is the study of randomness, we need to talk a little bit about what randomness is. A random event can be thought of as the outcome of a chance experiment, which is an activity that has at least two possible outcomes, and also has uncertainty about which one will occur. Most of us are familiar with at least some kinds of chance experiments; in this lesson, we'll mostly work with three kinds: flipping a coin, rolling a die,[2] and drawing playing cards from a shuffled deck.

Sample spaces, events, and outcomes

Any given chance experiment has something called a sample space, which is the set [3] of all possible outcomes of the chance experiment. For example, the sample space for a coin flip has just two outcomes: heads and tails, one for each side of the coin. We might represent this sample space with mathematical set notation, like this: [4] S = {heads, tails} Rolling a die has as many outcomes as there are sides on the die (usually six): S = {1, 2, 3, 4, 5, 6} Finally, there are as many outcomes in a deck of cards as there are cards. We'll be working with a standard deck of 52 cards and two jokers for the rest of these lessons, because that's what's included with the Carnival Tycoon project kits. (We won't write down the whole sample space here, because that would take a lot of space!)

An event is a subset [5] of the whole sample space for the chance experiment. It might contain only one outcome, like a coin flip coming up heads, or it may contain more than one outcome, like drawing one of the four sevens from a deck of cards. We often need to think about events that contain more than one outcome, especially when there are a lot of different outcomes. Think about all of the different ways to get a full house in the game of poker!

Calculating probabilities

Once we know all of the outcomes in the sample space, we can calculate exact probability numbers for any event. Assuming that each individual outcome has the same chance of happening,[6] the probability (P) of some event (E) is: P = |E| / |S|

Let's try a few examples. Suppose we're flipping a coin, and we want to know the probability of flipping heads. The sample space has two outcomes in it — heads and tails — and our event only has one outcome in it, tails. This makes our probability math really easy:

1/2 = 0.5

Cards can be a little bit harder, because we often have events with more than one outcome in them. Suppose we want the probability of drawing a seven. There are four sevens in the deck, so our event has four outcomes in it, and the deck has 54 cards in total, so there are 54 outcomes in the whole sample space. The division still works the same way:

4/54 = 2/27 ~= 0.0741

Review

Going back over this lesson, briefly, here's what we learned: