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] Rolling a die has as many outcomes as there are sides on the die (usually six): 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:
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:
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:
Review
Going back over this lesson, briefly, here's what we learned:
- Probability theory is the mathematical study of randomness. We can use probabilities to reason about random events, and even make predictions about them.
- We represent probabilities in modern mathematics with a number between zero and one. We can represent this number as a fraction if we want; if we do, it will always be a proper fraction. A probability of zero means something is impossible, and a probability of one means it's certain. Anything in between represents some uncertainty.
- A random event is the outcome of any experiment that has at least two possible outcomes, and that has some uncertainty built in (so we can't say for sure which outcome will happen without running the experiment). The outcome of a coin flip is an example of a random event.
- The sample space of a chance experiment is the set of all of its possible outcomes. A coin flip has two outcomes in its sample space, heads and tails. Drawing a card from a standard deck has 54 outcomes in its sample space (including two jokers).
- An event is a subset of a chance experiment's sample space. It could have one outcome, or more than one. A coin flip coming up heads is an event with one outcome in it, and drawing a seven from a deck of cards is an event with more than one outcome in it (four outcomes, to be exact).
- Assuming that all of the outcomes in the sample space are equally likely, you can calculate the probability of an event by dividing the number of outcomes in the event by the number of outcomes in the whole sample space. The probability of a coin flip coming up heads is ½, because there is one outcome in the event, and there are two outcomes in the sample space.